{"openapi":"3.1.0","info":{"title":"GuruSup API","description":"![GuruSup](/static/gurusup-logo.svg)\n\n## GuruSup API\n\nGuruSup is the AI customer-support platform that unifies your channels (WhatsApp, email, live chat and more) and lets AI agents read, draft and reply to conversations. This is the public API for building your own integrations on top of GuruSup.\n\n**Base path:** all public endpoints are served under `/public/v1`.\n\n**Authentication:** send your organization API key in the `x-api-key` request header.\n\n**Compatibility:** response schemas describe the stable public fields. `/public/v1` may also return legacy properties so existing integrations keep working; clients should ignore response properties they do not use. Additional legacy request properties remain accepted.\n\n**Error format:** most failures return a JSON envelope `{ \"detail\": \"<human message>\", \"error_code\": \"<machine code>\" }`. Three exceptions use different shapes: authentication errors (`401`) return `{ \"error_code\", \"message\", \"timestamp\" }`, and rate-limit errors (`429`) return `{ \"error\" }`, while request validation errors (`422`) return `{ \"detail\": [...] }`. See each endpoint's response examples for the exact bodies. Common statuses: `400` invalid request / business rule, `401` missing/invalid API key, `404` resource not found, `422` request body validation, `429` rate limited, `503` transient upstream/provider error (safe to retry).\n\n---\n\nWebsite: [gurusup.com](https://gurusup.com) · Support: [support@gurusup.com](mailto:support@gurusup.com)","termsOfService":"https://app.gurusup.com/terminos_condiciones.pdf","contact":{"name":"GuruSup Support","url":"https://gurusup.com/","email":"support@gurusup.com"},"version":"1.0.0"},"paths":{"/public/v1/threads":{"get":{"tags":["public"],"summary":"Get all threads","description":"Retrieve a list of threads for the authenticated organization.","operationId":"get_threads_public_v1_threads_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From Date"}},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To Date"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},{"name":"last_sender_address","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sender Address"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"A list of threads associated with the organization.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThreadListItem"},"title":"Response Get Threads Public V1 Threads Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/v1/agents":{"get":{"tags":["public"],"summary":"Get all agents","description":"Retrieve a list of agents for the authenticated organization.","operationId":"get_agents_public_v1_agents_get","responses":{"200":{"description":"A list of agents associated with the organization.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AgentListItem"},"type":"array","title":"Response Get Agents Public V1 Agents Get"}}}}}}},"/public/v1/threads/{thread_fid_hash}":{"get":{"tags":["public"],"summary":"Get a specific thread","description":"Retrieve a thread by its unique identifier.","operationId":"get_thread_public_v1_threads__thread_fid_hash__get","parameters":[{"name":"thread_fid_hash","in":"path","required":true,"schema":{"type":"string","title":"Thread Fid Hash"}}],"responses":{"200":{"description":"Stable documented thread fields. Public v1 may also return legacy properties; clients should ignore response properties they do not use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadDetailResponse"}}}},"400":{"description":"Invalid request or business rule violation.","content":{"application/json":{"example":{"detail":"Invalid request","error_code":"VALIDATION_ERROR"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key. Auth errors use a distinct `{error_code, message}` envelope.","content":{"application/json":{"example":{"error_code":"INVALID_API_KEY","message":"Invalid or missing API key. Please check your credentials.","timestamp":"2026-07-15T08:18:38Z"}}}},"404":{"description":"The requested resource was not found.","content":{"application/json":{"example":{"detail":"Thread not found","error_code":"RESOURCE_NOT_FOUND"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Request body validation failed.","content":{"application/json":{"example":{"detail":[{"loc":["body","thread_format"],"msg":"Input should be 'email' or 'chat'","type":"enum"}]}}}},"429":{"description":"Rate limit exceeded — retry later. Rate-limit errors use a distinct `{error}` envelope.","content":{"application/json":{"example":{"error":"Rate limit exceeded: 100 per 1 minute"}}}},"503":{"description":"Transient upstream/provider error — safe to retry.","content":{"application/json":{"example":{"detail":"External service temporarily unavailable. Please try again later.","error_code":"EXTERNAL_SERVICE_ERROR"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/public/v1/attachments/signed-url":{"get":{"tags":["public"],"summary":"Get a signed URL for an attachment","description":"Generate a time-limited signed URL to download a private attachment from storage. The `path` parameter should be the relative URL returned in attachment objects (e.g. `attachments/{org_id}/{thread_hash}/{msg_id}/{filename}`).","operationId":"get_attachment_signed_url_public_v1_attachments_signed_url_get","parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}},{"name":"expiration_minutes","in":"query","required":false,"schema":{"type":"integer","default":15,"title":"Expiration Minutes"}}],"responses":{"200":{"description":"A signed URL valid for the specified duration.","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/v1/messages":{"post":{"tags":["public"],"summary":"Create a new message","description":"Send a new message to the specified thread.","operationId":"create_message_public_v1_messages_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageRequest"}}},"required":true},"responses":{"200":{"description":"Stable documented message fields. Public v1 may also return legacy properties; clients should ignore response properties they do not use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Invalid request or business rule violation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"Invalid request","error_code":"VALIDATION_ERROR"}}}},"401":{"description":"Missing or invalid API key. Auth errors use a distinct `{error_code, message}` envelope.","content":{"application/json":{"example":{"error_code":"INVALID_API_KEY","message":"Invalid or missing API key. Please check your credentials.","timestamp":"2026-07-15T08:18:38Z"}}}},"404":{"description":"The requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"Thread not found","error_code":"RESOURCE_NOT_FOUND"}}}},"422":{"description":"Request body validation failed.","content":{"application/json":{"example":{"detail":[{"loc":["body","thread_format"],"msg":"Input should be 'email' or 'chat'","type":"enum"}]}}}},"429":{"description":"Rate limit exceeded — retry later. Rate-limit errors use a distinct `{error}` envelope.","content":{"application/json":{"example":{"error":"Rate limit exceeded: 100 per 1 minute"}}}},"503":{"description":"Transient upstream/provider error — safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"External service temporarily unavailable. Please try again later.","error_code":"EXTERNAL_SERVICE_ERROR"}}}},"201":{"description":"Message from a support agent (`is_customer_support_agent: true`). The thread is archived and a lightweight acknowledgement is returned instead of the full message.","content":{"application/json":{"example":{"status":"success","created_message":{"thread":"3f8a...c1","fid":"your-message-id"}}}}},"409":{"description":"A message with the same `fid` already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"Message with fid 'your-message-id' already exists","error_code":"DUPLICATE_RESOURCE"}}}}}}},"/public/v1/organization/test-webhook":{"post":{"tags":["public"],"summary":"Test Webhook","description":"Test the webhook configuration for the organization","operationId":"test_webhook_public_v1_organization_test_webhook_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/v1/whatsapp/templates/{phone_number_id}":{"get":{"tags":["WhatsApp"],"summary":"List approved WhatsApp templates","description":"List the approved WhatsApp message templates for a `phone_number_id`.\n\nAuthenticate with the `x-api-key` header. Use the returned `name` and `language` values\nas `template_name` / `language_code` when calling `POST /public/v1/whatsapp/send-template`.\n\nTemplates are WABA-scoped — we resolve the matched phone's WABA (may differ from the org's\nprimary WABA when `phone_numbers` entries override it) and target it.","operationId":"whatsapp_list_templates","parameters":[{"name":"phone_number_id","in":"path","required":true,"schema":{"type":"string","title":"Phone Number Id"}}],"responses":{"200":{"description":"Approved templates available for the given phone number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappTemplateListResponse"}}}},"404":{"description":"phone_number_id is not configured for this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Transient WhatsApp/Meta error or temporary outage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/v1/whatsapp/send-template":{"post":{"tags":["WhatsApp"],"summary":"Send a WhatsApp template message","description":"Send an approved WhatsApp **template** message to a recipient.\n\n**Authentication** — send your organization API key in the `x-api-key` header.\n\n**Request fields**\n- `to` — recipient phone number in international format, **digits only, no `+`, spaces or\n  dashes** (e.g. `34622222222`). Required.\n- `phone_number_id` — the Meta phone number ID to send from. Must be configured for your\n  organization.\n- `template_name` — name of an approved template (list them via\n  `GET /public/v1/whatsapp/templates/{phone_number_id}`).\n- `language_code` — Meta BCP-47 code that matches the template (e.g. `es`, `en_US`).\n- `components` — template variables (header / body / buttons). **Required when the template\n  has variables**; send the same structure the template defines.\n- `text` — message body persisted as the conversation in GuruSup. Required, non-empty.\n\n**Failures** return the envelope `{ \"detail\": \"...\", \"error_code\": \"...\" }`:\n`422` request validation (e.g. blank `to`/`text`), `400` permanent error (fix and resend),\n`429` rate limited (retry later), `503` transient WhatsApp/Meta error (safe to retry).","operationId":"whatsapp_send_template","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTemplateRequestPublic"},"examples":{"simple":{"summary":"Template without variables","description":"Approved template that has no placeholders — omit `components`.","value":{"phone_number_id":"584207441453096","to":"34622222222","template_name":"welcome","language_code":"es","text":"Hola, te damos la bienvenida a GuruSup."}},"with_variables":{"summary":"Template with body variables","description":"Template with placeholders — send the matching `components`.","value":{"phone_number_id":"584207441453096","to":"34622222222","template_name":"order_update","language_code":"en_US","components":[{"type":"body","parameters":[{"type":"text","text":"John"},{"type":"text","text":"#12345"}]}],"text":"Hi John, your order #12345 has shipped."}}}}},"required":true},"responses":{"200":{"description":"Template accepted by WhatsApp.","content":{"application/json":{"schema":{},"example":{"status":"success","message_id":"wamid.HBgLMzQ..."}}}},"400":{"description":"Permanent send failure — fix the request (unknown template, bad components, language mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"WhatsApp could not send the template (Meta error 132001: Template name does not exist)","error_code":"WHATSAPP_132001"}}}},"422":{"description":"Request body validation failed (e.g. blank `to` or `text`).","content":{"application/json":{"example":{"detail":[{"loc":["body","to"],"msg":"Value error, to (recipient phone number) is required and cannot be empty","type":"value_error"}]}}}},"429":{"description":"Rate limited by Meta — retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"WhatsApp could not send the template (Meta error 4: Application request limit reached)","error_code":"RATE_LIMIT_EXCEEDED"}}}},"503":{"description":"Transient WhatsApp/Meta error or temporary outage — safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"detail":"WhatsApp could not send the template (Meta error 131000: Something went wrong)","error_code":"EXTERNAL_SERVICE_ERROR"}}}}}}},"/public/v1/send-proactive-email":{"post":{"tags":["public"],"summary":"Send a proactive email","description":"Send an outbound email that creates a new conversation thread. Supports attachments via URL or base64 data.","operationId":"send_proactive_email_public_public_v1_send_proactive_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendProactiveEmailRequestPublic"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendProactiveEmailResponsePublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/v1/outbound-calls":{"post":{"tags":["outbound-calls"],"summary":"Create Public Outbound Call","description":"Request an outbound call using the authenticated organization's triage agent. Requires outbound voice enabled and configured outbound telephony. Repeat the same dedup_key to retrieve the same order, not place another call. 202 acknowledges the order, not connection to the recipient; poll GET for its status. reason: at most 2,000 characters; dedup_key: at most 200; language: at most 35. Oversized strings and unknown fields return 422. case_data is limited to 4,096 bytes of compact UTF-8 JSON (unescaped Unicode); exceeding that limit returns 400. Invalid requests do not create or enqueue a call.","operationId":"create_public_outbound_call_public_v1_outbound_calls_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicOutboundCallRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicOutboundCallResponse"}}}},"400":{"description":"Invalid input, including case_data exceeding 4,096 bytes."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/v1/outbound-calls/{order_id}":{"get":{"tags":["outbound-calls"],"summary":"Get Public Outbound Call","operationId":"get_public_outbound_call_public_v1_outbound_calls__order_id__get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicOutboundCallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Action":{"properties":{"_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"The organization id of the action."},"credential_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credential Id","description":"Optional reusable Credential selected for this action."},"name":{"type":"string","title":"Name","description":"A clear title for the action."},"description":{"type":"string","title":"Description","description":"A short explanation of what the action does."},"action_type":{"$ref":"#/components/schemas/ActionType","description":"The type of action to be performed."},"action_template":{"anyOf":[{"$ref":"#/components/schemas/HTTPActionTemplate"},{"$ref":"#/components/schemas/SQLActionTemplate"},{"$ref":"#/components/schemas/BuiltInActionTemplate"},{"$ref":"#/components/schemas/BrowserActionTemplate"},{"$ref":"#/components/schemas/BrowserUseActionTemplate"},{"$ref":"#/components/schemas/ComposioActionTemplate"},{"$ref":"#/components/schemas/MCPConnectorActionTemplate"},{"$ref":"#/components/schemas/PlaceholderActionTemplate"},{"$ref":"#/components/schemas/FileSearchActionTemplate"},{"$ref":"#/components/schemas/ShopifyActionTemplate"},{"$ref":"#/components/schemas/WhatsappTemplateActionTemplate"}],"title":"Action Template","description":"The template for the action."},"persistent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Persistent","description":"Whether the action should be persisted in the thread context.","default":false},"requires_approval":{"type":"boolean","title":"Requires Approval","description":"Whether this action tool must be approved before execution.","default":false},"ui_render_config":{"anyOf":[{"$ref":"#/components/schemas/UIRenderConfig"},{"type":"null"}],"description":"Configuration for the UI agent to generate rich content from this action's results."},"output_transform":{"anyOf":[{"$ref":"#/components/schemas/ActionOutputTransform"},{"type":"null"}],"description":"Declarative projection applied before the action result reaches the agent."},"parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters","description":"The parameters for the action."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","description","action_type","action_template"],"title":"Action"},"ActionOutputAssignment":{"properties":{"id":{"type":"string","maxLength":100,"minLength":1,"title":"Id"},"source":{"type":"string","maxLength":2048,"title":"Source","description":"RFC 6901 pointer into the action result."},"target":{"type":"string","maxLength":256,"minLength":1,"title":"Target","description":"Field name in the agent-facing output."},"type":{"$ref":"#/components/schemas/ActionOutputValueType","description":"Expected runtime type of the selected value."},"max_items":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":1.0},{"type":"null"}],"title":"Max Items"},"direction":{"$ref":"#/components/schemas/ActionOutputCollectionDirection","default":"first"},"fields":{"items":{"$ref":"#/components/schemas/ActionOutputAssignment"},"type":"array","maxItems":100,"title":"Fields"}},"type":"object","required":["source","target","type"],"title":"ActionOutputAssignment"},"ActionOutputCollectionDirection":{"type":"string","enum":["first","last"],"title":"ActionOutputCollectionDirection"},"ActionOutputSource":{"type":"string","enum":["result","data","response"],"title":"ActionOutputSource"},"ActionOutputTransform":{"properties":{"version":{"type":"integer","const":1,"title":"Version","default":1},"enabled":{"type":"boolean","title":"Enabled","default":true},"input_source":{"$ref":"#/components/schemas/ActionOutputSource","default":"result"},"assignments":{"items":{"$ref":"#/components/schemas/ActionOutputAssignment"},"type":"array","maxItems":100,"title":"Assignments"}},"type":"object","title":"ActionOutputTransform"},"ActionOutputValueType":{"type":"string","enum":["string","number","boolean","object","array","unknown"],"title":"ActionOutputValueType"},"ActionType":{"type":"string","enum":["http_request","sql_query","built_in","generic","browser","browser_use","composio","placeholder","file_search","shopify","mcp_connector","whatsapp_template"],"title":"ActionType"},"Agent":{"properties":{"_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"name":{"type":"string","maxLength":52,"title":"Name"},"description":{"type":"string","title":"Description","default":""},"system_prompt":{"type":"string","title":"System Prompt","default":""},"model":{"type":"string","title":"Model","default":"openai:gpt-6-luna"},"model_settings":{"$ref":"#/components/schemas/AgentModelSettings"},"connected_agents":{"items":{"type":"string"},"type":"array","title":"Connected Agents"},"behavior":{"$ref":"#/components/schemas/AgentBehavior","default":"generate_draft"},"actions":{"items":{"$ref":"#/components/schemas/Action"},"type":"array","title":"Actions"},"memory":{"items":{"type":"string"},"type":"array","title":"Memory"},"action_ids":{"items":{"type":"string"},"type":"array","title":"Action Ids"},"performance":{"$ref":"#/components/schemas/AgentPerformance","default":{"times_used":0,"times_changed":0,"accuracy":0.0,"average_similarity":0.0,"total_times_used":0}},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"version_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Version Date"}},"type":"object","required":["name"],"title":"Agent"},"AgentBehavior":{"type":"string","enum":["auto_reply","generate_draft"],"title":"AgentBehavior"},"AgentListItem":{"properties":{"id":{"type":"string","title":"Id","description":"Agent ID"},"name":{"type":"string","title":"Name","description":"Agent name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Agent description"},"behavior":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Behavior","description":"Agent behavior (auto_reply, generate_draft)"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Agent creation date"}},"type":"object","required":["id","name","created_at"],"title":"AgentListItem","description":"DTO for agent list endpoint"},"AgentModelSettings":{"properties":{"max_output_tokens":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Output Tokens"}},"type":"object","title":"AgentModelSettings"},"AgentPerformance":{"properties":{"times_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Times Used","default":0},"times_changed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Times Changed","default":0},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy","default":0.0},"average_similarity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Similarity","default":0.0},"total_times_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Times Used","default":0}},"type":"object","title":"AgentPerformance"},"AnswerDetection":{"type":"string","enum":["human","machine-vm","machine-unavailable","machine-ivr","uncertain"],"title":"AnswerDetection"},"Attachment-Input":{"properties":{"filename":{"type":"string","title":"Filename","description":"Name of the file including extension (e.g., 'document.pdf')"},"file_type":{"type":"string","title":"File Type","description":"MIME type of the file (e.g., 'application/pdf', 'image/jpeg', 'audio/mpeg')"},"url":{"type":"string","title":"Url","description":"URL to fetch the attachment from. If provided, data will be fetched automatically.","default":""},"data":{"anyOf":[{"type":"string"},{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Data","description":"File content as base64 string or raw bytes. If url is provided, this is populated automatically."},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size","description":"Size in bytes. None for attachments stored before this field existed."},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count","description":"PDF page count measured at ingest. None for non-PDF or historical attachments."},"processing_skip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Skip Reason","description":"Why this attachment remains stored but must not be processed by an agent."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Text read from the attachment at ingest, so later turns keep its context. None when it was not generated or generation failed."},"placement":{"$ref":"#/components/schemas/AttachmentPlacement","default":"unknown"},"region":{"$ref":"#/components/schemas/AttachmentRegion","default":"unknown"},"role":{"$ref":"#/components/schemas/AttachmentRole","default":"unknown"},"message_scope":{"$ref":"#/components/schemas/AttachmentMessageScope","default":"unknown"},"section":{"$ref":"#/components/schemas/AttachmentSection","default":"unknown"},"quote_depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quote Depth"},"body_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Reference"},"provider_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Reference"},"sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sha256"},"pixel_size":{"anyOf":[{"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2},{"type":"null"}],"title":"Pixel Size"},"layout_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layout Fingerprint"},"classification_reasons":{"items":{"type":"string"},"type":"array","title":"Classification Reasons"},"model_processing":{"anyOf":[{"$ref":"#/components/schemas/AttachmentModelProcessing"},{"type":"null"}]},"decoration_triage":{"anyOf":[{"$ref":"#/components/schemas/AttachmentDecorationTriage"},{"type":"null"}]}},"type":"object","required":["filename","file_type"],"title":"Attachment","description":"Attachment model for message file attachments."},"Attachment-Output":{"properties":{"filename":{"type":"string","title":"Filename","description":"Name of the file including extension (e.g., 'document.pdf')"},"file_type":{"type":"string","title":"File Type","description":"MIME type of the file (e.g., 'application/pdf', 'image/jpeg', 'audio/mpeg')"},"url":{"type":"string","title":"Url","description":"URL to fetch the attachment from. If provided, data will be fetched automatically.","default":""},"data":{"anyOf":[{"type":"string"},{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Data","description":"File content as base64 string or raw bytes. If url is provided, this is populated automatically."},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size","description":"Size in bytes. None for attachments stored before this field existed."},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count","description":"PDF page count measured at ingest. None for non-PDF or historical attachments."},"processing_skip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Skip Reason","description":"Why this attachment remains stored but must not be processed by an agent."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Text read from the attachment at ingest, so later turns keep its context. None when it was not generated or generation failed."},"placement":{"$ref":"#/components/schemas/AttachmentPlacement","default":"unknown"},"region":{"$ref":"#/components/schemas/AttachmentRegion","default":"unknown"},"role":{"$ref":"#/components/schemas/AttachmentRole","default":"unknown"},"message_scope":{"$ref":"#/components/schemas/AttachmentMessageScope","default":"unknown"},"section":{"$ref":"#/components/schemas/AttachmentSection","default":"unknown"},"quote_depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quote Depth"},"body_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Reference"},"provider_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Reference"},"classification_reasons":{"items":{"type":"string"},"type":"array","title":"Classification Reasons"},"model_processing":{"anyOf":[{"$ref":"#/components/schemas/AttachmentModelProcessing"},{"type":"null"}]},"decoration_triage":{"anyOf":[{"$ref":"#/components/schemas/AttachmentDecorationTriage"},{"type":"null"}]}},"type":"object","required":["filename","file_type"],"title":"Attachment","description":"Attachment model for message file attachments."},"AttachmentDecorationTriage":{"description":"The decision model's answer on whether an email image is decoration, recorded whether or not it applied.","properties":{"decoration_probability":{"title":"Decoration Probability","type":"number"},"kind":{"title":"Kind","type":"string"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Model Name"},"applied":{"default":false,"title":"Applied","type":"boolean"},"judged_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Judged At"}},"required":["decoration_probability","kind"],"title":"AttachmentDecorationTriage","type":"object"},"AttachmentMessageScope":{"enum":["current_message","quoted_message","unknown"],"title":"AttachmentMessageScope","type":"string"},"AttachmentModelProcessing":{"properties":{"reply_agent":{"anyOf":[{"$ref":"#/components/schemas/AttachmentProcessingResult"},{"type":"null"}],"default":null},"vision_description":{"anyOf":[{"$ref":"#/components/schemas/AttachmentProcessingResult"},{"type":"null"}],"default":null}},"title":"AttachmentModelProcessing","type":"object"},"AttachmentPlacement":{"enum":["attached","inline","body_remote","unknown"],"title":"AttachmentPlacement","type":"string"},"AttachmentProcessingResult":{"properties":{"status":{"enum":["pending","processed","excluded","failed","not_requested"],"title":"Status","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"},"attempted":{"default":false,"title":"Attempted","type":"boolean"},"updated_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"default":null,"title":"Updated At"}},"required":["status"],"title":"AttachmentProcessingResult","type":"object"},"AttachmentRegion":{"enum":["current_content","signature_footer","quoted_history","unknown"],"title":"AttachmentRegion","type":"string"},"AttachmentResponse":{"properties":{"filename":{"type":"string","title":"Filename","description":"File name including extension"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type","description":"MIME type of the file"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"URL to fetch the attachment, when available"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Transcription/description, when available"}},"additionalProperties":true,"type":"object","required":["filename"],"title":"AttachmentResponse","description":"Public view of a message attachment — never exposes raw file data."},"AttachmentRole":{"enum":["customer_content","email_decoration","unknown"],"title":"AttachmentRole","type":"string"},"AttachmentSection":{"enum":["content","signature","unknown"],"title":"AttachmentSection","type":"string"},"BrowserActionTemplate":{"properties":{"query":{"type":"string","title":"Query","description":"An string containing the steps to be performed in the browser in playwright code."}},"type":"object","required":["query"],"title":"BrowserActionTemplate"},"BrowserUseActionTemplate":{"properties":{"query":{"type":"string","title":"Query","description":"A string containing the operation logic for the operation, including placeholders like `{{{{table_name}}}}`, `{{{{email}}}}`, etc."},"version":{"$ref":"#/components/schemas/BrowserUseVersion","description":"Browser Use Cloud API version.","default":"v2"},"v4_max_cost_usd":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"V4 Max Cost Usd","description":"Optional Browser Use V4 run cost cap. Omitted from the provider request when unset."},"v4_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"V4 Model","description":"Browser Use V4 model id for this action. The executor's default model is used when unset."},"requires_authentication":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Requires Authentication","description":"Whether the action expects an authenticated organization browser profile."},"authentication_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authentication Domain","description":"Bare domain where the user authenticated the organization browser profile."},"authentication_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authentication Url","description":"Login URL used to prepare the organization browser profile for an authenticated action."},"allow_v2_fallback":{"type":"boolean","title":"Allow V2 Fallback","description":"Legacy compatibility switch. Native V4 actions disable fallback when they are created.","default":true},"credentials":{"anyOf":[{"$ref":"#/components/schemas/BrowserUseCredentials"},{"type":"null"}],"description":"Optional credentials available to Browser Use actions."},"exclusive_runs":{"type":"boolean","title":"Exclusive Runs","description":"Run one at a time per identical inputs, so a repeated request waits instead of acting twice.","default":false}},"type":"object","required":["query"],"title":"BrowserUseActionTemplate"},"BrowserUseCredentials":{"properties":{"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","description":"Domain where the credentials can be used, without protocol."},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"User identifier for the Browser Use credentials."},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password","description":"Password for the Browser Use credentials."}},"type":"object","title":"BrowserUseCredentials"},"BrowserUseVersion":{"type":"string","enum":["v2","v3","v4"],"title":"BrowserUseVersion"},"BuiltInActionTemplate":{"properties":{"name":{"type":"string","title":"Name"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters"}},"type":"object","required":["name","parameters"],"title":"BuiltInActionTemplate"},"CallOutcome":{"type":"string","enum":["answered","busy","rejected","no_answer","unreachable","provider_failure","system_failure","agent_unavailable","blocked_by_schedule","blocked_by_do_not_call","cancelled"],"title":"CallOutcome"},"ComposioActionTemplate":{"properties":{"toolkit_version":{"anyOf":[{"type":"string","pattern":"^[0-9]{8}_[0-9]{2}$"},{"type":"null"}],"title":"Toolkit Version"},"name":{"type":"string","title":"Name","description":"The specific name of the business-oriented operation performed on the application (e.g., 'Create Lead Record', 'Find Customer Ticket', 'Retrieve Guide Email'). This name should clearly describe the functional purpose of the operation."},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query","description":"A string containing the operation logic for the operation, including placeholders like `{{{{table_name}}}}`, `{{{{email}}}}`, etc."},"type":{"type":"string","title":"Type","description":"Must be one of the allowed applications (e.g., 'Airtable', 'salesforce', etc.)."},"available_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Available Tools","description":"An array of tools that can be used to perform the action."},"version":{"anyOf":[{"type":"string","enum":["v1","v2"]},{"type":"null"}],"title":"Version","description":"The version of the Composio action to be performed.","default":"v1"}},"type":"object","required":["name","type"],"title":"ComposioActionTemplate"},"CreatePublicOutboundCallRequest":{"properties":{"recipient_e164":{"type":"string","title":"Recipient E164","description":"Recipient phone number in E.164 format, e.g. +34600111222."},"reason":{"type":"string","maxLength":2000,"title":"Reason","description":"Purpose of the call. Maximum 2,000 characters."},"dedup_key":{"type":"string","maxLength":200,"title":"Dedup Key","description":"Non-blank idempotency key scoped to the organization. Maximum 200 characters."},"case_data":{"additionalProperties":true,"type":"object","title":"Case Data","description":"Initial case context. Maximum 4,096 bytes of compact UTF-8 JSON (unescaped Unicode)."},"voicemail_context":{"anyOf":[{"$ref":"#/components/schemas/VoicemailContext"},{"type":"null"}],"description":"Explicitly public-safe purpose for a voicemail message; never overrides organization policy."},"language":{"anyOf":[{"type":"string","maxLength":35},{"type":"null"}],"title":"Language","description":"Optional initial language, e.g. es or es-ES. Maximum 35 characters."}},"additionalProperties":false,"type":"object","required":["recipient_e164","reason","dedup_key"],"title":"CreatePublicOutboundCallRequest","examples":[{"case_data":{"order_reference":"SUP-42"},"dedup_key":"delivery-SUP-42","language":"es","reason":"Confirm the delivery date for order SUP-42","recipient_e164":"+34600111222"}]},"CreatePublicOutboundCallResponse":{"properties":{"order_id":{"type":"string","title":"Order Id"},"status":{"type":"string","enum":["pending","calling","in_progress","completed","failed","cancelled","expired","blocked","unknown"],"title":"Status","description":"pending: waiting to be processed (not a queue-delivery guarantee); calling: connecting; in_progress: phone connection active, human answer not yet confirmed; completed: call ended; failed: unsuccessful; cancelled: cancelled before calling; expired: validity elapsed; blocked: another unfinished order prevents this call; unknown: call outcome cannot yet be confirmed, do not automatically place another call."}},"type":"object","required":["order_id","status"],"title":"CreatePublicOutboundCallResponse"},"ErrorResponse":{"properties":{"detail":{"type":"string","title":"Detail","description":"Human-readable error message.","example":"WhatsApp could not send the template (Meta error 100: The parameter to is required.)"},"error_code":{"type":"string","title":"Error Code","description":"Machine-readable error code (e.g. VALIDATION_ERROR, WHATSAPP_100, RATE_LIMIT_EXCEEDED).","example":"WHATSAPP_100"}},"type":"object","required":["detail","error_code"],"title":"ErrorResponse","description":"Standard error envelope returned on failures across the public API."},"FileSearchActionTemplate":{"properties":{"files":{"items":{"$ref":"#/components/schemas/FileSearchFile"},"type":"array","title":"Files","description":"A list of files to be searched."},"query":{"type":"string","title":"Query","description":"A string containing the operation logic for the operation, including placeholders like `{{{{table_name}}}}`, `{{{{email}}}}`, etc."}},"type":"object","required":["files","query"],"title":"FileSearchActionTemplate"},"FileSearchFile":{"properties":{"label":{"type":"string","title":"Label","description":"The name of the file."},"value":{"type":"string","title":"Value","description":"The value of the file."}},"type":"object","required":["label","value"],"title":"FileSearchFile"},"HTTPActionTemplate":{"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"],"title":"Method","description":"The method to be used in the HTTP request."},"url":{"type":"string","title":"Url","description":"The URL to be used in the HTTP request."},"headers":{"additionalProperties":true,"type":"object","title":"Headers","description":"The headers to be used in the HTTP request."},"body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"}],"title":"Body","description":"The body to be used in the HTTP request. Can be a dict (legacy) or a JSON string (preserves types)."},"query_params":{"additionalProperties":true,"type":"object","title":"Query Params","description":"The query parameters to be used in the HTTP request."}},"type":"object","required":["method","url","headers","body","query_params"],"title":"HTTPActionTemplate"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MCPConnectorActionTemplate":{"properties":{"connector_id":{"type":"string","title":"Connector Id","description":"Reference to the mcp_connectors document."},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query","description":"A string containing the operation logic, including placeholders like `{{{{table_name}}}}`, `{{{{email}}}}`, etc."},"available_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Available Tools","description":"Selected MCP tool names. None means all tools."},"version":{"anyOf":[{"type":"string","enum":["v1","v2"]},{"type":"null"}],"title":"Version","description":"Legacy connector action version; the model is configured globally.","default":"v1"}},"type":"object","required":["connector_id"],"title":"MCPConnectorActionTemplate"},"Message":{"properties":{"_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"fid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fid"},"body":{"type":"string","title":"Body"},"thread_format":{"anyOf":[{"$ref":"#/components/schemas/ThreadFormat"},{"type":"null"}],"default":"email"},"translated_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translated Body"},"chat_body":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Chat Body"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"translated_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translated Subject"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"organization_id":{"type":"string","title":"Organization Id"},"in_reply_to_message_fid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"In Reply To Message Fid"},"in_reply_to_user_fid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"In Reply To User Fid"},"to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"},"in_reply_to_user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"In Reply To User Name"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"is_customer_support_agent":{"type":"boolean","title":"Is Customer Support Agent","default":false},"read":{"type":"boolean","title":"Read","default":false},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature"},"signature_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature Id"},"is_auto_reply":{"type":"boolean","title":"Is Auto Reply","default":false},"similarity_to_draft":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity To Draft"},"replied_by_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replied By Agent Id"},"thread_fid":{"type":"string","title":"Thread Fid"},"thread":{"type":"string","title":"Thread"},"archived":{"type":"boolean","title":"Archived","default":false},"is_translated":{"type":"boolean","title":"Is Translated","default":false},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"user_fid":{"type":"string","title":"User Fid"},"datas":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Datas","default":[]},"customer_support_user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Support User"},"integration_code":{"type":"string","title":"Integration Code"},"automation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Automation Id"},"cc":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Cc"},"integration_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Integration Metadata","default":{}},"agent":{"anyOf":[{"$ref":"#/components/schemas/Agent"},{"type":"null"}]},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Attachment-Output"},"type":"array"},{"type":"null"}],"title":"Attachments"},"demo":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Demo","default":false},"eval":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eval"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"original_draft":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Draft"},"original_platform_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Platform Url"},"delivery_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Status"},"delivery_error_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delivery Error Code"},"delivery_error_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Error Title"},"delivery_error_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Error Detail"},"delivery_error_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Error Category"},"delivery_retriable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delivery Retriable"},"delivery_status_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivery Status Updated At"}},"type":"object","required":["fid","body","organization_id","thread_fid","thread","user_fid","integration_code"],"title":"Message"},"MessageResponse":{"properties":{"fid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fid","description":"Foreign identifier supplied by the integration"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"Message content/body text"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject","description":"Message subject (email-type threads)"},"translated_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translated Body","description":"Translated body, when the message was translated"},"translated_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translated Subject","description":"Translated subject, when applicable"},"chat_body":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Chat Body","description":"Body split into chat bubbles (chat-type threads)"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"Detected language code (e.g. 'es', 'en')"},"thread":{"type":"string","title":"Thread","description":"Thread hash identifier"},"thread_fid":{"type":"string","title":"Thread Fid","description":"Thread foreign identifier"},"thread_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Format","description":"Thread format ('email' or 'chat')"},"user_fid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Fid","description":"Sender identifier (email, phone, or user id)"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name","description":"Display name of the sender"},"to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To","description":"Recipient address (email or phone)"},"cc":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Cc","description":"CC recipients"},"integration_code":{"type":"string","title":"Integration Code","description":"Integration source code (e.g. 'API', 'WHATSAPP', 'GMAIL')"},"is_customer_support_agent":{"type":"boolean","title":"Is Customer Support Agent","description":"True if sent by a human support agent","default":false},"is_auto_reply":{"type":"boolean","title":"Is Auto Reply","description":"True if generated as an automatic reply","default":false},"read":{"type":"boolean","title":"Read","description":"Whether the message has been read","default":false},"archived":{"type":"boolean","title":"Archived","description":"Whether the message is archived","default":false},"is_translated":{"type":"boolean","title":"Is Translated","description":"Whether the message was translated","default":false},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","description":"Message timestamp"},"original_platform_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Platform Url","description":"Link to the message in the source platform"},"delivery_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Status","description":"Delivery status, when tracked by the channel"},"delivery_error_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delivery Error Code","description":"Channel error code for a failed delivery"},"delivery_error_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Error Category","description":"Customer-safe delivery error category"},"delivery_retriable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delivery Retriable","description":"Whether retrying the delivery may succeed"},"delivery_status_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivery Status Updated At","description":"When delivery status last changed"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/AttachmentResponse"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Message attachments (no raw data)"}},"additionalProperties":true,"type":"object","required":["thread","thread_fid","integration_code","timestamp"],"title":"MessageResponse","description":"Stable message fields; public v1 may return additional legacy properties.","examples":[{"archived":false,"body":"Gracias por tu compra. ¿En qué puedo ayudarte?","delivery_status":"sent","fid":"msg-12345","integration_code":"API","is_auto_reply":false,"is_customer_support_agent":false,"is_translated":false,"language":"es","read":false,"sender_name":"Jane Doe","subject":"Order #6789","thread":"3f8a1b2c4d5e6f70","thread_fid":"conversation-6789","thread_format":"email","timestamp":"2026-07-15T10:30:00Z","to":"support@yourcompany.com","user_fid":"customer@example.com"}]},"PartialMessage":{"properties":{"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"Message content/body text. For audio attachments, transcription will be appended automatically."},"fid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fid","description":"Unique foreign identifier for the message. Required field."},"user_fid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Fid","description":"Sender identifier (email address, phone number, or user ID)"},"thread_fid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Fid","description":"Thread foreign identifier. If not provided, defaults to message fid."},"thread":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread","description":"Thread hash identifier. Auto-generated from thread_fid if not provided."},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Organization ID. Auto-populated from authentication."},"integration_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Integration Code","description":"Integration source code (e.g., 'API', 'WHATSAPP', 'GMAIL'). Defaults to 'API'."},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At","description":"Original send timestamp (ISO 8601 format)"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"Message language code (e.g., 'en', 'es', 'fr')"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature","description":"Email signature to append to replies"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name","description":"Display name of the message sender"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject","description":"Message subject line (for email-type threads)"},"to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To","description":"Recipient address (email or phone number)"},"similarity_to_draft":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity To Draft","description":"Similarity score between sent message and AI draft (0.0-1.0)"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp"},"is_customer_support_agent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Customer Support Agent","description":"True if message is from a support agent (marks thread as archived)"},"datas":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Datas","description":"Additional structured data associated with the message","default":[]},"integration_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Integration Metadata","description":"Platform-specific metadata (merged with existing thread metadata)","default":{}},"translated_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translated Subject","description":"Translated subject line"},"translated_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translated Body","description":"Translated message body"},"chat_body":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Chat Body","description":"Message body split into chat bubbles (for chat-type threads)"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id","description":"ID of the AI agent that should process this message"},"replied_by_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replied By Agent Id","description":"ID of the AI agent that replied to this message"},"thread_format":{"anyOf":[{"$ref":"#/components/schemas/ThreadFormat"},{"type":"null"}],"description":"Thread format type: 'email' or 'chat'","default":"email"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Attachment-Input"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"List of file attachments. Each attachment can include url (fetched automatically) or base64 data."},"demo":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Demo","description":"Flag for demo/test messages","default":false},"eval":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eval","description":"Evaluation identifier for A/B testing"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"AI model used for processing this message"},"original_draft":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Draft","description":"Original AI-generated draft before human edits"},"original_platform_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Platform Url","description":"URL to the original message in the source platform"}},"type":"object","title":"PartialMessage","description":"Request model for creating a new message in a thread."},"PlaceholderActionTemplate":{"properties":{},"type":"object","title":"PlaceholderActionTemplate"},"PublicAttemptResult":{"properties":{"schema_version":{"type":"integer","title":"Schema Version"},"finalized_at":{"type":"string","format":"date-time","title":"Finalized At"},"outcome":{"anyOf":[{"$ref":"#/components/schemas/CallOutcome"},{"type":"null"}]},"answer_detection":{"anyOf":[{"$ref":"#/components/schemas/AnswerDetection"},{"type":"null"}]},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"voicemail":{"anyOf":[{"$ref":"#/components/schemas/VoicemailDelivery"},{"type":"null"}]},"voice_billing":{"type":"string","enum":["exempt","standard","unknown"],"title":"Voice Billing"}},"type":"object","required":["schema_version","finalized_at","outcome","answer_detection","duration_seconds","voicemail","voice_billing"],"title":"PublicAttemptResult"},"PublicOutboundCallResponse":{"properties":{"order_id":{"type":"string","title":"Order Id"},"status":{"type":"string","enum":["pending","calling","in_progress","completed","failed","cancelled","expired","blocked","unknown"],"title":"Status","description":"pending: waiting to be processed (not a queue-delivery guarantee); calling: connecting; in_progress: phone connection active, human answer not yet confirmed; completed: call ended; failed: unsuccessful; cancelled: cancelled before calling; expired: validity elapsed; blocked: another unfinished order prevents this call; unknown: call outcome cannot yet be confirmed, do not automatically place another call."},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id","description":"Public conversation identifier for GET /public/v1/threads/{thread_id}, or null when unavailable."},"answer_detection":{"anyOf":[{"$ref":"#/components/schemas/AnswerDetection"},{"type":"null"}]},"attempt_result":{"anyOf":[{"$ref":"#/components/schemas/PublicAttemptResult"},{"type":"null"}]},"processing_status":{"anyOf":[{"type":"string","enum":["pending","running","succeeded","failed","unknown","disabled","needs_review"]},{"type":"null"}],"title":"Processing Status"},"outcome":{"anyOf":[{"$ref":"#/components/schemas/CallOutcome"},{"type":"null"}],"description":"Final call outcome, or null while it is not confirmed."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds","description":"Latest attempt duration, when available."}},"type":"object","required":["order_id","status","thread_id","outcome","created_at","updated_at","answered_at","ended_at","duration_seconds"],"title":"PublicOutboundCallResponse"},"RichContentType":{"type":"string","enum":["product_card","image_gallery"],"title":"RichContentType"},"SQLActionTemplate":{"properties":{"connection_string":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection String","description":"A string containing the connection string to the database."},"query":{"type":"string","title":"Query","description":"A string containing the query to be performed in the database."}},"type":"object","required":["query"],"title":"SQLActionTemplate"},"SendProactiveEmailRequestPublic":{"properties":{"to_email":{"type":"string","title":"To Email","description":"Recipient email address"},"subject":{"type":"string","maxLength":500,"minLength":1,"title":"Subject","description":"Email subject"},"body":{"type":"string","minLength":1,"title":"Body","description":"Email body (HTML)"},"sender_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Email","description":"Configured sender; optional when only one identity exists"},"reply_to_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To Email","description":"Reply-to used to disambiguate identities sharing a sender"},"cc":{"anyOf":[{"items":{"type":"string","format":"email"},"type":"array","maxItems":25},{"type":"null"}],"title":"Cc","description":"CC recipients"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Attachment-Input"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Email attachments (with url or base64 data)"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id","description":"Template ID used (for tracking)"}},"type":"object","required":["to_email","subject","body"],"title":"SendProactiveEmailRequestPublic","description":"Request model for sending a proactive email via public API."},"SendProactiveEmailResponsePublic":{"properties":{"success":{"type":"boolean","title":"Success"},"thread_id":{"type":"string","title":"Thread Id"},"message_id":{"type":"string","title":"Message Id"}},"type":"object","required":["success","thread_id","message_id"],"title":"SendProactiveEmailResponsePublic","description":"Response model for proactive email via public API."},"SendTemplateRequestPublic":{"properties":{"phone_number_id":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"Phone Number Id","description":"Phone number ID from meta","example":"584207441453096"},"to":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"To","description":"Recipient phone number","example":"34622222222"},"template_name":{"type":"string","title":"Template Name","description":"Name of the approved template","example":"welcome"},"language_code":{"type":"string","title":"Language Code","description":"Meta BCP 47 language code (e.g. 'es', 'es_MX', 'en_US'). Must match exactly one of the languages returned by /public/v1/whatsapp/templates.","example":"es"},"components":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Components","description":"Template components (header, body, buttons)","example":[{"parameters":[{"text":"header","type":"text"}],"type":"header"},{"parameters":[{"text":"1","type":"text"},{"text":"well","type":"text"}],"type":"body"},{"index":"0","parameters":[{"text":"33232","type":"text"}],"sub_type":"url","type":"button"}]},"text":{"type":"string","minLength":1,"title":"Text","description":"Message body persisted as the conversation in GuruSup. Required and non-empty.","example":"Hello \nIm glad to get you on Gurusup\nThis is the 1 time you are on the platform\nI hope you are doing well with us\n<a href=\"https://gurusup.com/33232\" class=\"text-blue-500\" target=\"_blank\">Visit website</a>"},"integration_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Integration Metadata","description":"Integration metadata","default":{}},"origin":{"$ref":"#/components/schemas/TemplateSendOrigin","default":"intentional"}},"type":"object","required":["phone_number_id","to","template_name","language_code","text"],"title":"SendTemplateRequestPublic","description":"Request to send a WhatsApp template message"},"ShopifyActionTemplate":{"properties":{"integration_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Integration Id","description":"The ID of the Shopify integration to use for authentication."},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"],"title":"Method","description":"The HTTP method to use for the Shopify API request."},"url":{"type":"string","title":"Url","description":"The full Shopify API URL (e.g., https://mystore.myshopify.com/admin/api/2024-01/orders.json)."},"headers":{"additionalProperties":true,"type":"object","title":"Headers","description":"Additional headers to include in the request. X-Shopify-Access-Token is added automatically."},"body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"}],"title":"Body","description":"The request body. Can be a dict or a JSON string."},"query_params":{"additionalProperties":true,"type":"object","title":"Query Params","description":"Query parameters to include in the request."}},"type":"object","required":["method","url"],"title":"ShopifyActionTemplate"},"TemplateSendOrigin":{"type":"string","enum":["intentional","automated","proactive_followup"],"title":"TemplateSendOrigin"},"Thread":{"properties":{"_id":{"type":"string","title":"Id"},"thread_fid":{"type":"string","title":"Thread Fid"},"id":{"type":"string","title":"Id"},"thread":{"type":"string","title":"Thread"},"detected_languages":{"additionalProperties":{"type":"integer"},"type":"object","title":"Detected Languages","default":{}},"language":{"type":"string","title":"Language","default":"es"},"fixed_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fixed Language"},"organization_id":{"type":"string","title":"Organization Id"},"thread_format":{"anyOf":[{"$ref":"#/components/schemas/ThreadFormat"},{"type":"null"}],"default":"email"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"translated_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translated Subject"},"last_sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sender Name"},"last_sender_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sender Address"},"original_recipient":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Recipient"},"participants":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Participants"},"agent":{"anyOf":[{"$ref":"#/components/schemas/Agent"},{"type":"null"}]},"read":{"type":"boolean","title":"Read","default":false},"archived":{"type":"boolean","title":"Archived","default":false},"auto_block":{"type":"boolean","title":"Auto Block","default":false},"demo":{"type":"boolean","title":"Demo","default":false},"nps":{"type":"boolean","title":"Nps","default":false},"nps_sent":{"type":"boolean","title":"Nps Sent","default":false},"ai_disclosure_sent":{"type":"boolean","title":"Ai Disclosure Sent","default":false},"involved_agents":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Involved Agents"},"has_been_reply_by_support":{"type":"boolean","title":"Has Been Reply By Support","default":false},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"status":{"type":"string","enum":["needs_review","auto_answered","archived"],"title":"Status","default":"needs_review"},"scaled_to_human":{"type":"boolean","title":"Scaled To Human","default":false},"message_ids":{"items":{"type":"string"},"type":"array","title":"Message Ids"},"messages":{"items":{"$ref":"#/components/schemas/Message"},"type":"array","title":"Messages"},"last_message":{"$ref":"#/components/schemas/Message"},"agent_execution_review":{"anyOf":[{},{"type":"null"}],"title":"Agent Execution Review"},"last_message_timestamp":{"type":"string","format":"date-time","title":"Last Message Timestamp"},"is_translated":{"type":"boolean","title":"Is Translated","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"evaluated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Evaluated","default":false},"thread_context":{"items":{"$ref":"#/components/schemas/ThreadContextEntry"},"type":"array","title":"Thread Context"},"integration_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Integration Metadata"},"first_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Inbound At"},"first_outbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Outbound At"},"first_human_outbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Human Outbound At"},"inbound_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inbound Count"},"outbound_auto_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outbound Auto Count"},"outbound_human_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outbound Human Count"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At"},"archived_source":{"anyOf":[{"type":"string","enum":["inbox","reply","auto_reply","nps_survey","automation","assistant","agent_action","api","archived_message"]},{"type":"null"}],"title":"Archived Source"},"archived_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archived By"}},"type":"object","required":["_id","thread_fid","organization_id","last_message"],"title":"Thread"},"ThreadContextEntry":{"properties":{"content":{"type":"string","title":"Content"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["content"],"title":"ThreadContextEntry"},"ThreadDetailResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Thread hash identifier"},"thread":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread","description":"Thread hash identifier (alias of id)"},"thread_fid":{"type":"string","title":"Thread Fid","description":"Thread foreign identifier"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject","description":"Thread subject"},"translated_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translated Subject","description":"Translated subject, when applicable"},"status":{"type":"string","title":"Status","description":"Thread status (needs_review, auto_answered, archived)"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Integration source (WHATSAPP, GMAIL, API)"},"language":{"type":"string","title":"Language","description":"Detected language","default":"es"},"fixed_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fixed Language","description":"Language pinned for this thread, when set"},"thread_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Format","description":"Thread format ('email' or 'chat')"},"last_sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sender Name","description":"Name of the last sender"},"last_sender_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sender Address","description":"Email or phone of the last sender"},"original_recipient":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Recipient","description":"Original recipient address, when applicable"},"read":{"type":"boolean","title":"Read","description":"Whether the thread has been read","default":false},"archived":{"type":"boolean","title":"Archived","description":"Whether the thread is archived","default":false},"involved_agents":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Involved Agents","description":"Agents that participated in the thread"},"last_message_timestamp":{"type":"string","format":"date-time","title":"Last Message Timestamp","description":"Timestamp of the last message"},"is_translated":{"type":"boolean","title":"Is Translated","description":"Whether the thread was translated","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Thread creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Thread last update timestamp"},"messages":{"items":{"$ref":"#/components/schemas/MessageResponse"},"type":"array","title":"Messages","description":"Messages in the thread"},"last_message":{"anyOf":[{"$ref":"#/components/schemas/MessageResponse"},{"type":"null"}],"description":"The last message in the thread"}},"additionalProperties":true,"type":"object","required":["id","thread_fid","status","last_message_timestamp","created_at","updated_at"],"title":"ThreadDetailResponse","description":"Stable thread fields; public v1 may return additional legacy properties.","examples":[{"archived":false,"created_at":"2026-07-15T10:00:00Z","id":"3f8a1b2c4d5e6f70","involved_agents":["Support Bot"],"is_translated":false,"language":"es","last_message_timestamp":"2026-07-15T10:30:00Z","last_sender_address":"customer@example.com","last_sender_name":"Jane Doe","messages":[],"read":false,"source":"API","status":"needs_review","subject":"Order #6789","thread":"3f8a1b2c4d5e6f70","thread_fid":"conversation-6789","thread_format":"email","updated_at":"2026-07-15T10:30:00Z"}]},"ThreadFormat":{"enum":["email","chat"],"title":"ThreadFormat","type":"string"},"ThreadListItem":{"properties":{"id":{"type":"string","title":"Id","description":"Thread hash identifier"},"thread_fid":{"type":"string","title":"Thread Fid","description":"Thread foreign ID"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject","description":"Thread subject"},"status":{"type":"string","title":"Status","description":"Thread status (needs_review, auto_answered, archived)"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Integration source (WHATSAPP, GMAIL, API)"},"last_sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sender Name","description":"Name of the last sender"},"last_sender_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sender Address","description":"Email or phone of the last sender"},"last_message_timestamp":{"type":"string","format":"date-time","title":"Last Message Timestamp","description":"Timestamp of the last message"},"last_message_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message Body","description":"Preview of the last message (truncated)"},"read":{"type":"boolean","title":"Read","description":"Whether the thread has been read","default":false},"language":{"type":"string","title":"Language","description":"Detected language","default":"es"},"thread_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Format","description":"Thread format (email, whatsapp, etc)"},"involved_agents":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Involved Agents","description":"List of agents involved in the thread"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender","description":"Sender of the thread"}},"type":"object","required":["id","thread_fid","status","last_message_timestamp"],"title":"ThreadListItem","description":"DTO for thread list endpoint - lightweight response, messages optional"},"UIRenderConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Whether the UI agent should process this action's results into rich content.","default":false},"content_type":{"anyOf":[{"$ref":"#/components/schemas/RichContentType"},{"type":"null"}],"description":"The type of rich content to generate (e.g., product_card, image_gallery)."},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Per-action instructions for the UI agent on how to map tool results to rich content."}},"type":"object","title":"UIRenderConfig"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VoicemailContext":{"properties":{"purpose":{"type":"string","maxLength":300,"minLength":1,"title":"Purpose"}},"additionalProperties":false,"type":"object","required":["purpose"],"title":"VoicemailContext"},"VoicemailDelivery":{"properties":{"action":{"type":"string","enum":["hangup","leave_message"],"title":"Action","default":"hangup"},"status":{"type":"string","enum":["not_attempted","played","interrupted","failed","unknown"],"title":"Status","default":"not_attempted"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"generated_text":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Generated Text"},"played_text":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Played Text"},"disclosure":{"type":"string","enum":["not_required","included","unconfirmed"],"title":"Disclosure","default":"not_required"}},"type":"object","title":"VoicemailDelivery"},"WebhookTestRequest":{"properties":{"to":{"type":"string","title":"To"},"thread_id":{"type":"string","title":"Thread Id"},"message":{"type":"string","title":"Message"},"subject":{"type":"string","title":"Subject"}},"type":"object","required":["to","thread_id","message","subject"],"title":"WebhookTestRequest"},"WhatsappTemplateActionTemplate":{"properties":{"template_names":{"items":{"type":"string"},"type":"array","title":"Template Names","description":"Whitelist of APPROVED WhatsApp template names this tool is allowed to use."},"phone_number_id":{"type":"string","title":"Phone Number Id","description":"Meta phone_number_id bound to this action. The executor injects it into every MCP tool call so the sub-agent cannot send templates from a different number."},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query","description":"Guidance for the sub-agent on when and how to pick among the whitelisted templates."},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Pydantic-AI model string (e.g. 'openai:gpt-5.2', 'anthropic:claude-sonnet-4-6', 'google:gemini-2.0-flash'). None falls back to executor default."}},"type":"object","required":["template_names","phone_number_id"],"title":"WhatsappTemplateActionTemplate"},"WhatsappTemplateListResponse":{"properties":{"templates":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Templates"},"total":{"type":"integer","title":"Total"},"phone_number_id":{"type":"string","title":"Phone Number Id"},"waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Id"}},"type":"object","required":["templates","total","phone_number_id","waba_id"],"title":"WhatsappTemplateListResponse","description":"Response for listing WhatsApp message templates scoped to a phone number."},"Attachment":{"description":"Attachment model for message file attachments.","properties":{"filename":{"description":"Name of the file including extension (e.g., 'document.pdf')","title":"Filename","type":"string"},"file_type":{"description":"MIME type of the file (e.g., 'application/pdf', 'image/jpeg', 'audio/mpeg')","title":"File Type","type":"string"},"url":{"default":"","description":"URL to fetch the attachment from. If provided, data will be fetched automatically.","title":"Url","type":"string"},"data":{"anyOf":[{"type":"string"},{"format":"binary","type":"string"},{"type":"null"}],"default":null,"description":"File content as base64 string or raw bytes. If url is provided, this is populated automatically.","title":"Data"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Size in bytes. None for attachments stored before this field existed.","title":"Size"},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"PDF page count measured at ingest. None for non-PDF or historical attachments.","title":"Page Count"},"processing_skip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Why this attachment remains stored but must not be processed by an agent.","title":"Processing Skip Reason"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Text read from the attachment at ingest, so later turns keep its context. None when it was not generated or generation failed.","title":"Description"},"placement":{"$ref":"#/components/schemas/AttachmentPlacement","default":"unknown"},"region":{"$ref":"#/components/schemas/AttachmentRegion","default":"unknown"},"role":{"$ref":"#/components/schemas/AttachmentRole","default":"unknown"},"message_scope":{"$ref":"#/components/schemas/AttachmentMessageScope","default":"unknown"},"section":{"$ref":"#/components/schemas/AttachmentSection","default":"unknown"},"quote_depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Quote Depth"},"body_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Body Reference"},"provider_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Provider Reference"},"sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Sha256"},"pixel_size":{"anyOf":[{"maxItems":2,"minItems":2,"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array"},{"type":"null"}],"default":null,"title":"Pixel Size"},"layout_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Layout Fingerprint"},"classification_reasons":{"items":{"type":"string"},"title":"Classification Reasons","type":"array"},"model_processing":{"anyOf":[{"$ref":"#/components/schemas/AttachmentModelProcessing"},{"type":"null"}],"default":null},"decoration_triage":{"anyOf":[{"$ref":"#/components/schemas/AttachmentDecorationTriage"},{"type":"null"}],"default":null}},"required":["filename","file_type"],"title":"Attachment","type":"object"},"CreateMessageRequest":{"additionalProperties":true,"description":"Request body for POST /public/v1/messages.\n\nThese are the stable documented fields. Public v1 continues accepting\nadditional legacy properties for backward compatibility.","examples":[{"body":"Hola, necesito ayuda con mi pedido.","fid":"msg-12345","integration_code":"API","language":"es","sender_name":"Jane Doe","subject":"Order status","thread_fid":"conversation-6789","thread_format":"email","to":"support@yourcompany.com","user_fid":"customer@example.com"}],"properties":{"fid":{"description":"Unique foreign identifier for the message","title":"Fid","type":"string"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Message content/body text. For audio attachments, transcription is appended automatically.","title":"Body"},"integration_code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Integration source code (e.g. 'API', 'WHATSAPP', 'GMAIL'). Defaults to 'API'.","title":"Integration Code"},"thread_fid":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Thread foreign identifier. Defaults to the message fid when omitted.","title":"Thread Fid"},"user_fid":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Sender identifier (email address, phone number, or user id)","title":"User Fid"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Display name of the message sender","title":"Sender Name"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Message subject line (email-type threads)","title":"Subject"},"to":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Recipient address (email or phone number)","title":"To"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Message language code (e.g. 'en', 'es', 'fr')","title":"Language"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Signature to append to replies","title":"Signature"},"thread_format":{"anyOf":[{"$ref":"#/components/schemas/ThreadFormat"},{"type":"null"}],"default":"email","description":"Thread format type: 'email' or 'chat'"},"chat_body":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"description":"Body split into chat bubbles (chat-type threads)","title":"Chat Body"},"translated_body":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Pre-translated body, when available","title":"Translated Body"},"translated_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Pre-translated subject, when available","title":"Translated Subject"},"is_customer_support_agent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True if the message is from a support agent (archives the thread)","title":"Is Customer Support Agent"},"integration_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Platform-specific metadata (merged with existing thread metadata)","title":"Integration Metadata"},"original_platform_url":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Link to the message in the source platform","title":"Original Platform Url"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array"},{"type":"null"}],"default":null,"description":"File attachments. Each may include a url (fetched automatically) or base64 data.","title":"Attachments"}},"required":["fid"],"title":"CreateMessageRequest","type":"object"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","name":"x-api-key","in":"header"}}},"tags":[{"name":"WhatsApp","description":"Send WhatsApp template messages and list approved templates (Meta Cloud API)."},{"name":"public","description":"Public GuruSup API — threads, agents, messages and attachments."},{"name":"outbound-calls","description":"Create and inspect authenticated outbound voice call orders."}],"security":[{"APIKeyHeader":[]}],"servers":[{"url":"https://api.gurusup.com","description":"GuruSup API base URL"}]}