-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.json
1 lines (1 loc) · 41.9 KB
/
spec.json
1
{"openapi":"3.0.0","paths":{"/actions":{"delete":{"operationId":"deleteAllActions","summary":"Delete all actions","description":"Delete all actions. This operation is safe only when you can re-import all the actions from an OpenAPI spec. Any actions created manually from the dashboard will be deleted.","parameters":[],"responses":{"200":{"description":""},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Actions"],"security":[{"bearer":[]}]},"put":{"operationId":"importActionsFromOpenAapiSpec","summary":"Import from OpenAPI file","description":" \nUpload your OpenAPI (previously known as Swagger) specification.\nVersions 2, 3, and 3.1 are supported. Both YAML and JSON formats are supported.\n","parameters":[],"requestBody":{"required":true,"description":"The OpenAPI (Swagger) file to import actions from.","content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/FileUploadDto"}}}},"responses":{"200":{"description":""},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Actions"],"security":[{"bearer":[]}]}},"/contacts":{"post":{"operationId":"saveContact","summary":"Create a contact","description":"Create a new contact","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveContactInput"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavecontactOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Contacts"],"security":[{"bearer":[]}]},"get":{"operationId":"listContacts","summary":"List contacts","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor to fetch the next set of results","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListContactsOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Contacts"],"security":[{"bearer":[]}]}},"/contacts/{contact_id}":{"delete":{"operationId":"deleteContact","summary":"Delete a contact","parameters":[{"name":"contact_id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Contacts"],"security":[{"bearer":[]}]},"patch":{"operationId":"updateContact","summary":"Update a contact","parameters":[{"name":"contact_id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactInput"}}}},"responses":{"200":{"description":""},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Contacts"],"security":[{"bearer":[]}]}},"/email":{"post":{"operationId":"sendEmail","summary":"Send emails","description":"\nSend emails to multiple contacts, possibly with a time delay.\n\nTo send emails using the API, you must first verify the domain you want to\nsend emails from. You can add and verify custom domains in the settings.\n","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailInput"}}}},"responses":{"201":{"description":""},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Email"],"security":[{"bearer":[]}]}},"/phone":{"post":{"operationId":"createPhoneAgent","summary":"Create an AI phone agent","description":"\n Create an AI phone agent. This phone number can be used to receive and make phone calls. For now, this API only supports US phone numbers. Email [email protected] for other countries.\n ","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePhoneAgentDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneAgentDto"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Phone"],"security":[{"bearer":[]}]},"get":{"operationId":"listPhoneNumbers","summary":"List AI phone agents","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor to fetch the next set of results","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPhoneNumbersOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Phone"],"security":[{"bearer":[]}]}},"/phone/{phone_agent_id}":{"patch":{"operationId":"updatePhoneAgent","summary":"Update an AI phone agent","parameters":[{"name":"phone_agent_id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePhoneAgentDto"}}}},"responses":{"200":{"description":""},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Phone"],"security":[{"bearer":[]}]},"delete":{"operationId":"deletePhoneNumber","summary":"Delete an AI phone agent","parameters":[{"name":"phone_agent_id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Phone"],"security":[{"bearer":[]}]}},"/chat/sessions":{"post":{"operationId":"createChatSession","summary":"Create a chat session","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatSessionInput"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatSessionOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Chat Sessions"],"security":[{"bearer":[]}]},"get":{"operationId":"listChatSessions","summary":"List chat sessions","parameters":[{"name":"handed_off","required":false,"in":"query","schema":{"type":"boolean"}},{"name":"channel_type","required":false,"in":"query","schema":{"enum":["web","email","phone_voice","slack","sms","whatsapp","api","web_voice"],"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"enum":["open","closed_resolved","closed_unresolved"],"type":"string"}},{"name":"cursor","required":false,"in":"query","description":"Pagination cursor to fetch the next set of results","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChatSessionsOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Chat Sessions"],"security":[{"bearer":[]}]}},"/chat/sessions/{session_id}":{"get":{"operationId":"getChatSession","summary":"Get a chat session","parameters":[{"name":"session_id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetChatSessionOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Chat Sessions"],"security":[{"bearer":[]}]},"patch":{"operationId":"updateChatSession","summary":"Update a chat session","parameters":[{"name":"session_id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChatSessionInput"}}}},"responses":{"200":{"description":""},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Chat Sessions"],"security":[{"bearer":[]}]}},"/chat/sessions/{session_id}/send":{"post":{"operationId":"sendMessage","summary":"Send a message","parameters":[{"name":"session_id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageInput"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Chat Sessions"],"security":[{"bearer":[]}]}},"/chat/sessions/{session_id}/history":{"get":{"operationId":"listChatHistory","summary":"List chat session history","parameters":[{"name":"session_id","required":true,"in":"path","schema":{"type":"string"}},{"name":"cursor","required":false,"in":"query","description":"Pagination cursor to fetch the next set of results","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChatHistoryOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Chat Sessions"],"security":[{"bearer":[]}]}},"/sequences":{"post":{"operationId":"createSequence","summary":"Create a sequence","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSequenceInput"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSequenceOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Sequences"],"security":[{"bearer":[]}]}},"/sequences/{sequence_id}":{"get":{"operationId":"getSequence","summary":"Get a sequence","parameters":[{"name":"sequence_id","required":true,"in":"path","description":"ID or _custom ID_ for the sequence","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSequenceOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Sequences"],"security":[{"bearer":[]}]},"patch":{"operationId":"updateSequence","summary":"Update a sequence","parameters":[{"name":"sequence_id","required":true,"in":"path","description":"ID or _custom ID_ for the sequence","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSequenceInput"}}}},"responses":{"200":{"description":""},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Sequences"],"security":[{"bearer":[]}]}},"/sequences/{sequence_id}/start":{"put":{"operationId":"startSequence","summary":"Start a sequence","parameters":[{"name":"sequence_id","required":true,"in":"path","description":"ID or _custom ID_ for the sequence","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartOneOffSequenceOutputDto"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Sequences"],"security":[{"bearer":[]}]}},"/sequences/{sequence_id}/cancel":{"put":{"operationId":"cancelSequence","summary":"Cancel a sequence","parameters":[{"name":"sequence_id","required":true,"in":"path","description":"The sequence `id`. This can also be a run `id`.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericResponseDto"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Sequences"],"security":[{"bearer":[]}]}},"/sequences/{sequence_id}/contacts":{"post":{"operationId":"addContactsToSequence","summary":"Add contacts to a continuous sequence","description":"\nAdd contacts to a continuous sequence (`is_continuous` property of the sequence must be `true`).\nContacts will *not* be added to the sequence if the sequence's `filter` does not apply to the contact.\n\nAny contacts added will automatically be added to contacts if they don't already exist.\n","parameters":[{"name":"sequence_id","required":true,"in":"path","description":"ID or _custom ID_ for the sequence.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddContactsToSequenceInput"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddContactsToSequenceOutput"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["Sequences"],"security":[{"bearer":[]}]}},"/widget/authenticate-user":{"post":{"operationId":"authenticateWidgetUser","summary":"","description":"authenticate the contacts","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateUserPayloadDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetContactTokenResponseDto"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"tags":["widget"],"security":[{"bearer":[]}]}}},"info":{"title":"OpenCX API","description":"\nOpenCX is an AI-powered, all-in-one platform for customer support and outbound communications.\n\nUse this API to manage your OpenCX organization's AI agents, actions, conversations, contacts, and more.\n\nTo get started, generate a new API key from the dashboard.\n","version":"1.0-beta","contact":{"name":"Mo (Founder and CEO)","url":"https://x.com/ikbenbasha","email":"[email protected]"}},"tags":[],"servers":[{"url":"https://api.open.cx","description":"OpenCX API"}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"AddContactsToSequenceInput":{"type":"object","properties":{"contacts":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"],"title":"ID"},{"type":"object","properties":{"email":{"type":"string","format":"email"}},"required":["email"],"title":"Email"},{"type":"object","properties":{"phone_number":{"type":"string"}},"required":["phone_number"],"title":"Phone"}]}}},"required":["contacts"]},"AddContactsToSequenceOutput":{"type":"object","properties":{"run_id":{"type":"string","format":"uuid"}},"required":["run_id"]},"AuthenticateUserPayloadDto":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"The email of the user to authenticate","example":"[email protected]"},"name":{"type":"string","description":"The name of the user to authenticate","example":"John Doe"},"avatar_url":{"type":"string","nullable":true,"description":"The URL of the user's avatar","example":"https://example.com/avatar.png"},"phone":{"type":"string","description":"contact's phone number including the conutry code","example":"+1234567890"},"customData":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Custom data","example":{"customKey":"customValue"}}},"required":["email"]},"ChatMessageSender":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["contact"]}},"required":["type"],"title":"Contact"},{"type":"object","properties":{"type":{"type":"string","enum":["ai"]}},"required":["type"],"title":"AI"},{"type":"object","properties":{"type":{"type":"string","enum":["human_agent"]}},"required":["type"],"title":"HumanAgent"}]},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","nullable":true,"format":"email"},"phone_number":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"custom_data":{"type":"object","nullable":true,"additionalProperties":{"type":"string"}}},"required":["id","email","phone_number","name","custom_data"]},"ContactInput":{"type":"object","properties":{"email":{"type":"string","format":"email"},"phone":{"type":"string"},"name":{"type":"string"},"custom_data":{"type":"object","additionalProperties":{"type":"string"}}}},"ContactsAffectedBySequenceFilter":{"type":"object","properties":{"type":{"type":"string","enum":["contacts_affected_by_sequence"]},"sequence_id":{"type":"string"}},"required":["type","sequence_id"]},"ContactsCreatedAtFilter":{"type":"object","properties":{"type":{"type":"string","enum":["contacts_created_at_between"]},"after":{"type":"string","nullable":true,"description":"ISO 8601 date-time string","format":"date-time","title":"DateTime"},"before":{"type":"string","nullable":true,"description":"ISO 8601 date-time string","format":"date-time","title":"DateTime"}},"required":["type"]},"ContactsEmailDomainNameFilter":{"type":"object","properties":{"type":{"type":"string","enum":["contacts_email_domain_name_in"]},"domain_name_in":{"type":"array","items":{"type":"string"}}},"required":["type","domain_name_in"]},"ContactsFilter":{"anyOf":[{"$ref":"#/components/schemas/ContactsIdsFilter"},{"$ref":"#/components/schemas/ContactsCreatedAtFilter"},{"$ref":"#/components/schemas/ContactsEmailDomainNameFilter"},{"$ref":"#/components/schemas/ContactsAffectedBySequenceFilter"}]},"ContactsIdsFilter":{"type":"object","properties":{"type":{"type":"string","enum":["contact_id_in"]},"contact_ids":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["type","contact_ids"]},"CreateChatSessionInput":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid"},"channel":{"type":"object","default":{"type":"api"},"properties":{"type":{"type":"string","enum":["web","email","phone_voice","slack","sms","whatsapp","api","web_voice"],"title":"ChatSessionChannelType"}},"required":["type"]}},"example":{}},"CreateChatSessionOutput":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"ID of the created session."}},"required":["id"]},"CreatePhoneAgentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the AI phone agent"},"type":{"type":"string","enum":["inbound","outbound"],"default":"inbound"},"language":{"type":"string","nullable":true,"description":"The language the AI phone agent should mainly speak in"},"accent":{"type":"string","nullable":true,"description":"The accent the AI phone agent should mainly speak in"},"handoff_phone_number":{"type":"string","nullable":true,"description":"The phone number of the human agent to hand off the call to"},"interruptible":{"type":"boolean","default":true,"description":"Whether the agent can be interrupted or not"},"actionIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"A list of action ids the AI phone agent has access to. A `null` value means all actions. An empty list means no actions"},"instructions":{"type":"array","nullable":true,"items":{"type":"string"},"description":"A list of instructions"},"data_collection_fields":{"type":"array","nullable":true,"items":{"type":"string"},"description":"A list of fields to collect data about"},"data_collection_webhook_url":{"type":"string","nullable":true,"description":"The webhook url to send the collected data to"},"model":{"type":"string","enum":["oppie-vox","oppie-vox-turbo","oppie-vox-2"],"default":"oppie-vox","description":"The AI model of the agent. This cannot be changed after creation"},"first_message":{"type":"string","nullable":true,"description":"The first message the AI phone agent should say"},"voice_id":{"type":"string","nullable":true,"description":"The voice id"},"flow":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["root","condition","action"]},"content":{"type":"string"},"children":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["root","condition","action"]},"content":{"type":"string"},"children":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["root","condition","action"]},"content":{"type":"string"},"children":{"type":"array","items":{"nullable":true}}},"required":["type","content","children"]}}},"required":["type","content","children"]}}},"required":["type","content","children"]},"use_org_knowledgebase":{"type":"boolean","nullable":true,"description":"Whether the AI phone agent should use the organization's knowledgebase"}},"required":["name","flow"]},"CreateSequenceInput":{"type":"object","properties":{"name":{"type":"string","default":"New Sequence"},"custom_id":{"type":"string"},"is_continuous":{"type":"boolean","default":true},"filter":{"type":"object","nullable":true,"properties":{"or":{"type":"array","items":{"type":"object","properties":{"and":{"type":"array","items":{"$ref":"#/components/schemas/ContactsFilter"}}},"required":["and"]},"minItems":1}},"required":["or"],"description":"A combination of contact filters. All filters within `and` arrays must apply to a contact in order for the contact to be included. On the other hand, only one of the filters within the `or` array must apply for the contact to be included. If no filter is provided, all contacts will be included.","title":"ContactsCompositeFilter"},"steps":{"type":"array","items":{"type":"object","properties":{"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["send_emails"]},"data":{"type":"object","properties":{"from_email":{"type":"string"},"email_subject":{"type":"string"},"email_body":{"type":"string"},"email_sender_name":{"type":"string"},"email_is_transactional":{"type":"boolean"}},"required":["from_email","email_subject","email_body","email_sender_name","email_is_transactional"]}},"required":["type","data"]},{"type":"object","properties":{"type":{"type":"string","enum":["make_phone_calls"]},"data":{"type":"object","properties":{"aiPhoneAgentId":{"type":"string"}},"required":["aiPhoneAgentId"]}},"required":["type","data"]},{"type":"object","properties":{"type":{"type":"string","enum":["send_sms_messages"]},"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["type","data"]}]},"delay_in_minutes":{"type":"number","minimum":0}},"required":["action"],"title":"SequenceStepInput"},"minItems":1}},"required":["filter","steps"],"example":{"steps":[{"action":{"type":"send_emails","data":{"from_email":"[email protected]","email_body":"Hello!","email_sender_name":"OpenCX Team","email_subject":"Welcome to OpenCX!","email_is_transactional":false}},"delay_in_minutes":2}],"filter":{"or":[{"and":[{"type":"contacts_created_at_between","before":"2025-02-05T09:47:27.411Z","after":"2025-02-05T09:47:27.411Z"}]}]}}},"CreateSequenceOutput":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]},"EmailRecipient":{"type":"object","properties":{"to_email":{"type":"string","format":"email"},"email_body":{"type":"string","description":"Body of the email in HTML format."},"email_subject":{"type":"string"},"email_sender_name":{"type":"string"},"email_is_transactional":{"type":"boolean","description":"\nWhether the email is transactional. If set to `false`, Open will check if the\ncontact has [unsubscribed/opted out](./unsubscribe_api) of receiving marketing\nemails before sending the email. Defaults to `true`."}},"required":["to_email"]},"FileUploadDto":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]},"GenericResponseDto":{"type":"object","properties":{"data":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"error":{"type":"object","properties":{"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"}},"required":["code","status","message"]}}},"GetChatSessionOutput":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["open","closed_resolved","closed_unresolved"]},"channel":{"type":"object","properties":{"type":{"type":"string","enum":["web","email","phone_voice","slack","sms","whatsapp","api","web_voice"],"title":"ChatSessionChannelType"}},"required":["type"]},"contact":{"$ref":"#/components/schemas/Contact"},"language":{"type":"string"},"assignee_id":{"type":"string"},"handoff":{"type":"object","properties":{"sentiment":{"type":"string","enum":["angry","neutral","happy"],"title":"HandoffSentiment"},"summary":{"type":"string"}},"required":["summary"],"description":"Present if the conversation was handed off to a human."},"created_at":{"type":"string","nullable":true,"description":"ISO 8601 date-time string","format":"date-time","title":"DateTime"},"updated_at":{"type":"string","nullable":true,"description":"ISO 8601 date-time string","format":"date-time","title":"DateTime"}},"required":["id","status","channel","created_at","updated_at"],"title":"ChatSession"},"GetSequenceOutput":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"org_id":{"type":"string"},"custom_id":{"type":"string","nullable":true,"maxLength":50},"filter":{"type":"object","nullable":true,"properties":{"or":{"type":"array","items":{"type":"object","properties":{"and":{"type":"array","items":{"$ref":"#/components/schemas/ContactsFilter"}}},"required":["and"]},"minItems":1}},"required":["or"],"description":"A combination of contact filters. All filters within `and` arrays must apply to a contact in order for the contact to be included. On the other hand, only one of the filters within the `or` array must apply for the contact to be included. If no filter is provided, all contacts will be included.","title":"ContactsCompositeFilter"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/SequenceStep"}},"is_continuous":{"type":"boolean"},"started_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"ended_at":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/SequenceStatus"}},"required":["id","name","org_id","custom_id","filter","steps","is_continuous","started_at","canceled_at","ended_at","status"]},"ListChatHistoryOutput":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"created_at":{"type":"string","nullable":true,"description":"ISO 8601 date-time string","format":"date-time","title":"DateTime"},"event":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"sender":{"$ref":"#/components/schemas/ChatMessageSender"},"content":{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"}},"required":["type","text"]}},"required":["type","sender","content"],"title":"Message"},{"type":"object","properties":{"type":{"type":"string","enum":["handoff"]},"integration":{"type":"object","properties":{"type":{"type":"string","enum":["zendesk"]}},"required":["type"]}},"required":["type"],"title":"Handoff"},{"type":"object","properties":{"type":{"type":"string","enum":["ai_resolved_issue"]}},"required":["type"],"title":"IssueResolvedByAI"},{"type":"object","properties":{"type":{"type":"string","enum":["human_agent_comment"]},"human_agent_id":{"type":"number"},"content":{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"}},"required":["type","text"]}},"required":["type","human_agent_id","content"],"title":"HumanAgentComment"},{"type":"object","properties":{"type":{"type":"string","enum":["human_agent_joined"]},"human_agent_id":{"type":"number"}},"required":["type","human_agent_id"],"title":"HumanAgentJoined"},{"type":"object","properties":{"type":{"type":"string","enum":["human_agent_takeover"]},"human_agent_id":{"type":"number"}},"required":["type","human_agent_id"],"title":"HumanAgentTakeover"}]}},"required":["created_at","event"]}},"next":{"type":"string","nullable":true,"description":"The `cursor` for the request to get the next set of items. Null if there is no more data."}},"required":["items","next"],"description":"Paginated response."},"ListChatSessionsOutput":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["open","closed_resolved","closed_unresolved"]},"channel":{"type":"object","properties":{"type":{"type":"string","enum":["web","email","phone_voice","slack","sms","whatsapp","api","web_voice"],"title":"ChatSessionChannelType"}},"required":["type"]},"contact":{"$ref":"#/components/schemas/Contact"},"language":{"type":"string"},"assignee_id":{"type":"string"},"handoff":{"type":"object","properties":{"sentiment":{"type":"string","enum":["angry","neutral","happy"],"title":"HandoffSentiment"},"summary":{"type":"string"}},"required":["summary"],"description":"Present if the conversation was handed off to a human."},"created_at":{"type":"string","nullable":true,"description":"ISO 8601 date-time string","format":"date-time","title":"DateTime"},"updated_at":{"type":"string","nullable":true,"description":"ISO 8601 date-time string","format":"date-time","title":"DateTime"}},"required":["id","status","channel","created_at","updated_at"],"title":"ChatSession"}},"next":{"type":"string","nullable":true,"description":"The `cursor` for the request to get the next set of items. Null if there is no more data."}},"required":["items","next"],"description":"Paginated response."},"ListContactsOutput":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"next":{"type":"string","nullable":true,"description":"The `cursor` for the request to get the next set of items. Null if there is no more data."}},"required":["items","next"],"description":"Paginated response."},"ListPhoneNumbersOutput":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"phone_number":{"type":"string","nullable":true}},"required":["id","name","phone_number"]}},"next":{"type":"string","nullable":true,"description":"The `cursor` for the request to get the next set of items. Null if there is no more data."}},"required":["items","next"],"description":"Paginated response."},"PhoneAgentDto":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"phone_number":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"type":{"type":"string","enum":["inbound","outbound"]},"language":{"type":"string","nullable":true},"accent":{"type":"string","nullable":true},"handoff_phone_number":{"type":"string","nullable":true},"interruptible":{"type":"boolean"},"actionIds":{"type":"array","nullable":true,"items":{"type":"string"}},"instructions":{"type":"array","nullable":true,"items":{"type":"string"}},"data_collection_fields":{"type":"array","nullable":true,"items":{"type":"string"}},"data_collection_webhook_url":{"type":"string","nullable":true},"model":{"type":"string","enum":["oppie-vox","oppie-vox-turbo","oppie-vox-2"]},"voice_id":{"type":"string","nullable":true},"first_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"provider_external_id":{"type":"string","nullable":true},"flow":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["root","condition","action"]},"content":{"type":"string"},"children":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["root","condition","action"]},"content":{"type":"string"},"children":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["root","condition","action"]},"content":{"type":"string"},"children":{"type":"array","items":{"nullable":true}}},"required":["type","content","children"]}}},"required":["type","content","children"]}}},"required":["type","content","children"]},"use_org_knowledgebase":{"type":"boolean"}},"required":["id","org_id","phone_number","name","type","language","accent","handoff_phone_number","interruptible","actionIds","instructions","data_collection_fields","data_collection_webhook_url","model","voice_id","first_message","created_at","updated_at","provider_external_id","flow","use_org_knowledgebase"]},"SaveContactInput":{"type":"object","properties":{"contact":{"$ref":"#/components/schemas/ContactInput"}},"required":["contact"]},"SavecontactOutput":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The ID of the created contact."}}},"SendEmailInput":{"type":"object","properties":{"from_email":{"type":"string","format":"email","description":"The email to send from. This email's domain name must be added and verified. Otherwise, the request will fail with a 400 status code."},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/EmailRecipient"},"description":"\nArray of contacts to receive emails. The only required field is `to_email`, with the rest of the fields having fallback values that can be specified on the top level.\n\nIt's possible to repeat the same contact email in the array with different `delay_in_minutes` values to create a sequence of scheduled emails for that contact (e.g. for onboarding)."},"delay_in_minutes":{"type":"number","minimum":0,"exclusiveMinimum":true,"description":"How much time (in minutes) to wait before sending the emails."},"fallback_email_subject":{"type":"string"},"fallback_email_sender_name":{"type":"string"},"fallback_email_body":{"type":"string","description":"Fallback body of the email in HTML format."}},"required":["from_email","recipients"]},"SendMessageInput":{"type":"object","properties":{"sender":{"type":"string","enum":["contact"]},"contact":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone_number":{"type":"string"},"avatar_url":{"type":"string"},"custom_data":{"type":"object","additionalProperties":{"type":"string"}}},"description":"Updated contact info"},"message":{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"size":{"type":"number"},"type":{"type":"string"},"url":{"type":"string"}},"required":["id","name","size","type","url"]}}},"required":["type","text"]}},"required":["sender","message"],"example":{"sender":"contact","message":{"type":"text","text":"Hello!"}}},"SendMessageOutput":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"code":{"anyOf":[{"type":"string"},{"type":"string","enum":["session_assigned_to_human_agent"]}]},"autopilotResponse":{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"value":{"type":"object","properties":{"error":{"type":"boolean"},"content":{"type":"string"}},"required":["error","content"]},"id":{"type":"string"},"mightSolveUserIssue":{"type":"boolean"}},"required":["type","value","mightSolveUserIssue"]},"uiResponse":{"type":"object","properties":{"type":{"type":"string","enum":["ui"]},"value":{"type":"object","properties":{"type":{"type":"string","enum":["ui_component"]},"request_response":{"nullable":true},"name":{"type":"string"},"content":{"type":"string"}},"required":["type","name"]},"mightSolveUserIssue":{"type":"boolean"}},"required":["type","value","mightSolveUserIssue"]},"sessionIsHandedOff":{"type":"boolean"}},"required":["success"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}},"required":["success","error"]}]},"SequenceStatus":{"type":"string","nullable":true,"enum":["pending","complete","canceled","active"]},"SequenceStep":{"type":"object","properties":{"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["send_emails"]},"data":{"type":"object","properties":{"from_email":{"type":"string"},"email_subject":{"type":"string"},"email_body":{"type":"string"},"email_sender_name":{"type":"string"},"email_is_transactional":{"type":"boolean"}},"required":["from_email","email_subject","email_body","email_sender_name","email_is_transactional"]}},"required":["type","data"]},{"type":"object","properties":{"type":{"type":"string","enum":["make_phone_calls"]},"data":{"type":"object","properties":{"aiPhoneAgentId":{"type":"string"}},"required":["aiPhoneAgentId"]}},"required":["type","data"]},{"type":"object","properties":{"type":{"type":"string","enum":["send_sms_messages"]},"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["type","data"]}]},"delay_in_minutes":{"type":"number","minimum":0},"started_at":{"type":"string"},"ended_at":{"type":"string"}},"required":["action"]},"StartOneOffSequenceOutputDto":{"type":"object","properties":{"data":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"error":{"type":"object","properties":{"code":{"type":"string","enum":["sequence_not_found","one_off_sequence_is_canceled","sequence_already_started"]},"status":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[404]}]},"message":{"type":"string"}},"required":["code","status","message"]}}},"UpdateChatSessionInput":{"type":"object","properties":{"status":{"type":"string","enum":["open","closed_resolved","closed_unresolved"]}}},"UpdateContactInput":{"type":"object","properties":{"contact":{"$ref":"#/components/schemas/ContactInput"}},"required":["contact"]},"UpdatePhoneAgentDto":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["inbound","outbound"]},"language":{"type":"string","nullable":true,"description":"The language the AI phone agent should mainly speak in"},"accent":{"type":"string","nullable":true,"description":"The accent the AI phone agent should mainly speak in"},"handoff_phone_number":{"type":"string","nullable":true,"description":"The phone number of the human agent to hand off the call to"},"interruptible":{"type":"boolean","description":"Whether the agent can be interrupted or not"},"actionIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"A list of action ids the AI phone agent has access to. A `null` value means all actions. An empty list means no actions"},"instructions":{"type":"array","nullable":true,"items":{"type":"string"},"description":"A list of instructions"},"data_collection_fields":{"type":"array","nullable":true,"items":{"type":"string"},"description":"A list of fields to collect data about"},"data_collection_webhook_url":{"type":"string","nullable":true,"description":"The webhook url to send the collected data to"},"voice_id":{"type":"string","nullable":true,"description":"The voice id"},"first_message":{"type":"string","nullable":true,"description":"The first message the AI phone agent should say"},"flow":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["root","condition","action"]},"content":{"type":"string"},"children":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["root","condition","action"]},"content":{"type":"string"},"children":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["root","condition","action"]},"content":{"type":"string"},"children":{"type":"array","items":{"nullable":true}}},"required":["type","content","children"]}}},"required":["type","content","children"]}}},"required":["type","content","children"]},"use_org_knowledgebase":{"type":"boolean","nullable":true,"description":"Whether the AI phone agent should use the organization's knowledgebase (enabling it will increase the latency of the agent)"}},"required":["flow"]},"UpdateSequenceInput":{"type":"object","properties":{"name":{"type":"string","default":"New Sequence"},"custom_id":{"type":"string"},"is_continuous":{"type":"boolean","default":true},"filter":{"type":"object","nullable":true,"properties":{"or":{"type":"array","items":{"type":"object","properties":{"and":{"type":"array","items":{"$ref":"#/components/schemas/ContactsFilter"}}},"required":["and"]},"minItems":1}},"required":["or"],"description":"A combination of contact filters. All filters within `and` arrays must apply to a contact in order for the contact to be included. On the other hand, only one of the filters within the `or` array must apply for the contact to be included. If no filter is provided, all contacts will be included.","title":"ContactsCompositeFilter"},"steps":{"type":"array","items":{"type":"object","properties":{"action":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["send_emails"]},"data":{"type":"object","properties":{"from_email":{"type":"string"},"email_subject":{"type":"string"},"email_body":{"type":"string"},"email_sender_name":{"type":"string"},"email_is_transactional":{"type":"boolean"}},"required":["from_email","email_subject","email_body","email_sender_name","email_is_transactional"]}},"required":["type","data"]},{"type":"object","properties":{"type":{"type":"string","enum":["make_phone_calls"]},"data":{"type":"object","properties":{"aiPhoneAgentId":{"type":"string"}},"required":["aiPhoneAgentId"]}},"required":["type","data"]},{"type":"object","properties":{"type":{"type":"string","enum":["send_sms_messages"]},"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["type","data"]}]},"delay_in_minutes":{"type":"number","minimum":0}},"required":["action"],"title":"SequenceStepInput"},"minItems":1}},"example":{"name":"New name"}},"WidgetContactTokenResponseDto":{"type":"object","properties":{"token":{"type":"string","description":"The JWT token to use for further requests"}},"required":["token"]},"ErrorDto":{"type":"object","properties":{"statusCode":{"type":"integer"},"message":{"type":"string"},"error":{"type":"string"}}}}}}