{"openapi":"3.0.0","paths":{"/health":{"get":{"description":"Returns HTTP 200 when the API can serve requests. No API key is needed. This path is at the root of the server, not under `/v1`.","operationId":"getHealth","parameters":[],"responses":{"200":{"description":"The API is up.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"service":{"type":"string","example":"public-api"},"uptimeSeconds":{"type":"integer","description":"Seconds since this instance started.","example":3600}},"required":["status","service","uptimeSeconds"]}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"503":{"description":"No API instance is healthy. The load balancer answers with this until one is."}},"security":[],"summary":"Check that the API is up","tags":["Health"]}},"/v1/agents":{"get":{"description":"Returns one page of the voice agents in your organization.","operationId":"listAgents","parameters":[{"name":"page","required":false,"in":"query","description":"The page to return. The first page is 1.","schema":{"example":1,"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"The number of items in each page. Default: 50. Maximum: 1000.","schema":{"example":50,"type":"number"}}],"responses":{"200":{"description":"A page of agents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentsListResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List agents","tags":["Agents"]}},"/v1/agents/{agentId}":{"get":{"description":"Returns one agent and its configuration.","operationId":"getAgent","parameters":[{"name":"agentId","required":true,"in":"path","description":"The agent `id` (UUID) or `entityKey` (`AGT-…`).","schema":{"example":"AGT-A1B2C3","type":"string"}}],"responses":{"200":{"description":"The agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no agent with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get an agent","tags":["Agents"]}},"/v1/agents/{agentId}/calls":{"post":{"description":"Starts an outbound call. The agent talks to the person who answers. Send the number to call in `phoneNumber`. This endpoint does not use `customerId` or `campaignContactId`. The call goes through `telephonyProviderId` when you send it, or through the default provider of your organization. Only `mode: \"agent\"` is possible here. A `human` call needs an operator in the web app.","operationId":"triggerAgentCall","parameters":[{"name":"agentId","required":true,"in":"path","description":"The agent `id` (UUID) or `entityKey` (`AGT-…`).","schema":{"example":"AGT-A1B2C3","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerCallDto"}}}},"responses":{"201":{"description":"The call is started. Use `sessionId` to find the call session later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerCallResponseDto"}}}},"400":{"description":"The request body is not valid, or `mode` is `human`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no agent with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Start a call with an agent","tags":["Agents"]}},"/v1/campaigns":{"get":{"description":"Returns one page of the campaigns in your organization.","operationId":"listCampaigns","parameters":[{"name":"page","required":false,"in":"query","description":"The page to return. The first page is 1.","schema":{"example":1,"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"The number of items in each page. Default: 50. Maximum: 1000.","schema":{"example":50,"type":"number"}}],"responses":{"200":{"description":"A page of campaigns.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignsListResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List campaigns","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}":{"get":{"description":"Returns one campaign with its schedule, pacing, guardrails, outcomes, and source file.","operationId":"getCampaign","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The campaign.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no campaign with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a campaign","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/calls":{"post":{"description":"Starts one outbound call with the agent and the telephony provider of the campaign. Send the number to call in `phoneNumber`. This endpoint uses only `phoneNumber` and `fromNumber`. It ignores `customerId`, `campaignContactId`, `mode`, and `telephonyProviderId`.","operationId":"triggerCampaignCall","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerCallDto"}}}},"responses":{"201":{"description":"The call is started. Use `sessionId` to find the call session later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerCallResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no campaign with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"422":{"description":"The campaign sends its calls to operators and has no agent to call with.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Start a campaign call","tags":["Campaigns"]}},"/v1/campaigns/{campaignId}/sessions":{"get":{"description":"Returns one page of the calls made for this campaign, one session per call, newest first. An unknown campaign returns an empty page. To get the next page, send `nextCursor` as `cursor`, or send the next `page`. `total` counts every call of the campaign; it is null on a page you got with `cursor`.","operationId":"listCampaignSessions","parameters":[{"name":"campaignId","required":true,"in":"path","description":"The campaign `id` (UUID).","schema":{"format":"uuid","type":"string"}},{"name":"cursor","required":false,"in":"query","description":"The `nextCursor` of the previous page. Do not send it with `page`.","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","description":"The page to return. The first page is 1.","schema":{"example":1,"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"The number of items in each page. Default: 50. Maximum: 1000.","schema":{"example":50,"type":"number"}}],"responses":{"200":{"description":"A page of call sessions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionsListResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List the call sessions of a campaign","tags":["Campaigns"]}},"/v1/tools/discounted-amount":{"post":{"description":"Applies percentage discounts to a total amount. Send either a `discounts` list or a `minDiscount` and `maxDiscount` pair. The pair makes a ladder of 4 discounts between the two bounds. When you send both, the pair wins.","operationId":"calculateDiscountedAmounts","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountedAmountRequestDto"}}}},"responses":{"200":{"description":"The amount after each discount, in ascending order, rounded to 2 decimals.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DiscountedAmountResponseDto"}}}}},"400":{"description":"`totalAmount` or a discount is not valid, only one bound of the pair is sent, or `minDiscount` is larger than `maxDiscount`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Calculate discounted amounts","tags":["Agent Tools"]}},"/v1/tools/payment-dates":{"get":{"description":"Returns the earliest and the latest date a customer can promise a payment for, from the payment rules of your organization. All dates are in the organization time zone.","operationId":"getPaymentDates","parameters":[],"responses":{"200":{"description":"The allowed payment-date window.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentDatesResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"Your organization has no payment-date rules configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get the allowed payment dates","tags":["Agent Tools"]}},"/v1/questions":{"post":{"description":"Adds a question to a questionnaire. Drellia answers it for each conversation it evaluates. For an `options` question, send the possible answers in `allowedAnswers`.","operationId":"createQuestion","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQuestionDto"}}}},"responses":{"201":{"description":"The new question.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"You set an `alertTypeId` the question does not already have, and your organization does not have Alerts on (`code` is `MODULE_DISABLED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"404":{"description":"There is no questionnaire with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Create a question","tags":["Questions"]},"get":{"description":"Returns one page of the questions in your organization. Each filter is optional. A list filter takes values separated by commas.","operationId":"listQuestions","parameters":[{"name":"page","required":false,"in":"query","description":"The page to return. The first page is 1.","schema":{"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","deprecated":true,"description":"The older name of `pageSize`. Use `pageSize`.","schema":{"type":"number"}},{"name":"searchTerm","required":false,"in":"query","description":"Return only questions whose title contains this text.","schema":{"example":"greeting","type":"string"}},{"name":"questionnaireIds","required":false,"in":"query","description":"Return only questions in these questionnaires. UUIDs separated by commas.","schema":{"example":"550e8400-e29b-41d4-a716-446655440000,6f1c2d3e-4b5a-4c6d-8e7f-90a1b2c3d4e5","type":"string"}},{"name":"types","required":false,"in":"query","description":"Return only questions of these types. Values separated by commas. One of: boolean, options, text.","schema":{"example":"boolean,options","type":"string"}},{"name":"alertTypeIds","required":false,"in":"query","description":"Return only questions linked to these alert types. UUIDs separated by commas.","schema":{"type":"string"}},{"name":"pageSize","required":false,"in":"query","description":"The number of items in each page. Default: 50. Maximum: 1000.","schema":{"example":50,"type":"number"}}],"responses":{"200":{"description":"A page of questions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List questions","tags":["Questions"]}},"/v1/questions/{questionId}":{"get":{"description":"Returns one question.","operationId":"getQuestion","parameters":[{"name":"questionId","required":true,"in":"path","description":"The question `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The question.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no question with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a question","tags":["Questions"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change.","operationId":"updateQuestion","parameters":[{"name":"questionId","required":true,"in":"path","description":"The question `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQuestionDto"}}}},"responses":{"200":{"description":"The updated question.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"You set an `alertTypeId` the question does not already have, and your organization does not have Alerts on (`code` is `MODULE_DISABLED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"404":{"description":"There is no question with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update a question","tags":["Questions"]},"delete":{"description":"Deletes the question. Answers already recorded for it stay.","operationId":"deleteQuestion","parameters":[{"name":"questionId","required":true,"in":"path","description":"The question `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"The question is deleted."},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no question with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete a question","tags":["Questions"]}},"/v1/questions/{questionId}/stats":{"get":{"description":"Returns how many answers this question has and how many employees answered it.","operationId":"getQuestionStats","parameters":[{"name":"questionId","required":true,"in":"path","description":"The question `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The question statistics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionStatsResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no question with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get question statistics","tags":["Questions"]}},"/v1/employees":{"post":{"description":"Creates an employee. An employee must be in a department before you can create a conversation for them. Send `departmentId` here, or add them to a department later.","operationId":"createEmployee","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEmployeeDto"}}}},"responses":{"201":{"description":"The new employee.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"409":{"description":"Another employee in your organization already has this `externalId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Create an employee","tags":["Employees"]},"get":{"description":"Returns one page of the employees in your organization.","operationId":"listEmployees","parameters":[{"name":"page","required":false,"in":"query","description":"The page to return. The first page is 1.","schema":{"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","deprecated":true,"description":"The older name of `pageSize`. Use `pageSize`.","schema":{"type":"number"}},{"name":"searchTerm","required":false,"in":"query","description":"Return only employees whose name contains this text.","schema":{"example":"Anna","type":"string"}},{"name":"pageSize","required":false,"in":"query","description":"The number of items in each page. Default: 50. Maximum: 1000.","schema":{"example":50,"type":"number"}},{"name":"externalId","required":false,"in":"query","description":"Return only the employee with this `externalId`. Deleted employees are always left out.","schema":{"example":"EMP-4411","type":"string"}},{"name":"ignoreDeleted","required":false,"in":"query","description":"When `true`, leave out deleted employees.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"A page of employees.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List employees","tags":["Employees"]}},"/v1/employees/external/{externalId}":{"get":{"description":"Returns one employee. Name the employee with the `externalId` from your system.","operationId":"getEmployeeByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the employee. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"EMP-4411","type":"string"}}],"responses":{"200":{"description":"The employee.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no employee with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get an employee by externalId","tags":["Employees"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change. Name the employee with the `externalId` from your system. Send `externalId` in the body to replace it.","operationId":"updateEmployeeByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the employee. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"EMP-4411","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmployeeDto"}}}},"responses":{"200":{"description":"The updated employee.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no employee with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another live employee in your organization uses this external ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update an employee by externalId","tags":["Employees"]}},"/v1/employees/{employeeId}":{"get":{"description":"Returns one employee.","operationId":"getEmployee","parameters":[{"name":"employeeId","required":true,"in":"path","description":"The employee `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The employee.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no employee with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get an employee","tags":["Employees"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change.","operationId":"updateEmployee","parameters":[{"name":"employeeId","required":true,"in":"path","description":"The employee `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmployeeDto"}}}},"responses":{"200":{"description":"The updated employee.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no employee with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another live employee in your organization uses this external ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update an employee","tags":["Employees"]},"delete":{"description":"Deletes the employee. Their conversations stay. Use `ignoreDeleted=true` on the list endpoint to hide deleted employees.","operationId":"deleteEmployee","parameters":[{"name":"employeeId","required":true,"in":"path","description":"The employee `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"The employee is deleted."},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no employee with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete an employee","tags":["Employees"]}},"/v1/employees/{employeeId}/stats":{"get":{"description":"Returns counts of the conversations and answers recorded for this employee.","operationId":"getEmployeeStats","parameters":[{"name":"employeeId","required":true,"in":"path","description":"The employee `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The employee statistics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeStatsResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no employee with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get employee statistics","tags":["Employees"]}},"/v1/employees/{employeeId}/departments/{departmentId}":{"post":{"description":"An employee can be in more than one department.","operationId":"addEmployeeToDepartment","parameters":[{"name":"employeeId","required":true,"in":"path","description":"The employee `id` (UUID).","schema":{"format":"uuid","type":"string"}},{"name":"departmentId","required":true,"in":"path","description":"The department `id` (UUID) or `entityKey` (`DEP-…`).","schema":{"example":"DEP-A1B2C3","type":"string"}}],"responses":{"200":{"description":"The employee, with the department added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no employee or no department with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Add an employee to a department","tags":["Employees"]},"delete":{"description":"Returns HTTP 200 with the employee, not 204, so you can see the departments that remain.","operationId":"removeEmployeeFromDepartment","parameters":[{"name":"employeeId","required":true,"in":"path","description":"The employee `id` (UUID).","schema":{"format":"uuid","type":"string"}},{"name":"departmentId","required":true,"in":"path","description":"The department `id` (UUID) or `entityKey` (`DEP-…`).","schema":{"example":"DEP-A1B2C3","type":"string"}}],"responses":{"200":{"description":"The employee, with the department removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeeDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no employee or no department with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Remove an employee from a department","tags":["Employees"]}},"/v1/departments":{"post":{"description":"Creates a department. Set `evaluateTransfer` and `transferContext` when Drellia must judge whether a transfer to this department was correct.","operationId":"createDepartment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDepartmentDto"}}}},"responses":{"201":{"description":"The new department.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"409":{"description":"Another department in your organization already has this `externalId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Create a department","tags":["Departments"]},"get":{"description":"Returns one page of the departments in your organization.","operationId":"listDepartments","parameters":[{"name":"page","required":false,"in":"query","description":"The page to return. The first page is 1.","schema":{"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","deprecated":true,"description":"The older name of `pageSize`. Use `pageSize`.","schema":{"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"The number of items in each page. Default: 50. Maximum: 1000.","schema":{"example":50,"type":"number"}}],"responses":{"200":{"description":"A page of departments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentsListResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List departments","tags":["Departments"]}},"/v1/departments/external/{externalId}":{"get":{"description":"Returns one department. Name it with the `externalId` from your system.","operationId":"getDepartmentByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the department.","schema":{"example":"MERCADOLIBRE","type":"string"}}],"responses":{"200":{"description":"The department.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no department with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a department by externalId","tags":["Departments"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change. Name the department with the `externalId` from your system. Send `externalId` in the body to replace it.","operationId":"updateDepartmentByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the department.","schema":{"example":"MERCADOLIBRE","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDepartmentDto"}}}},"responses":{"200":{"description":"The updated department.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no department with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another department in your organization already has this `externalId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update a department by externalId","tags":["Departments"]}},"/v1/departments/{departmentId}":{"get":{"description":"Returns one department.","operationId":"getDepartment","parameters":[{"name":"departmentId","required":true,"in":"path","description":"The department `id` (UUID) or `entityKey` (`DEP-…`).","schema":{"example":"DEP-A1B2C3","type":"string"}}],"responses":{"200":{"description":"The department.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no department with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a department","tags":["Departments"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change.","operationId":"updateDepartment","parameters":[{"name":"departmentId","required":true,"in":"path","description":"The department `id` (UUID) or `entityKey` (`DEP-…`).","schema":{"example":"DEP-A1B2C3","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDepartmentDto"}}}},"responses":{"200":{"description":"The updated department.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no department with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another department in your organization already has this `externalId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update a department","tags":["Departments"]},"delete":{"description":"Deletes the department. Employees in it stay, without this department.","operationId":"deleteDepartment","parameters":[{"name":"departmentId","required":true,"in":"path","description":"The department `id` (UUID) or `entityKey` (`DEP-…`).","schema":{"example":"DEP-A1B2C3","type":"string"}}],"responses":{"204":{"description":"The department is deleted."},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no department with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete a department","tags":["Departments"]}},"/v1/questionnaires":{"post":{"description":"Creates a questionnaire in `draft` status. The `status` you send is ignored. Add questions to it, then set the status to `active` with an update.","operationId":"createQuestionnaire","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQuestionnaireDto"}}}},"responses":{"201":{"description":"The new questionnaire.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionnaireResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Create a questionnaire","tags":["Questionnaires"]},"get":{"description":"Returns one page of the questionnaires in your organization.","operationId":"listQuestionnaires","parameters":[{"name":"page","required":false,"in":"query","description":"The page to return. The first page is 1.","schema":{"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","deprecated":true,"description":"The older name of `pageSize`. Use `pageSize`.","schema":{"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"The number of items in each page. Default: 50. Maximum: 1000.","schema":{"example":50,"type":"number"}}],"responses":{"200":{"description":"A page of questionnaires.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionnairesListResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List questionnaires","tags":["Questionnaires"]}},"/v1/questionnaires/{questionnaireId}":{"get":{"description":"Returns one questionnaire.","operationId":"getQuestionnaire","parameters":[{"name":"questionnaireId","required":true,"in":"path","description":"The questionnaire `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The questionnaire.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionnaireResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no questionnaire with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a questionnaire","tags":["Questionnaires"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change. Set `status` to `active` to start evaluations, or to `archived` to stop them.","operationId":"updateQuestionnaire","parameters":[{"name":"questionnaireId","required":true,"in":"path","description":"The questionnaire `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQuestionnaireDto"}}}},"responses":{"200":{"description":"The updated questionnaire.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionnaireResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no questionnaire with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update a questionnaire","tags":["Questionnaires"]},"delete":{"description":"Deletes the questionnaire and stops its evaluations.","operationId":"deleteQuestionnaire","parameters":[{"name":"questionnaireId","required":true,"in":"path","description":"The questionnaire `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"The questionnaire is deleted."},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no questionnaire with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete a questionnaire","tags":["Questionnaires"]}},"/v1/customers":{"post":{"description":"Creates a customer in your organization. Use `externalId` to keep the identifier from your own system. Use `metadata` for extra facts the voice agents can use.","operationId":"createCustomer","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerDto"}}}},"responses":{"201":{"description":"The new customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"409":{"description":"Another customer in your organization already has this `externalId` or phone number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Create a customer","tags":["Customers"]},"get":{"description":"Returns one page of the customers in your organization.","operationId":"listCustomers","parameters":[{"name":"page","required":false,"in":"query","description":"The page to return. The first page is 1.","schema":{"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","deprecated":true,"description":"The older name of `pageSize`. Use `pageSize`.","schema":{"type":"number"}},{"name":"externalId","required":false,"in":"query","description":"Return only the customer with this `externalId`.","schema":{"example":"EXT-001","type":"string"}},{"name":"pageSize","required":false,"in":"query","description":"The number of items in each page. Default: 50. Maximum: 1000.","schema":{"example":50,"type":"number"}}],"responses":{"200":{"description":"A page of customers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomersListResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List customers","tags":["Customers"]}},"/v1/customers/external/{externalId}":{"get":{"description":"Returns one customer. Name the customer with the `externalId` from your system.","operationId":"getCustomerByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the customer. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"EXT-001","type":"string"}}],"responses":{"200":{"description":"The customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no customer with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a customer by externalId","tags":["Customers"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change. Send an empty string to clear a name, email, or phone number. Name the customer with the `externalId` from your system. Send `externalId` in the body to replace it.","operationId":"updateCustomerByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the customer. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"EXT-001","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerDto"}}}},"responses":{"200":{"description":"The updated customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no customer with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another live customer in your organization uses this external ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update a customer by externalId","tags":["Customers"]}},"/v1/customers/{customerId}":{"get":{"description":"Returns one customer.","operationId":"getCustomer","parameters":[{"name":"customerId","required":true,"in":"path","description":"The customer `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no customer with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a customer","tags":["Customers"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change. Send an empty string to clear a name, email, or phone number.","operationId":"updateCustomer","parameters":[{"name":"customerId","required":true,"in":"path","description":"The customer `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerDto"}}}},"responses":{"200":{"description":"The updated customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no customer with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another live customer in your organization uses this external ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update a customer","tags":["Customers"]},"delete":{"description":"Deletes the customer. Conversations that refer to the customer stay.","operationId":"deleteCustomer","parameters":[{"name":"customerId","required":true,"in":"path","description":"The customer `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"The customer is deleted."},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no customer with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete a customer","tags":["Customers"]}},"/v1/customers/{customerId}/stage-changes":{"get":{"description":"Returns every stage change of the customer, newest `effectiveOn` first. A stage you deactivated or deleted since keeps its name here.","operationId":"listStageChanges","parameters":[{"name":"customerId","required":true,"in":"path","description":"The customer `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The stage history.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerStageChangeResponseDto"}}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no customer with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List a customer's stage history","tags":["Customers"]},"post":{"description":"Records the stage the customer is in from `effectiveOn` on. Send `stageId: null` for no stage. `effectiveOn` may lie in the past: an older change is added to the history, and the customer's current `stageId` changes only when this is the latest change. It may not lie in the future, and it needs `Z` or a UTC offset. A past change may name a stage that was deactivated, or deleted after `effectiveOn`, so imported history keeps the stage of its time. Send `sourceEventId` to make retries safe: the same id returns the change already recorded.","operationId":"createStageChange","parameters":[{"name":"customerId","required":true,"in":"path","description":"The customer `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerStageChangeDto"}}}},"responses":{"201":{"description":"The recorded stage change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerStageChangeResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no customer with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another stage change of this customer has the same `effectiveOn`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"422":{"description":"`stageId` names no stage of your organization, or one deleted before `effectiveOn` (`code` is `CUSTOMER_STAGE_UNAVAILABLE`); or `effectiveOn` lies in the future (`code` is `CUSTOMER_STAGE_CHANGE_IN_FUTURE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Change a customer's stage","tags":["Customers"]}},"/v1/customer-stages":{"get":{"description":"Returns the customer stages your organization configured, in list order, with the `id` to send as `stageId` when you change a customer stage. Send `activeOnly=true` to leave out the deactivated stages, which no customer can be moved into.","operationId":"listCustomerStages","parameters":[{"name":"activeOnly","required":false,"in":"query","description":"True lists only the stages a customer can be moved into.","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"description":"The customer stages.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerStageResponseDto"}}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Your organization does not have Customer stages on (`code` is `MODULE_DISABLED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List customer stages","tags":["Customers"]},"post":{"description":"Adds a stage to the list. Without `sortOrder` it goes after the last stage. Send `isActive: false` to add it before customers can be moved into it.","operationId":"createCustomerStage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerStageDto"}}}},"responses":{"201":{"description":"The new stage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerStageResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Your organization does not have Customer stages on (`code` is `MODULE_DISABLED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another customer stage in your organization has this name, ignoring case (`code` is `CUSTOMER_STAGE_NAME_TAKEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Add a customer stage","tags":["Customers"]}},"/v1/customer-stages/{stageId}":{"put":{"description":"Renames, reorders, deactivates or reactivates the stage. Fields you do not send do not change. A deactivated stage stays on the customers in it, but no customer can be moved into it.","operationId":"updateCustomerStage","parameters":[{"name":"stageId","required":true,"in":"path","description":"The customer stage `id`.","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerStageDto"}}}},"responses":{"200":{"description":"The updated stage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerStageResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Your organization does not have Customer stages on (`code` is `MODULE_DISABLED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"404":{"description":"There is no customer stage with this ID in your organization (`code` is `CUSTOMER_STAGE_NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another customer stage in your organization has this name, ignoring case (`code` is `CUSTOMER_STAGE_NAME_TAKEN`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update a customer stage","tags":["Customers"]},"delete":{"description":"Removes the stage from the list, and its name can be used again. Customers in it, their stage history, conversations and evaluations keep naming it.","operationId":"deleteCustomerStage","parameters":[{"name":"stageId","required":true,"in":"path","description":"The customer stage `id`.","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"The stage is deleted."},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Your organization does not have Customer stages on (`code` is `MODULE_DISABLED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"404":{"description":"There is no customer stage with this ID in your organization (`code` is `CUSTOMER_STAGE_NOT_FOUND`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete a customer stage","tags":["Customers"]}},"/v1/conversations/external/{externalId}/attachments":{"get":{"description":"Returns the files declared on the messages of a conversation, grouped by message and in their order within each message, with their status and what Drellia read from them: the transcript of voice notes and audio, and the text and description of images and documents.","operationId":"listAttachmentsByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"wa-5491155550101-20261003","type":"string"}}],"responses":{"200":{"description":"The attachments.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List the attachments of a conversation by externalId","tags":["Conversations"]}},"/v1/conversations/external/{externalId}/attachments/{attachmentId}":{"get":{"description":"Returns one attachment. To get a URL that downloads the file, add `include=download`. The URL works for 5 minutes. Drellia records each download URL it gives.","operationId":"getAttachmentByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"wa-5491155550101-20261003","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}},{"name":"include","required":false,"in":"query","description":"Add `download` to get a URL that downloads the file.","schema":{"enum":["download"],"type":"string"}}],"responses":{"200":{"description":"The attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}},"400":{"description":"`include` has a value that is not `download`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get an attachment by externalId","tags":["Conversations"]},"delete":{"description":"Deletes the file of an attachment, its preview and what Drellia read from it. The message stays. When the conversation waits for its attachments, it no longer waits for this one.","operationId":"deleteAttachmentByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"wa-5491155550101-20261003","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"The attachment is deleted."},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete an attachment by externalId","tags":["Conversations"]}},"/v1/conversations/external/{externalId}/attachments/{attachmentId}/upload-url":{"post":{"description":"Returns the attachment with a new `upload` URL. Use it when the URL from the request that declared the attachment expired or got lost, for example after a create that answered 409 for a duplicate `externalId`. Upload the file with a `PUT` request to `upload.url`, with `upload.headers` and exactly the declared number of bytes.","operationId":"reissueAttachmentUploadByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"wa-5491155550101-20261003","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The attachment with its upload URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The file already arrived, or it was rejected (`code` is `ATTACHMENT_CONFLICT`). A rejected file is declared again on a new message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a new upload URL for an attachment by externalId","tags":["Conversations"]}},"/v1/conversations/external/{externalId}/attachments/{attachmentId}/complete":{"post":{"description":"Tells Drellia that the file is uploaded. Drellia checks that its size and type match the declaration; a file that does not match is deleted and the attachment becomes `rejected`. Drellia also finds the file without this call; the call starts processing sooner and confirms that the file arrived.","operationId":"completeAttachmentUploadByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"wa-5491155550101-20261003","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"202":{"description":"The attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The file is not in storage yet (`code` is `ATTACHMENT_NOT_UPLOADED`). Upload it, then call this endpoint again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Complete an attachment upload by externalId","tags":["Conversations"]}},"/v1/conversations/external/{externalId}/attachments/{attachmentId}/process":{"post":{"description":"Asks Drellia to transcribe a voice note or audio file, or to read and describe an image or document. Use it for kinds of attachment that your organization processes on demand. Processing runs in the background: get the attachment again until `processing.status` is `done` or `failed`. A request for an attachment that is already queued changes nothing. Processing uses credits. A conversation that was already evaluated is not evaluated again.","operationId":"processAttachmentByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"wa-5491155550101-20261003","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"202":{"description":"The attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The file has not arrived (`code` is `ATTACHMENT_NOT_PROCESSABLE`), the attachment is already processed (`code` is `ATTACHMENT_ALREADY_PROCESSED`), or processing is off for this kind of attachment (`code` is `ATTACHMENT_PROCESSING_OFF`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Process an attachment by externalId","tags":["Conversations"]}},"/v1/conversations/{conversationId}/attachments":{"get":{"description":"Returns the files declared on the messages of a conversation, grouped by message and in their order within each message, with their status and what Drellia read from them: the transcript of voice notes and audio, and the text and description of images and documents.","operationId":"listAttachments","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}}],"responses":{"200":{"description":"The attachments.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}}},"400":{"description":"The conversation ID is not a UUID or a `CNV-` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List the attachments of a conversation","tags":["Conversations"]}},"/v1/conversations/{conversationId}/attachments/{attachmentId}":{"get":{"description":"Returns one attachment. To get a URL that downloads the file, add `include=download`. The URL works for 5 minutes. Drellia records each download URL it gives.","operationId":"getAttachment","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}},{"name":"include","required":false,"in":"query","description":"Add `download` to get a URL that downloads the file.","schema":{"enum":["download"],"type":"string"}}],"responses":{"200":{"description":"The attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}},"400":{"description":"An ID is not valid, or `include` has a value that is not `download`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get an attachment","tags":["Conversations"]},"delete":{"description":"Deletes the file of an attachment, its preview and what Drellia read from it. The message stays. When the conversation waits for its attachments, it no longer waits for this one.","operationId":"deleteAttachment","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"The attachment is deleted."},"400":{"description":"An ID is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete an attachment","tags":["Conversations"]}},"/v1/conversations/{conversationId}/attachments/{attachmentId}/upload-url":{"post":{"description":"Returns the attachment with a new `upload` URL. Use it when the URL from the request that declared the attachment expired or got lost, for example after a create that answered 409 for a duplicate `externalId`. Upload the file with a `PUT` request to `upload.url`, with `upload.headers` and exactly the declared number of bytes.","operationId":"reissueAttachmentUpload","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The attachment with its upload URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}},"400":{"description":"An ID is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The file already arrived, or it was rejected (`code` is `ATTACHMENT_CONFLICT`). A rejected file is declared again on a new message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a new upload URL for an attachment","tags":["Conversations"]}},"/v1/conversations/{conversationId}/attachments/{attachmentId}/complete":{"post":{"description":"Tells Drellia that the file is uploaded. Drellia checks that its size and type match the declaration; a file that does not match is deleted and the attachment becomes `rejected`. Drellia also finds the file without this call; the call starts processing sooner and confirms that the file arrived.","operationId":"completeAttachmentUpload","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"202":{"description":"The attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}},"400":{"description":"An ID is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The file is not in storage yet (`code` is `ATTACHMENT_NOT_UPLOADED`). Upload it, then call this endpoint again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Complete an attachment upload","tags":["Conversations"]}},"/v1/conversations/{conversationId}/attachments/{attachmentId}/process":{"post":{"description":"Asks Drellia to transcribe a voice note or audio file, or to read and describe an image or document. Use it for kinds of attachment that your organization processes on demand. Processing runs in the background: get the attachment again until `processing.status` is `done` or `failed`. A request for an attachment that is already queued changes nothing. Processing uses credits. A conversation that was already evaluated is not evaluated again.","operationId":"processAttachment","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}},{"name":"attachmentId","required":true,"in":"path","description":"The attachment `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"202":{"description":"The attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponseDto"}}}},"400":{"description":"An ID is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization, or it has no attachment with this ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The file has not arrived (`code` is `ATTACHMENT_NOT_PROCESSABLE`), the attachment is already processed (`code` is `ATTACHMENT_ALREADY_PROCESSED`), or processing is off for this kind of attachment (`code` is `ATTACHMENT_PROCESSING_OFF`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Process an attachment","tags":["Conversations"]}},"/v1/conversations/external/{externalId}/recording":{"post":{"description":"Starts the upload of the audio recording of a conversation. The response contains the recording and an upload form. Send the file to `upload.url` in a `multipart/form-data` POST request: first all `upload.fields`, then the file in a field named `file`. Then call Complete a recording upload. The form works for one hour. A conversation has one recording, and it gets its transcript from the recording or from messages, not both. If you call this endpoint again before the file arrives, you get the same recording with a new form. After a recording fails, this endpoint replaces it.","operationId":"createRecordingUploadByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"ticket/8841","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecordingUploadDto"}}}},"responses":{"201":{"description":"The recording and the upload form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingUploadResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The conversation already has a recording that is past `awaiting_upload` (`code` is `RECORDING_EXISTS`), it already has messages (`code` is `TRANSCRIPT_FROM_MESSAGES`), its transcript is complete (`code` is `TRANSCRIPT_FINALIZED`), or it has no employee (`code` is `EMPLOYEE_REQUIRED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Add a recording by externalId","tags":["Conversations"]},"get":{"description":"Returns the recording and where it is in processing. While `status` is not `transcribed` or `failed`, get the recording again after `retryAfterSeconds`. To get a URL that plays the recording, add `include=playback`. Drellia records each playback URL it gives.","operationId":"getRecordingByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"ticket/8841","type":"string"}},{"name":"include","required":false,"in":"query","description":"Add `playback` to get a URL that plays the recording.","schema":{"enum":["playback"],"type":"string"}}],"responses":{"200":{"description":"The recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingResponseDto"}}}},"400":{"description":"`include` has a value that is not `playback`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization, or it has no recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a recording by externalId","tags":["Conversations"]},"delete":{"description":"Deletes the recording and every stored copy of its audio file. The transcript and the evaluation of the conversation stay. You cannot delete a recording while it is in processing.","operationId":"deleteRecordingByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"ticket/8841","type":"string"}}],"responses":{"204":{"description":"The recording is deleted."},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization, or it has no recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The recording is in processing (`code` is `RECORDING_IN_PROGRESS`). Delete it after its `status` is `transcribed` or `failed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete a recording by externalId","tags":["Conversations"]}},"/v1/conversations/external/{externalId}/recording/complete":{"post":{"description":"Tells Drellia that the audio file is uploaded. Drellia checks the file, then transcribes and evaluates the conversation. Drellia also finds the file without this call, but the call starts processing sooner and confirms that the file arrived. If the file was already found, the call returns the recording and changes nothing.","operationId":"completeRecordingUploadByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"ticket/8841","type":"string"}}],"responses":{"202":{"description":"The recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization, or it has no recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The audio file is not in storage yet (`code` is `RECORDING_NOT_UPLOADED`). Upload it, then call this endpoint again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Complete a recording upload by externalId","tags":["Conversations"]}},"/v1/conversations/external/{externalId}/recording/reprocess":{"post":{"description":"Processes the recording again, then evaluates the conversation. Use it when `status` is `failed` and the file arrived, or when `needsReview` is true: then send the employee speaker (`mono`) or the employee channel (`stereo_split`). Drellia reuses the transcript when it exists and assigns the speakers again. A recording that is `transcribed` without `needsReview` is already evaluated and cannot be reprocessed.","operationId":"reprocessRecordingByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"ticket/8841","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReprocessRecordingDto"}}}},"responses":{"202":{"description":"The recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization, or it has no recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The recording cannot be reprocessed (`code` is `RECORDING_NOT_REPROCESSABLE`): it is in processing, it is already evaluated, its file did not arrive, or it comes from a voice call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Reprocess a recording by externalId","tags":["Conversations"]}},"/v1/conversations/{conversationId}/recording":{"post":{"description":"Starts the upload of the audio recording of a conversation. The response contains the recording and an upload form. Send the file to `upload.url` in a `multipart/form-data` POST request: first all `upload.fields`, then the file in a field named `file`. Then call Complete a recording upload. The form works for one hour. A conversation has one recording, and it gets its transcript from the recording or from messages, not both. If you call this endpoint again before the file arrives, you get the same recording with a new form. After a recording fails, this endpoint replaces it.","operationId":"createRecordingUpload","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecordingUploadDto"}}}},"responses":{"201":{"description":"The recording and the upload form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingUploadResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The conversation already has a recording that is past `awaiting_upload` (`code` is `RECORDING_EXISTS`), it already has messages (`code` is `TRANSCRIPT_FROM_MESSAGES`), its transcript is complete (`code` is `TRANSCRIPT_FINALIZED`), or it has no employee (`code` is `EMPLOYEE_REQUIRED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Add a recording","tags":["Conversations"]},"get":{"description":"Returns the recording and where it is in processing. While `status` is not `transcribed` or `failed`, get the recording again after `retryAfterSeconds`. To get a URL that plays the recording, add `include=playback`. Drellia records each playback URL it gives.","operationId":"getRecording","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}},{"name":"include","required":false,"in":"query","description":"Add `playback` to get a URL that plays the recording.","schema":{"enum":["playback"],"type":"string"}}],"responses":{"200":{"description":"The recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingResponseDto"}}}},"400":{"description":"The conversation ID is not valid, or `include` has a value that is not `playback`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization, or it has no recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a recording","tags":["Conversations"]},"delete":{"description":"Deletes the recording and every stored copy of its audio file. The transcript and the evaluation of the conversation stay. You cannot delete a recording while it is in processing.","operationId":"deleteRecording","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}}],"responses":{"204":{"description":"The recording is deleted."},"400":{"description":"The conversation ID is not a UUID or a `CNV-` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization, or it has no recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The recording is in processing (`code` is `RECORDING_IN_PROGRESS`). Delete it after its `status` is `transcribed` or `failed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete a recording","tags":["Conversations"]}},"/v1/conversations/{conversationId}/recording/complete":{"post":{"description":"Tells Drellia that the audio file is uploaded. Drellia checks the file, then transcribes and evaluates the conversation. Drellia also finds the file without this call, but the call starts processing sooner and confirms that the file arrived. If the file was already found, the call returns the recording and changes nothing.","operationId":"completeRecordingUpload","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}}],"responses":{"202":{"description":"The recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingResponseDto"}}}},"400":{"description":"The conversation ID is not a UUID or a `CNV-` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization, or it has no recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The audio file is not in storage yet (`code` is `RECORDING_NOT_UPLOADED`). Upload it, then call this endpoint again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Complete a recording upload","tags":["Conversations"]}},"/v1/conversations/{conversationId}/recording/reprocess":{"post":{"description":"Processes the recording again, then evaluates the conversation. Use it when `status` is `failed` and the file arrived, or when `needsReview` is true: then send the employee speaker (`mono`) or the employee channel (`stereo_split`). Drellia reuses the transcript when it exists and assigns the speakers again. A recording that is `transcribed` without `needsReview` is already evaluated and cannot be reprocessed.","operationId":"reprocessRecording","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID) or its `entityKey`, for example `CNV-A1B2C3`.","schema":{"example":"CNV-A1B2C3","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReprocessRecordingDto"}}}},"responses":{"202":{"description":"The recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization, or it has no recording.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The recording cannot be reprocessed (`code` is `RECORDING_NOT_REPROCESSABLE`): it is in processing, it is already evaluated, its file did not arrive, or it comes from a voice call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Reprocess a recording","tags":["Conversations"]}},"/v1/conversations":{"post":{"description":"Registers a conversation for audit. Identify the employee with `employeeId` or `employeeExternalId`, and the customer with `customerId` or `customerExternalId`. The employee must be in a department. Send `messages` (and optionally `events`) to create the conversation complete, in one call: Drellia evaluates it and accepts no more messages for it. Messages can declare `attachments`: voice notes, images, documents and other files. The response gives an upload URL for each one in `attachments`; upload the files there. Drellia evaluates the conversation when the files arrive, or 30 minutes after the create without the files that did not arrive. In each message, name an employee sender with `senderId` or `senderExternalId`. An employee message with neither belongs to the employee of the conversation. Without `messages`, the conversation stays open: add the messages with Add messages, in one or more batches, or upload the audio. Send `externalId` to make a retry safe: a second conversation with the same `externalId` gets 409 and the `id` of the existing one.","operationId":"createConversation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationDto"}}}},"responses":{"201":{"description":"The new conversation, in `PENDING` status, with the upload URL of each attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationResponseDto"}}}},"400":{"description":"The body is not valid; both or neither of `employeeId` and `employeeExternalId` (or of `customerId` and `customerExternalId`) are sent; the employee is in no department; a message, an attachment or an event is not valid; or a message names its sender with both `senderId` and `senderExternalId`, or with a `senderExternalId` that names no employee.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no employee or no customer with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"A conversation with this `externalId` already exists: `conversationId` is its `id`, and Get a new upload URL for an attachment gives new upload URLs for its files. Or a `clientAttachmentId` belongs to another attachment (`code` is `ATTACHMENT_CONFLICT`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"503":{"description":"The messages could not be saved. Nothing was created; retry the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Create a conversation","tags":["Conversations"]},"get":{"description":"Returns one page of the conversations in your organization.","operationId":"listConversations","parameters":[{"name":"page","required":false,"in":"query","description":"The page to return. The first page is 1.","schema":{"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","deprecated":true,"description":"The older name of `pageSize`. Use `pageSize`.","schema":{"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"The number of items in each page. Default: 50. Maximum: 1000.","schema":{"example":50,"type":"number"}}],"responses":{"200":{"description":"A page of conversations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationsListResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List conversations","tags":["Conversations"]}},"/v1/conversations/external/{externalId}":{"get":{"description":"Returns one conversation. Name the conversation with the `externalId` you sent when you created it.","operationId":"getConversationByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"ticket/8841","type":"string"}}],"responses":{"200":{"description":"The conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a conversation by externalId","tags":["Conversations"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change. Set `status` to `ARCHIVED` to close the conversation. Name the conversation with its current `externalId`. Send `externalId` in the body to replace it.","operationId":"updateConversationByExternalId","parameters":[{"name":"externalId","required":true,"in":"path","description":"The `externalId` you gave the conversation. Percent-encode it in the URL, for example `/` as `%2F` and `#` as `%23`.","schema":{"example":"ticket/8841","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConversationDto"}}}},"responses":{"200":{"description":"The updated conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this `externalId` in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another live conversation in your organization uses this external ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update a conversation by externalId","tags":["Conversations"]}},"/v1/conversations/{conversationId}":{"get":{"description":"Returns one conversation.","operationId":"getConversation","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get a conversation","tags":["Conversations"]},"put":{"description":"Changes the fields you send. Fields you do not send do not change. Set `status` to `ARCHIVED` to close the conversation.","operationId":"updateConversation","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConversationDto"}}}},"responses":{"200":{"description":"The updated conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationResponseDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"Another live conversation in your organization uses this external ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Update a conversation","tags":["Conversations"]},"delete":{"description":"Deletes the conversation, its messages, its events, its evaluation, its recording and its attachments. The audio file of the recording and the attachment files are deleted from storage.","operationId":"deleteConversation","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"The conversation is deleted."},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete a conversation","tags":["Conversations"]}},"/v1/conversations/{conversationId}/messages":{"post":{"description":"Adds the transcript of a text conversation: the messages, and optionally the events, for example a transfer. Send everything in one request, or in batches: set `process` to `false` on every batch except the last. The batch with `process` true (the default) or a call to Process completes the transcript; a batch with `process` false keeps it open however long the next one takes. Drellia then evaluates the conversation, and further batches get 409. `final` is the former name of `process` and is still accepted. At most 1000 messages and 1000 events per request. In each message, name an employee sender with `senderId` or `senderExternalId`. An employee message with neither belongs to the employee of the conversation. Give each message a `messageId`: a retried batch then skips the messages it already saved. Events have no such key, so a retry saves them again. The body is an object with `messages`, `events` and `process`. A bare array of messages is still accepted, but it is deprecated; it is always a last batch.","operationId":"createConversationMessage","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"description":"The messages and events of the conversation. Use the object form. The bare array form is deprecated.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CreateConversationTimelineRequestDto"},{"type":"array","deprecated":true,"description":"Deprecated: only messages, with no events.","items":{"$ref":"#/components/schemas/CreateConversationMessageRequest"}}]}}}},"responses":{"201":{"description":"How many messages and events were saved, and whether the transcript is complete.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationTimelineResponseDto"}}}},"400":{"description":"A message, an attachment or an event is not valid, two messages share a `messageId`, a message with attachments has no `messageId`, a batch is too large (`code` is `TOO_MANY_ATTACHMENTS` for more than 100 attachments), `process` or `final` is not a boolean, `process` and `final` have different values, a transfer event has no `payload.toDepartmentId`, or a message names its sender with both `senderId` and `senderExternalId`, or with a `senderExternalId` that names no employee.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The conversation gets its transcript from its recording (`code` is `TRANSCRIPT_FROM_RECORDING`); the transcript is complete, or waits for its attachments (`code` is `TRANSCRIPT_FINALIZED`); or a message declares a different attachment in a position it already has, or a `clientAttachmentId` belongs to another attachment (`code` is `ATTACHMENT_CONFLICT`). If you are retrying a batch that had `process` true, the first attempt succeeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"503":{"description":"The messages could not be saved. Nothing from this batch was kept; retry it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Add messages and events to a conversation","tags":["Conversations"]},"get":{"description":"Returns all messages and events, each list in time order.","operationId":"getConversationMessages","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The messages and events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationTimelineResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get the messages and events of a conversation","tags":["Conversations"]}},"/v1/conversations/{conversationId}/process":{"post":{"description":"Completes the transcript of a conversation whose messages you added in batches with `process` false, and starts its processing: Drellia evaluates the conversation and accepts no more messages for it. Send customer stage changes before you call it, so the evaluation sees them. Calling it again, or on a transcript that is already complete, changes nothing and returns the same result. When attachment files are still on their way, the transcript waits for them (`awaitingAttachments` is true) and is completed when they arrive or at `attachmentDeadline`.","operationId":"processConversation","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The transcript state: complete, since when, and why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptStateDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The conversation gets its transcript from its recording (`code` is `TRANSCRIPT_FROM_RECORDING`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"422":{"description":"The conversation has no messages yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Process a conversation","tags":["Conversations"]}},"/v1/conversations/{conversationId}/finalize":{"post":{"description":"The former name of Process, still accepted: it does the same. Completes the transcript of a conversation whose messages you added in batches with `process` false. Drellia then evaluates the conversation and accepts no more messages for it. Calling it again, or on a transcript that is already complete, changes nothing and returns the same result. When attachment files are still on their way, the transcript waits for them (`awaitingAttachments` is true) and is completed when they arrive or at `attachmentDeadline`.","operationId":"finalizeConversation","parameters":[{"name":"conversationId","required":true,"in":"path","description":"The conversation `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The transcript state: complete, since when, and why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptStateDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no conversation with this ID in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The conversation gets its transcript from its recording (`code` is `TRANSCRIPT_FROM_RECORDING`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"422":{"description":"The conversation has no messages yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Finalize the transcript of a conversation","tags":["Conversations"]}},"/v1/interaction-context/{interactionContextId}":{"put":{"description":"Creates or replaces the data for one interaction. Store it before the call, and the agent can read it during the call. The `id` in the path must be the same as the `id` in the body. The keys in `data` must match the context fields configured for your organization.","operationId":"storeInteractionContext","parameters":[{"name":"interactionContextId","required":true,"in":"path","description":"The interaction context `id` (UUID v4). You choose this value when you store it.","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreInteractionContextDto"}}}},"responses":{"200":{"description":"The stored interaction context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionContextResponseDto"}}}},"400":{"description":"The body is not valid, or the `id` in the path is not the same as the `id` in the body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Store an interaction context","tags":["Interaction Context"]},"get":{"description":"Returns the interaction context stored with this `id`.","operationId":"getInteractionContext","parameters":[{"name":"interactionContextId","required":true,"in":"path","description":"The interaction context `id` (UUID v4). You choose this value when you store it.","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The interaction context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionContextResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no interaction context with this identifier in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get an interaction context","tags":["Interaction Context"]}},"/v1/interaction-context/lookup":{"get":{"description":"Returns the interaction context stored with this `externalId`.","operationId":"lookupInteractionContext","parameters":[{"name":"externalId","required":true,"in":"query","description":"The `externalId` you sent when you stored the context.","schema":{"example":"crm-case-48213","type":"string"}}],"responses":{"200":{"description":"The interaction context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionContextResponseDto"}}}},"400":{"description":"`externalId` is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"There is no interaction context with this identifier in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Find an interaction context by external ID","tags":["Interaction Context"]}},"/v1/providers":{"get":{"description":"Returns the communication providers of your organization. A conversation refers to the provider it came through. This list is not paginated.","operationId":"listProviders","parameters":[],"responses":{"200":{"description":"The providers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvidersListResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List providers","tags":["Providers"]}},"/v1/reports/evaluations-export":{"post":{"description":"Exports the evaluations that match the filters, as on the Audit evaluations page. Starts an export. The response is the export run. When `status` is `pending` or `running`, get the run again after `retryAfterSeconds`. When `status` is `completed`, download the file.","operationId":"exportEvaluations","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicEvaluationsExportRequestDto"}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicReportRunDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"The body filters by `customerStageIds` while your organization does not have Customer stages on (`code` is `MODULE_DISABLED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The same export is already running in your organization (`code` is `REPORT_ALREADY_RUNNING`). The body has that run in `run` when it is known: follow it instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"429":{"description":"This API key has too many exports pending or running (`code` is `TOO_MANY_ACTIVE_REPORT_RUNS`). Wait for one to finish.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Export evaluations","tags":["Reports"]}},"/v1/reports/conversations-export":{"post":{"description":"Exports the conversations that match the filters, as on the Audit conversations page. Starts an export. The response is the export run. When `status` is `pending` or `running`, get the run again after `retryAfterSeconds`. When `status` is `completed`, download the file.","operationId":"exportConversations","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicConversationsExportRequestDto"}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicReportRunDto"}}}},"400":{"description":"The request body or a parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"The body filters by `customerStageIds` while your organization does not have Customer stages on (`code` is `MODULE_DISABLED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The same export is already running in your organization (`code` is `REPORT_ALREADY_RUNNING`). The body has that run in `run` when it is known: follow it instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"429":{"description":"This API key has too many exports pending or running (`code` is `TOO_MANY_ACTIVE_REPORT_RUNS`). Wait for one to finish.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Export conversations","tags":["Reports"]}},"/v1/report-runs":{"get":{"description":"Returns the export runs of your organization, newest first: the runs of every API key and of the users of the web app. Send `requestedBy=me` to get only the runs of this API key. This list uses a cursor, not `page`: send `nextCursor` as `cursor` to get the next page.","operationId":"listReportRuns","parameters":[{"name":"requestedBy","required":false,"in":"query","description":"Only the caller's own runs. Without it, the organization's shared runs are listed too","schema":{"type":"string","enum":["me"]}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from the previous response","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"The number of runs in each page","schema":{"minimum":1,"maximum":50,"default":8,"type":"number"}},{"name":"reportId","required":false,"in":"query","description":"The reports to list. Repeat the parameter for more than one. Default: both.","schema":{"type":"array","items":{"type":"string","enum":["evaluations-export","conversations-export"]}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicReportRunsResponseDto"}}}},"400":{"description":"A query parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"List export runs","tags":["Reports"]}},"/v1/report-runs/{runId}":{"get":{"description":"Returns the export run and where it is in processing. While `status` is `pending` or `running`, get it again after `retryAfterSeconds`.","operationId":"getReportRun","parameters":[{"name":"runId","required":true,"in":"path","description":"The `id` of the export run.","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicReportRunDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"No export run of your organization has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get an export run","tags":["Reports"]}},"/v1/report-runs/{runId}/download":{"get":{"description":"Returns a URL that downloads the file of a completed export. The URL works until `expiresAt`, 15 minutes. Get a new URL after that. The file itself is kept for 7 days.","operationId":"getReportRunDownload","parameters":[{"name":"runId","required":true,"in":"path","description":"The `id` of the export run.","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRunDownloadDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"No export run of your organization has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"409":{"description":"The export is not completed. Get the run until `status` is `completed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"410":{"description":"The export expired. Its file is deleted. Start a new export.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get the download URL of an export","tags":["Reports"]}},"/v1/tools/send-email":{"post":{"description":"Sends an email to the notification recipients configured for your organization. A voice agent calls this tool when a customer says something your team must act on, for example a promise to pay. The request has no recipient field: Drellia uses the recipients from your organization configuration.","operationId":"sendEmail","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailRequestDto"}}}},"responses":{"200":{"description":"The email is queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponseDto"}}}},"400":{"description":"The subject or the body is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"Your organization has no notification recipients configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"429":{"description":"Your organization sent too many emails. Try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"502":{"description":"The email provider rejected the message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"503":{"description":"Email sending is not configured on this server (EMAIL_NOT_CONFIGURED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Send an email to your team","tags":["Agent Tools"]}},"/v1/tools/verify-identity":{"post":{"description":"Compares the value a caller said with the value on file. The comparison tolerates speech-to-text noise, such as spaces, separators, and spelled letters. Configure `expectedValue` as a dynamic variable in your agent platform. Do not let the model fill it.","operationId":"verifyIdentity","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyIdentityRequestDto"}}}},"responses":{"200":{"description":"The result. When `match` is false, `reason` says why. The response never contains the expected value.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyIdentityResponseDto"}}}},"400":{"description":"`fieldType` is not supported, a value is missing, or `expectedValue` has no usable format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Verify an identity value","tags":["Agent Tools"]}},"/v1/working-hours":{"get":{"description":"Returns the schedule that applies to every employee without an override.","operationId":"getOrgSchedule","parameters":[],"responses":{"200":{"description":"The organization schedule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingHoursResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"Your organization has no schedule yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get the organization working hours","tags":["Working Hours"]},"put":{"description":"Replaces the full organization schedule. Send all 7 days. Campaigns with `workingHours.source: \"organization\"` use this schedule.","operationId":"setOrgSchedule","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetWorkingHoursDto"}}}},"responses":{"200":{"description":"The new organization schedule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingHoursResponseDto"}}}},"400":{"description":"The body is not valid. `days` must have exactly 7 entries, one for each `dayOfWeek` from 0 to 6.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Set the organization working hours","tags":["Working Hours"]}},"/v1/working-hours/effective":{"get":{"description":"Returns the schedule that applies. With `employeeId`, that is the employee override when one exists, or else the organization schedule. Without `employeeId`, that is the organization schedule. `resolvedFrom` says which one you got.","operationId":"getEffectiveSchedule","parameters":[{"name":"employeeId","required":false,"in":"query","description":"The employee `id` (UUID). Omit it to get the organization schedule.","schema":{"type":"string"}}],"responses":{"200":{"description":"The schedule that applies, with `resolvedFrom` set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingHoursResponseDto"}}}},"400":{"description":"`employeeId` is not a UUID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"No schedule applies. Set the organization working hours first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get the effective working hours","tags":["Working Hours"]}},"/v1/working-hours/employees/{employeeId}":{"get":{"description":"Returns the schedule set for this employee only. It replaces the organization schedule for them.","operationId":"getEmployeeSchedule","parameters":[{"name":"employeeId","required":true,"in":"path","description":"The employee `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The employee override.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingHoursResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."},"404":{"description":"This employee has no override.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Get the working hours override of an employee","tags":["Working Hours"]},"put":{"description":"Replaces the full override for this employee. Send all 7 days.","operationId":"setEmployeeSchedule","parameters":[{"name":"employeeId","required":true,"in":"path","description":"The employee `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetWorkingHoursDto"}}}},"responses":{"200":{"description":"The new employee override.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingHoursResponseDto"}}}},"400":{"description":"The body is not valid. `days` must have exactly 7 entries, one for each `dayOfWeek` from 0 to 6.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Set the working hours override of an employee","tags":["Working Hours"]},"delete":{"description":"After this, the organization schedule applies to the employee again.","operationId":"deleteEmployeeSchedule","parameters":[{"name":"employeeId","required":true,"in":"path","description":"The employee `id` (UUID).","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"The override is deleted."},"401":{"description":"The API key is missing, or it is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponseDto"}}}},"403":{"description":"Too many requests from your IP address in the last 5 minutes. See Rate limits."}},"security":[{"bearer":[]},{"api-key":[]}],"summary":"Delete the working hours override of an employee","tags":["Working Hours"]}}},"info":{"title":"Drellia API","description":"## Overview\n\nThe Drellia API connects your systems to the two Drellia modules:\n\n- **Audit** — send conversations, Drellia evaluates them against your questionnaires, and you export the evaluations and conversations as CSV, TSV or XLSX.\n- **Voice Agents** — read your agents and campaigns, start calls, and give your voice agents tools they can call during a conversation.\n\nBoth modules use the same organization data: customers, employees, departments, working hours, and providers.\n\nAll paths in this reference include the `/v1` prefix. Send requests to the server for your environment.\n\n### Authentication\n\nEvery endpoint, except the health check, needs an API key. Send the key in one of these two ways:\n\n- the `x-api-key` header, or\n- the `Authorization: Bearer <key>` header.\n\nYour Drellia account manager gives you the key. The key is a secret. Do not put it in a URL, a log, an example, source control, or browser storage. Drellia shows the key only when it issues or rotates it.\n\nA request with no key, or with a key that is not valid, gets HTTP 401.\n\n### Identifiers\n\nEvery resource has an `id`. The `id` is a UUID. Some resources also have an `entityKey`, for example `AGT-A1B2C3`. The `entityKey` is shorter and easier to read. Where a path accepts an `entityKey`, the parameter description says so.\n\n### Pagination\n\nMost list endpoints accept the `page` and `pageSize` query parameters. The export runs list uses a cursor; its description says how. The first page is 1. The default page size is 50. The maximum page size is 1000.\n\nA list response has this shape:\n\n```json\n{ \"results\": [], \"total\": 0, \"page\": 1, \"pageSize\": 50 }\n```\n\n### Dates and times\n\nTimestamps are ISO 8601 strings in UTC, for example `2026-09-22T10:15:30.000Z`. The exception is `originalDateTime`. That field is a Unix time in milliseconds, because it comes from your own system.\n\n### Errors\n\nAn error response has an HTTP status of 400 or higher and this JSON body:\n\n```json\n{ \"statusCode\": 404, \"message\": \"Agent not found\", \"error\": \"Not Found\" }\n```\n\nFor a validation error (HTTP 400), `message` is an array with one line for each field that is not valid. The API rejects a request body that has a field it does not know.\n\nA successful delete returns HTTP 204 with no body.\n\n### Exports\n\nAn export makes a file in the background, so it takes three steps:\n\n1. **Start it.** Send `POST /v1/reports/evaluations-export` or `POST /v1/reports/conversations-export` with your filters and an `output`. `xlsx` puts each table on its own sheet. `csv`, `tsv` and `delimited` hold one table: set `grain` to the table you want, for example `{ \"format\": \"csv\", \"grain\": \"conversation\" }`. The response is HTTP 202 with the export run.\n2. **Wait for it.** While the run's `status` is `pending` or `running`, call `GET /v1/report-runs/{runId}` again after `retryAfterSeconds` (5 seconds). The run ends as `completed`, or as `failed` with the reason in `errorMessage`.\n3. **Download it.** Call `GET /v1/report-runs/{runId}/download`. It returns a URL that works for 15 minutes; get a new one after that. The file is kept for 7 days, until the run's `expiresOn`. After that the download answers HTTP 410: start a new export.\n\nExports are shared across your organization. `GET /v1/report-runs` lists the runs of every API key and of the users of the web app. If the same export, with the same filters and output, is already pending or running, starting it again answers HTTP 409 with `code` `REPORT_ALREADY_RUNNING` and that run in `run`. Follow that run instead of retrying.\n\nAn API key can have at most 5 exports pending or running. Above that, starting an export answers HTTP 429 with `code` `TOO_MANY_ACTIVE_REPORT_RUNS`. Wait for one to finish.\n\n### Rate limits\n\nThe API accepts up to 2,000 requests in each 5-minute window from one IP address. Above that, the API returns HTTP 403 until the window ends. Contact support if you need a higher limit.\n\n### Support\n\nFor API access or integration questions, write to [support@drellia.com](mailto:support@drellia.com).","version":"1.0","contact":{"name":"Drellia Engineering","url":"https://drellia.com","email":"contact@drellia.com"},"license":{"name":"Proprietary","url":"https://drellia.com/terms"}},"tags":[{"name":"Conversations","description":"Send conversations for audit, add their messages and events, and read the result."},{"name":"Questionnaires","description":"Manage the questionnaires that Drellia evaluates conversations against."},{"name":"Questions","description":"Manage the questions in a questionnaire."},{"name":"Reports","description":"Export evaluations and conversations as CSV, TSV or XLSX, and download the file."},{"name":"Agents","description":"Read your voice agents and start a call with one of them."},{"name":"Campaigns","description":"Read your campaigns, their call sessions, and start a campaign call."},{"name":"Agent Tools","description":"Endpoints a voice agent calls during a conversation: send an email, verify an identity, and compute values with your business rules."},{"name":"Interaction Context","description":"Store data about an interaction before a call, so the agent can use it during the call."},{"name":"Customers","description":"Manage the customers that conversations and calls refer to."},{"name":"Employees","description":"Manage the employees that take part in conversations."},{"name":"Departments","description":"Manage the departments of your organization."},{"name":"Working Hours","description":"Set the hours your organization and your employees work. Campaigns and evaluations use them."},{"name":"Providers","description":"Read the communication providers configured for your organization."},{"name":"Health","description":"Check that the API is up. No API key is needed."}],"servers":[{"url":"https://api.drellia.com","description":"Production"},{"url":"https://api.drellia-dev.com","description":"Development"}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your organization API key."},"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"The same API key, sent as a bearer token."}},"schemas":{"ApiErrorResponseDto":{"type":"object","properties":{"statusCode":{"type":"number","description":"The HTTP status code of the error.","example":404},"message":{"description":"What went wrong. A validation error (HTTP 400) returns one line for each field that is not valid.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"example":"Agent not found"},"error":{"type":"string","description":"The short name of the HTTP status.","example":"Not Found"}},"required":["statusCode","message"]},"AgentConfigResponseDto":{"type":"object","properties":{"language":{"type":"string","description":"The language the agent speaks, as a language code.","example":"es"},"prompt":{"type":"string","description":"The system prompt: the instructions the agent follows."},"greeting":{"type":"string","description":"The first sentence the agent says when the call starts. Its placeholders are substituted like in the prompt.","example":"Hello, this is Ana from Drellia. Am I speaking with {{customer.first_name}}?"},"greetingDelayMs":{"type":"number","description":"Milliseconds the agent waits before the greeting.","example":0},"llm":{"type":"string","description":"The language model the agent uses.","example":"gpt-4o"},"temperature":{"type":"number","description":"How creative the model is. 0 is the most predictable.","example":0.7},"voiceId":{"type":"string","description":"The `id` of the text-to-speech voice."},"voiceModel":{"type":"string","description":"The text-to-speech model."},"conversationProvider":{"type":"string","description":"Which engine runs the conversation. `null`: Drellia. `elevenlabs_agents`: ElevenLabs Agents.","nullable":true},"dynamicVariablesSchema":{"type":"object","description":"The dynamic variables sent to an external conversation engine, as a map of variable name to template. Empty for a new agent.","additionalProperties":{"type":"string"},"example":{"contact_name":"{{ customer.firstName }}"}},"speed":{"type":"number","description":"How fast the agent speaks. 1 is normal speed.","example":1},"turnEagerness":{"type":"string","description":"How soon the agent takes its turn once the caller pauses.","enum":["patient","normal","eager"],"example":"normal"},"turnTimeoutSeconds":{"type":"number","description":"Seconds of caller silence before the agent follows up.","example":8}},"required":["language","prompt","greetingDelayMs","llm","temperature","dynamicVariablesSchema","speed","turnEagerness","turnTimeoutSeconds"]},"AgentCapabilitiesDto":{"type":"object","properties":{"takeover":{"type":"boolean","description":"Whether an operator can take over the live calls of the agent. `false` when an external conversation platform runs the agent.","example":true},"tools":{"description":"The names of the tools the agent can use during a call.","example":["end_call","send_email"],"type":"array","items":{"type":"string"}},"promptSync":{"type":"string","description":"Whether the calls of the agent run the prompt and greeting Drellia renders. `always`: Drellia runs the agent. `applied`: the external platform accepted them on the latest reported call. `blocked`: it refused a part, see `promptSyncRefused`. `unavailable`: Drellia could not read the external agent, so it sent nothing. `unknown`: no call reported it since the agent was bound.","enum":["always","applied","blocked","unavailable","unknown"],"example":"applied"},"promptSyncRefused":{"type":"array","description":"The parts the external platform refused. Only when `promptSync` is `blocked`.","example":["first_message"],"items":{"type":"string","enum":["prompt","first_message"]}}},"required":["takeover","tools","promptSync"]},"AgentResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"The agent `id`.","example":"550e8400-e29b-41d4-a716-446655440000"},"entityKey":{"type":"string","description":"The short key of the agent. Agent paths accept it in place of `id`.","example":"AGT-A1B2C3"},"name":{"type":"string","description":"The name of the agent.","example":"Ana - Collections"},"providerId":{"type":"string","description":"The `id` of the provider the agent runs on."},"externalId":{"type":"string","description":"The `id` of the agent in the provider platform."},"departmentId":{"type":"string","description":"The `id` of the department the agent belongs to."},"status":{"type":"string","description":"The status. `ACTIVE`: can take calls. `PAUSED`: does not take calls. `DRAFT`: not ready. `ARCHIVED`: no longer in use.","enum":["ACTIVE","PAUSED","DRAFT","ARCHIVED"],"example":"ACTIVE"},"phoneNumber":{"type":"string","description":"The phone number that rings this agent for inbound calls. `null` when there is none.","nullable":true,"example":"+34910000000"},"createdOn":{"format":"date-time","type":"string","description":"When the agent was created."},"updatedOn":{"format":"date-time","type":"string","description":"When the agent was last changed."},"config":{"description":"The configuration of the agent.","allOf":[{"$ref":"#/components/schemas/AgentConfigResponseDto"}]},"contextValues":{"type":"object","description":"The values the agent gives to call context fields, as a map of field key to value. Empty when the agent sets none.","additionalProperties":{"type":"string"},"example":{"payment_methods":"Bank transfer or card"}},"capabilities":{"description":"What the agent supports on its calls.","allOf":[{"$ref":"#/components/schemas/AgentCapabilitiesDto"}]},"placeholderWarnings":{"description":"Placeholders in the prompt or the greeting of the external agent that nothing fills: not `dynamicVariablesSchema`, and not Drellia at call time. Only a warning. Absent when Drellia could not read the external agent.","example":["contact_name"],"type":"array","items":{"type":"string"}}},"required":["id","entityKey","name","status","createdOn","updatedOn","config","capabilities"]},"AgentsListResponseDto":{"type":"object","properties":{"page":{"type":"number","description":"The page you got.","example":1},"pageSize":{"type":"number","description":"The number of items in each page.","example":50},"total":{"type":"number","description":"The total number of agents.","example":4},"results":{"description":"The agents in this page.","type":"array","items":{"$ref":"#/components/schemas/AgentResponseDto"}}},"required":["page","pageSize","total","results"]},"TriggerCallDto":{"type":"object","properties":{"customerId":{"type":"string","description":"The `id` of the customer to call. Drellia takes the phone number from the customer record. Only the internal API uses this field. The public API calls `phoneNumber`. Send one of `customerId` and `phoneNumber`, not both.","example":"550e8400-e29b-41d4-a716-446655440000"},"phoneNumber":{"type":"string","description":"The phone number to call, with the country code. The voice gateway validates the format and also accepts short internal extensions. Send one of `customerId` and `phoneNumber`, not both.","example":"+1234567890","maxLength":50},"fromNumber":{"type":"string","description":"The number the customer sees as the caller. Default: the number of the provider.","example":"+34910000000","maxLength":50},"mode":{"type":"string","description":"Who talks to the customer. `agent`: the AI agent. `human`: an operator in the web app, with no AI. Default: `agent`. The public API accepts `agent` only.","enum":["agent","human"],"default":"agent"},"telephonyProviderId":{"type":"string","description":"The `id` of the telephony provider to call through. It must belong to your organization. Default: the default provider of your organization.","example":"550e8400-e29b-41d4-a716-446655440000"},"campaignContactId":{"type":"string","description":"The campaign contact to call, previewed on the operator desk. Only the internal API uses this field. Send it without `customerId` and `phoneNumber`: Drellia takes both from the contact. The telephony provider of its campaign, when set, wins over `telephonyProviderId`.","format":"uuid"}}},"TriggerCallResponseDto":{"type":"object","properties":{"sessionId":{"type":"string","description":"The `id` of the call session. Use it to find the session in the sessions list.","example":"550e8400-e29b-41d4-a716-446655440000"},"callId":{"type":"string","description":"The `id` of the call in the voice gateway.","example":"6f1c2d3e-4b5a-4c6d-8e7f-90a1b2c3d4e5"},"status":{"type":"string","description":"The status of the call when it was started.","example":"initiated"}},"required":["sessionId","callId","status"]},"CampaignGuardrailsDto":{"type":"object","properties":{"maxCallDurationSeconds":{"type":"number","description":"Maximum call duration in seconds","example":300},"transferPhoneNumber":{"type":"string","description":"Number to transfer to when the customer asks for a person"},"recordingEnabled":{"type":"boolean","description":"Record & transcribe calls"}}},"BreakDto":{"type":"object","properties":{"startTime":{"type":"string","description":"When the break starts, as `HH:mm` (24-hour clock).","example":"12:00"},"endTime":{"type":"string","description":"When the break ends, as `HH:mm` (24-hour clock).","example":"13:00"}},"required":["startTime","endTime"]},"WorkingHoursDayDto":{"type":"object","properties":{"dayOfWeek":{"type":"number","description":"The day of the week. 0 is Sunday, 1 is Monday, and 6 is Saturday.","minimum":0,"maximum":6,"example":1},"startTime":{"type":"string","description":"When work starts, as `HH:mm` (24-hour clock).","example":"09:00"},"endTime":{"type":"string","description":"When work ends, as `HH:mm` (24-hour clock).","example":"17:00"},"isEnabled":{"type":"boolean","description":"Whether this is a working day. Send `false` for a day off.","example":true},"breaks":{"description":"Breaks inside the working hours, for example lunch.","type":"array","items":{"$ref":"#/components/schemas/BreakDto"}}},"required":["dayOfWeek","startTime","endTime","isEnabled"]},"CampaignWorkingHoursDto":{"type":"object","properties":{"source":{"type":"string","description":"Where calling hours come from: the organization's working-hours schedule (resolved at dial time) or a custom per-campaign schedule","enum":["organization","custom"]},"days":{"description":"Per-day calling windows; required when source is 'custom'","type":"array","items":{"$ref":"#/components/schemas/WorkingHoursDayDto"}}},"required":["source"]},"CampaignScheduleDto":{"type":"object","properties":{"mode":{"type":"string","description":"When calls go out","enum":["immediate","one_time","recurring"]},"startDate":{"type":"string","description":"Start date (YYYY-MM-DD); required for one_time"},"time":{"type":"string","description":"Start time (HH:mm) in the campaign timezone"},"timezone":{"type":"string","description":"IANA timezone name the wall-clock values (time, working hours) are read in; required whenever the schedule carries a start time or working hours","example":"America/Panama"},"daysOfWeek":{"description":"ISO weekdays the campaign runs on (1 = Monday … 7 = Sunday); recurring only","type":"array","items":{"type":"number"}},"workingHours":{"description":"Per-weekday calling hours (org default or campaign-specific); unset = unrestricted","allOf":[{"$ref":"#/components/schemas/CampaignWorkingHoursDto"}]}},"required":["mode"]},"CampaignPacingDto":{"type":"object","properties":{"maxConcurrentCalls":{"type":"number","description":"The campaign's own cap on calls in progress at once; null or absent means the most its telephony provider allows. Must not exceed that limit.","example":3,"nullable":true,"minimum":1},"retryAttempts":{"type":"number","description":"Retry attempts per contact","enum":[0,2,3,5]},"retryWaitMinutes":{"type":"number","description":"Wait between retries in minutes","enum":[60,240,1440]},"retryOn":{"type":"string","description":"Which outcomes trigger a retry","enum":["no_answer_busy","no_answer","any_failure"]}},"required":["retryAttempts","retryWaitMinutes","retryOn"]},"CampaignOutcomeResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Outcome ID"},"code":{"type":"string","description":"Stable outcome code"},"label":{"type":"string","description":"Human-readable outcome label"},"description":{"type":"string","description":"What this outcome means"},"displayOrder":{"type":"number","description":"Display order"},"categoryId":{"type":"object","description":"Category this outcome is grouped under"}},"required":["id","code","label","displayOrder"]},"CampaignSourceFileColumnMappingDto":{"type":"object","properties":{"sourceColumn":{"type":"string","description":"Source file column header","maxLength":255},"targetField":{"type":"string","description":"Contact field the column was mapped to (or 'skip' if ignored)","maxLength":255},"autoDetected":{"type":"boolean","description":"Whether the mapping was auto-suggested rather than chosen by the user"}},"required":["sourceColumn","targetField"]},"CampaignSourceFileResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Source file record ID","format":"uuid"},"fileName":{"type":"string","description":"Original file name"},"fileSize":{"type":"number","description":"File size in bytes"},"contentType":{"type":"string","description":"MIME type of the file"},"uploadStatus":{"type":"string","description":"Upload lifecycle status"},"columnMapping":{"description":"How each column of the file was mapped onto contact fields","type":"array","items":{"$ref":"#/components/schemas/CampaignSourceFileColumnMappingDto"}},"createdOn":{"format":"date-time","type":"string","description":"When the file was uploaded"}},"required":["id","fileName","fileSize","contentType","uploadStatus","columnMapping","createdOn"]},"CampaignResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Campaign ID"},"entityKey":{"type":"string","description":"The short key of the campaign, as shown in the web app. On the public API, use `id`.","example":"CAM-A1B2C3"},"name":{"type":"string","description":"The name of the campaign.","example":"September collections"},"description":{"type":"string","description":"Campaign description"},"status":{"type":"string","description":"Campaign status","enum":["DRAFT","SCHEDULED","ACTIVE","PAUSED","COMPLETED","STOPPED"]},"agentId":{"type":"string","description":"The AI agent; null on a campaign a queue handles","nullable":true},"handler":{"type":"string","description":"Who dials the contacts","enum":["AGENT","QUEUE"]},"queueId":{"type":"string","description":"The operator queue of a QUEUE campaign","nullable":true},"dialMode":{"type":"string","description":"How the campaign dials","enum":["AUTO","PREVIEW","PROGRESSIVE"]},"agent":{"description":"Agent details","allOf":[{"$ref":"#/components/schemas/AgentResponseDto"}]},"type":{"type":"string","description":"Audience source type","enum":["static"]},"tags":{"description":"Tags for filtering","type":"array","items":{"type":"string"}},"voiceId":{"type":"string","description":"Voice ID override for this campaign"},"telephonyProviderId":{"type":"string","description":"Telephony provider used to dial this campaign"},"campaignPrompt":{"type":"string","description":"Extra instructions layered on top of the agent’s base behavior"},"contextValues":{"type":"object","description":"The values the campaign gives to call context fields, as a map of field key to value. Empty when the campaign sets none.","additionalProperties":{"type":"string"},"example":{"creditor":"EOS SPAIN S.L.U."}},"guardrails":{"description":"Call guardrails","allOf":[{"$ref":"#/components/schemas/CampaignGuardrailsDto"}]},"voicemailAction":{"type":"string","description":"What the agent does on voicemail","enum":["HANG_UP","LEAVE_MESSAGE"]},"voicemailMessage":{"type":"string","description":"The message left after the voicemail beep; its placeholders are filled","nullable":true},"schedule":{"description":"Schedule configuration","allOf":[{"$ref":"#/components/schemas/CampaignScheduleDto"}]},"pacing":{"description":"Pacing & retry configuration","allOf":[{"$ref":"#/components/schemas/CampaignPacingDto"}]},"template":{"type":"string","description":"Wizard template this campaign started from"},"campaignTemplateId":{"type":"string","description":"The campaign template the campaign uses; null when it uses none","nullable":true},"campaignTemplateVersion":{"type":"number","description":"The template's published version the campaign pins; null when it uses none","nullable":true,"example":3},"nextRunOn":{"format":"date-time","type":"string","description":"Next scheduled run (display only; engine deferred)"},"lastRunOn":{"format":"date-time","type":"string","description":"Last time the campaign was launched"},"contactCount":{"type":"number","description":"Number of imported contacts"},"completedCallCount":{"type":"number","description":"Contacts whose dialing is over (completed, no-answer, failed or excluded)"},"attemptedContactCount":{"type":"number","description":"Contacts dialed at least once, whatever the call result"},"outcomes":{"description":"Possible call outcomes (outcomes); populated on single-campaign reads","type":"array","items":{"$ref":"#/components/schemas/CampaignOutcomeResponseDto"}},"sourceFile":{"description":"Most recently uploaded contacts file and its column mapping, if contacts were imported from a file; populated on single-campaign reads","allOf":[{"$ref":"#/components/schemas/CampaignSourceFileResponseDto"}]},"createdBy":{"type":"string","description":"Who created the campaign, as stored: a user id, or the name of the system process that did it. Absent for campaigns that predate creator attribution."},"createdOn":{"format":"date-time","type":"string","description":"Creation date"},"updatedOn":{"format":"date-time","type":"string","description":"Last update date"}},"required":["id","entityKey","name","status","agentId","handler","queueId","dialMode","type","tags","campaignTemplateId","campaignTemplateVersion","createdOn","updatedOn"]},"CampaignsListResponseDto":{"type":"object","properties":{"page":{"type":"number","description":"The page you got.","example":1},"pageSize":{"type":"number","description":"The number of items in each page.","example":50},"total":{"type":"number","description":"The total number of campaigns.","example":12},"results":{"description":"The campaigns in this page.","type":"array","items":{"$ref":"#/components/schemas/CampaignResponseDto"}}},"required":["page","pageSize","total","results"]},"ProviderErrorDto":{"type":"object","properties":{"code":{"type":"string","description":"Vendor-neutral failure code","example":"NO_ROUTE_DESTINATION"},"message":{"type":"string","description":"English fallback copy for the code; null when none is defined","nullable":true,"example":"No route to this destination — check the number or carrier configuration"}},"required":["code"]},"CustomerResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"The customer `id`.","example":"550e8400-e29b-41d4-a716-446655440000"},"externalId":{"type":"string","description":"The identifier of the customer in your own system.","example":"EXT-001"},"email":{"type":"string","description":"The email address.","example":"john.doe@example.com"},"firstName":{"type":"string","description":"The first name.","example":"John"},"lastName":{"type":"string","description":"The last name.","example":"Doe"},"identificationNumber":{"type":"string","description":"The identification number of the customer.","example":"ID-12345"},"phoneNumber":{"type":"string","description":"The phone number.","example":"+1234567890"},"createdOn":{"format":"date-time","type":"string","description":"When the customer was created."},"updatedOn":{"format":"date-time","type":"string","description":"When the customer was last changed."},"stageId":{"type":"string","description":"The `id` of the stage the customer is in now (GET /customer-stages); null for no stage. Change it with POST /customers/{customerId}/stage-changes.","format":"uuid","nullable":true},"stageName":{"type":"string","description":"The name of the current stage, also for a stage deactivated since.","example":"Renewing","nullable":true},"metadata":{"type":"object","description":"Extra facts about the customer, as text values.","example":{"tier":"premium","source":"web"},"additionalProperties":{"type":"string"}}},"required":["id","email","firstName","lastName","createdOn","updatedOn","stageId","stageName","metadata"]},"SessionEmployeeResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Employee ID"},"firstName":{"type":"string","description":"Employee first name"},"lastName":{"type":"string","description":"Employee last name"}},"required":["id","firstName","lastName"]},"SessionOutcomeResponseDto":{"type":"object","properties":{"outcomeId":{"type":"object","description":"Catalog outcome the call is recorded with; null when none, or when the catalog row was retired","nullable":true},"outcomeCode":{"type":"object","description":"Outcome code snapshotted when the outcome was recorded"},"outcomeLabel":{"type":"object","description":"Human-readable label from the organization's catalog; falls back to the code"},"categoryName":{"type":"object","description":"Category the outcome is grouped under"},"source":{"type":"string","description":"Who determined the outcome","enum":["ai_agent","human","system"]},"systemKey":{"type":"string","description":"For a system-assigned outcome, the platform slot the call ended on (why it was assigned); null otherwise","enum":["hangup","no_answer","unreachable","voicemail","failed","wrong_number"],"nullable":true},"followUpAt":{"type":"object","description":"When the customer agreed to be contacted again"},"notes":{"type":"object","description":"Free-text notes attached to the outcome","nullable":true},"data":{"type":"object","description":"Scenario-specific values captured by the agent, opaque to the platform"},"updatedOn":{"format":"date-time","type":"string","description":"When the outcome was last recorded or corrected"}},"required":["source","data"]},"SessionResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Session ID"},"entityKey":{"type":"string","description":"The short key of the call session, as shown in the web app. On the public API, use `id`.","example":"CAL-A1B2C3"},"externalId":{"type":"string","description":"External call ID"},"conversationId":{"type":"string","description":"Linked conversation ID"},"agentId":{"type":"object","description":"Agent ID — null on human-mode calls, which carry an employee instead","nullable":true},"employeeId":{"type":"object","description":"Employee ID — set on human-mode calls placed by a staff member, null otherwise","nullable":true},"mode":{"type":"string","description":"Who talked to the customer: \"agent\" (the AI) or \"human\" (an operator speaking from the browser)","enum":["agent","human"]},"customerId":{"type":"string","description":"Customer identifier"},"customerName":{"type":"string","description":"The imported contact's name, resolved for campaign session listings"},"departmentIds":{"description":"Department IDs touched during the call","type":"array","items":{"type":"string"}},"createdOn":{"format":"date-time","type":"string","description":"Creation date"},"updatedOn":{"format":"date-time","type":"string","description":"Last update date"},"startedOn":{"format":"date-time","type":"string","description":"Call start time"},"endedOn":{"format":"date-time","type":"string","description":"Call end time"},"phoneNumber":{"type":"string","description":"Dialed phone number"},"duration":{"type":"number","description":"Call duration in seconds"},"status":{"type":"string","description":"Call status","enum":["INITIATED","RINGING","IN_PROGRESS","COMPLETED","FAILED","NO_ANSWER"]},"endReason":{"type":"string","description":"Reason the call ended","enum":["CLIENT_NAVIGATED_AWAY","AGENT_ENDED","CLIENT_ENDED","TIMEOUT","ERROR","VOICEMAIL_DETECTED","TRANSFERRED","CALL_REJECTED"]},"providerError":{"description":"Why the call failed. Absent unless the call failed with a cause the platform can vouch for — `endReason` says the call errored, this says what went wrong.","allOf":[{"$ref":"#/components/schemas/ProviderErrorDto"}]},"audioUrl":{"type":"string","description":"Audio recording URL"},"campaignId":{"type":"string","description":"Campaign ID"},"direction":{"type":"string","description":"Call direction","enum":["inbound","outbound","demo"]},"customer":{"description":"Resolved customer (only present when requested via `?include=customer`)","allOf":[{"$ref":"#/components/schemas/CustomerResponseDto"}]},"agent":{"description":"Resolved agent (only present when requested via `?include=agent`)","allOf":[{"$ref":"#/components/schemas/AgentResponseDto"}]},"employee":{"description":"Resolved employee who placed a human-mode call (only present when requested via `?include=employee`)","allOf":[{"$ref":"#/components/schemas/SessionEmployeeResponseDto"}]},"campaign":{"description":"Resolved campaign (only present when requested via `?include=campaign`)","allOf":[{"$ref":"#/components/schemas/CampaignResponseDto"}]},"outcome":{"description":"The call's recorded business outcome (only present when requested via `?include=outcome`); null when requested but the call has none","allOf":[{"$ref":"#/components/schemas/SessionOutcomeResponseDto"}]},"summary":{"type":"object","description":"Short plain-text summary of the call, written from the transcript after the call ends. Only on the detail, when requested via `?include=summary`; null until written.","nullable":true},"summarizedAt":{"format":"date-time","type":"string","description":"When the summary was written (only present when requested via `?include=summary`)","nullable":true}},"required":["id","entityKey","departmentIds","createdOn","updatedOn","status","direction"]},"SessionsListResponseDto":{"type":"object","properties":{"page":{"type":"number","description":"The page you got.","example":1},"pageSize":{"type":"number","description":"The number of items in each page.","example":50},"total":{"type":"number","description":"The number of sessions. A list that caps its count says so with `totalCapped`. Null on a page you got with `cursor`.","example":100,"nullable":true},"totalCapped":{"type":"boolean","description":"True when there are more sessions than `total`.","example":false},"nextCursor":{"type":"string","description":"Send this value as `cursor` to get the next page. Null on the last page.","nullable":true},"results":{"description":"The sessions in this page.","type":"array","items":{"$ref":"#/components/schemas/SessionResponseDto"}}},"required":["page","pageSize","total","totalCapped","nextCursor","results"]},"DiscountedAmountRequestDto":{"type":"object","properties":{"totalAmount":{"type":"number","description":"The amount before any discount.","example":100,"minimum":0},"discounts":{"description":"The discounts to apply, as percentages from 0 to 100. Required when you do not send `minDiscount` and `maxDiscount`. Ignored when you send the pair.","example":[10,15,20],"type":"array","items":{"type":"number"}},"minDiscount":{"type":"number","description":"The smallest discount of a range, as a percentage. Send it together with `maxDiscount`. The pair wins over `discounts`.","example":10,"minimum":0,"maximum":100},"maxDiscount":{"type":"number","description":"The largest discount of a range, as a percentage. Send it together with `minDiscount`. The pair wins over `discounts`.","example":40,"minimum":0,"maximum":100}},"required":["totalAmount"]},"DiscountedAmountResponseDto":{"type":"object","properties":{"discount":{"type":"number","description":"The discount applied, as a percentage.","example":15},"discountedAmount":{"type":"number","description":"The amount after the discount, rounded to 2 decimals.","example":85}},"required":["discount","discountedAmount"]},"PaymentDatesResponseDto":{"type":"object","properties":{"minDate":{"type":"string","description":"The earliest allowed payment date, as `YYYY-MM-DD`. This is today.","example":"2026-07-02"},"maxDate":{"type":"string","description":"The latest allowed payment date, as `YYYY-MM-DD`. Your payment rules set how far ahead it is.","example":"2026-08-31"},"today":{"type":"string","description":"Today, as `YYYY-MM-DD`, in the organization time zone.","example":"2026-07-02"},"timezone":{"type":"string","description":"The IANA time zone the dates are in.","example":"America/Argentina/Buenos_Aires"}},"required":["minDate","maxDate","today","timezone"]},"CreateQuestionDto":{"type":"object","properties":{"title":{"type":"string","description":"The question, as Drellia must answer it.","example":"Did the employee greet the customer by name?","minLength":2,"maxLength":255},"description":{"type":"string","description":"More detail on how to answer the question.","example":"Any use of the first name or the last name counts.","maxLength":1000},"questionnaireId":{"type":"string","description":"The `id` of the questionnaire to add the question to.","example":"550e8400-e29b-41d4-a716-446655440000"},"allowedAnswers":{"description":"The possible answers, for an `options` question.","example":["yes","no","not applicable"],"type":"array","items":{"type":"string"}},"type":{"type":"string","description":"The kind of answer. `boolean`: yes or no. `options`: one of `allowedAnswers`. `text`: free text.","enum":["boolean","options","text"],"example":"options"},"alertTypeId":{"type":"string","description":"The `id` of the alert type to raise when the answer is not compliant.","example":"550e8400-e29b-41d4-a716-446655440000"},"compliantAnswer":{"type":"string","description":"The answer that means the employee did the right thing.","example":"yes","maxLength":255},"compliantAnswers":{"description":"All the answers that mean the employee did the right thing. When you send both, this list wins over `compliantAnswer`.","example":["yes","not applicable"],"type":"array","items":{"type":"string"}},"complianceControl":{"type":"string","description":"The compliance control the answers are evidence for, as `<framework>.<control>` (see `GET /compliance/frameworks`). Send `null` to clear it.","enum":["ley_10_2025.human_on_request","ley_10_2025.time_to_human","ley_10_2025.automated_agent_identified","ley_10_2025.recording_notice","eu_ai_act_art50.ai_disclosure","pci_dss.card_data_not_requested","pci_dss.card_data_not_spoken"],"nullable":true,"example":"ley_10_2025.human_on_request"},"metadata":{"type":"object","description":"Extra data of your own. Drellia stores it and returns it as is.","additionalProperties":true}},"required":["title","questionnaireId","type"]},"QuestionDto":{"type":"object","properties":{"id":{"type":"string","description":"The question `id`.","example":"550e8400-e29b-41d4-a716-446655440000"},"title":{"type":"string","description":"The question, as Drellia answers it.","example":"Did the employee greet the customer by name?"},"description":{"type":"string","description":"More detail on how to answer the question.","example":"Any use of the first name or the last name counts."},"questionnaireId":{"type":"string","description":"The `id` of the questionnaire the question is in.","example":"550e8400-e29b-41d4-a716-446655440000"},"allowedAnswers":{"description":"The possible answers, for an `options` question.","example":["yes","no","not applicable"],"type":"array","items":{"type":"string"}},"type":{"type":"string","description":"The kind of answer. `boolean`: yes or no. `options`: one of `allowedAnswers`. `text`: free text.","enum":["boolean","options","text"],"example":"options"},"alertTypeId":{"type":"string","description":"The `id` of the alert type raised when the answer is not compliant.","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"compliantAnswer":{"type":"string","description":"The answer that means the employee did the right thing.","example":"yes"},"compliantAnswers":{"description":"All the answers that mean the employee did the right thing. When you send both, this list wins over `compliantAnswer`.","example":["yes","not applicable"],"type":"array","items":{"type":"string"}},"complianceControl":{"type":"string","description":"The compliance control the answers are evidence for, as `<framework>.<control>` (see `GET /compliance/frameworks`). Send `null` to clear it.","nullable":true,"example":"ley_10_2025.human_on_request"},"createdOn":{"format":"date-time","type":"string","description":"When the question was created."},"updatedOn":{"format":"date-time","type":"string","description":"When the question was last changed."},"answerCount":{"type":"number","description":"The number of answers recorded for this question.","example":120},"questionnaireName":{"type":"string","description":"The name of the questionnaire the question is in.","example":"Customer service quality"},"thumbsUpCount":{"type":"number","description":"The number of times a reviewer marked an answer as correct.","example":12},"thumbsDownCount":{"type":"number","description":"The number of times a reviewer marked an answer as wrong.","example":3},"feedbackBalance":{"type":"number","description":"`thumbsUpCount` minus `thumbsDownCount`. A negative value means more wrong answers.","example":9},"needsFeedbackReview":{"type":"boolean","description":"Whether the question needs a review, because of the feedback it got.","example":false}},"required":["id","title","questionnaireId","type","createdOn","updatedOn"]},"QuestionResponseDto":{"type":"object","properties":{"page":{"type":"number","description":"The page you got.","example":1},"pageSize":{"type":"number","description":"The number of items in each page.","example":50},"total":{"type":"number","description":"The total number of questions.","example":45},"results":{"description":"The questions in this page.","type":"array","items":{"$ref":"#/components/schemas/QuestionDto"}}},"required":["page","pageSize","total","results"]},"UpdateQuestionDto":{"type":"object","properties":{"title":{"type":"string","description":"The question, as Drellia must answer it.","example":"Did the employee greet the customer by name?","minLength":2,"maxLength":255},"description":{"type":"string","description":"More detail on how to answer the question.","example":"Any use of the first name or the last name counts.","maxLength":1000},"allowedAnswers":{"description":"The possible answers, for an `options` question.","example":["yes","no","not applicable"],"type":"array","items":{"type":"string"}},"type":{"type":"string","description":"The kind of answer. `boolean`: yes or no. `options`: one of `allowedAnswers`. `text`: free text.","enum":["boolean","options","text"],"example":"options"},"alertTypeId":{"type":"string","description":"The `id` of the alert type to raise when the answer is not compliant; `null` removes it.","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"compliantAnswer":{"type":"string","description":"The answer that means the employee did the right thing.","example":"yes","maxLength":255},"compliantAnswers":{"description":"All the answers that mean the employee did the right thing. When you send both, this list wins over `compliantAnswer`.","example":["yes","not applicable"],"type":"array","items":{"type":"string"}},"complianceControl":{"type":"string","description":"The compliance control the answers are evidence for, as `<framework>.<control>` (see `GET /compliance/frameworks`). Send `null` to clear it.","enum":["ley_10_2025.human_on_request","ley_10_2025.time_to_human","ley_10_2025.automated_agent_identified","ley_10_2025.recording_notice","eu_ai_act_art50.ai_disclosure","pci_dss.card_data_not_requested","pci_dss.card_data_not_spoken"],"nullable":true,"example":"ley_10_2025.human_on_request"},"metadata":{"type":"object","description":"Extra data of your own. Drellia stores it and returns it as is.","additionalProperties":true}}},"QuestionStatsResponseDto":{"type":"object","properties":{"totalAnswers":{"type":"number","description":"The number of answers recorded for this question.","example":120},"uniqueEmployees":{"type":"number","description":"The number of different employees with an answer.","example":25},"questionnaireName":{"type":"string","description":"The name of the questionnaire the question is in.","example":"Customer service quality"},"alertLevel":{"type":"string","description":"The level of the linked alert type, when there is one.","example":"high"}},"required":["totalAnswers","uniqueEmployees","questionnaireName"]},"CreateEmployeeDto":{"type":"object","properties":{"routingMinConfidence":{"type":"number","description":"Minimum confidence for work type detection, on a scale from 0 to 1. Defaults to 0.60.","default":0.6,"minimum":0,"maximum":1},"includeDepartmentQuestionnaires":{"type":"boolean","description":"Include eligible department questionnaires when work types are assigned.","default":true},"firstName":{"type":"string","description":"The first name.","example":"John","minLength":1,"maxLength":100},"lastName":{"type":"string","description":"The last name.","example":"Doe","minLength":1,"maxLength":100},"externalId":{"type":"string","description":"The identifier of the employee in your own system.","example":"EMP-001","minLength":1,"maxLength":100,"nullable":true},"skills":{"description":"The skills of the employee.","example":["sales","support"],"type":"array","items":{"type":"string"}},"departmentId":{"type":"string","description":"The `id` of the department to put the employee in.","example":"550e8400-e29b-41d4-a716-446655440000"},"userId":{"type":"string","description":"The `id` of the Drellia user to link to this employee.","example":"550e8400-e29b-41d4-a716-446655440000"}},"required":["firstName","lastName"]},"EmployeeWorkTypeDto":{"type":"object","properties":{"id":{"type":"string","description":"Assignment UUID."},"employeeId":{"type":"string","description":"Employee UUID."},"workTypeId":{"type":"string","description":"Work type UUID."},"position":{"type":"number","description":"Position in the employee detection order. The first position is 1.","minimum":1}},"required":["id","employeeId","workTypeId","position"]},"EmployeeDto":{"type":"object","properties":{"workTypes":{"description":"Ordered live work type assignments, included on employee detail reads.","type":"array","items":{"$ref":"#/components/schemas/EmployeeWorkTypeDto"}},"routingMinConfidence":{"type":"number","description":"Minimum confidence for work type detection.","minimum":0,"maximum":1,"default":0.6},"includeDepartmentQuestionnaires":{"type":"boolean","description":"Include eligible department questionnaires when work types are assigned.","default":true},"id":{"type":"string","description":"The employee `id`.","example":"550e8400-e29b-41d4-a716-446655440000"},"entityKey":{"type":"string","description":"The short key of the employee. `id` stays the identifier to use.","example":"EMP-A1B2C3"},"externalId":{"type":"string","description":"The identifier of the employee in your own system.","example":"EMP-001"},"firstName":{"type":"string","description":"The first name.","example":"John"},"lastName":{"type":"string","description":"The last name.","example":"Doe"},"skills":{"description":"The skills of the employee.","example":["sales","support"],"type":"array","items":{"type":"string"}},"createdOn":{"format":"date-time","type":"string","description":"When the employee was created."},"updatedOn":{"format":"date-time","type":"string","description":"When the employee was last changed."},"deletedOn":{"type":"object","description":"When the employee was deleted. `null` when the employee is active.","nullable":true},"timezone":{"type":"object","description":"The IANA time zone of the employee, when it is not the organization time zone.","example":"Europe/London","nullable":true},"departmentId":{"type":"string","description":"The `id` of the primary department.","example":"550e8400-e29b-41d4-a716-446655440000"},"departments":{"description":"The `id` of each department the employee is in.","type":"array","items":{"type":"string"}},"userId":{"type":"object","description":"The `id` of the Drellia user linked to this employee. `null` when there is none.","nullable":true}},"required":["routingMinConfidence","includeDepartmentQuestionnaires","id","firstName","lastName","createdOn","updatedOn"]},"EmployeeResponseDto":{"type":"object","properties":{"page":{"type":"number","description":"The page you got.","example":1},"pageSize":{"type":"number","description":"The number of items in each page.","example":50},"total":{"type":"number","description":"The total number of employees.","example":42},"results":{"description":"The employees in this page.","type":"array","items":{"$ref":"#/components/schemas/EmployeeDto"}}},"required":["page","pageSize","total","results"]},"UpdateEmployeeDto":{"type":"object","properties":{"externalId":{"type":"string","description":"The identifier of the employee in your own system. Send it to assign or replace the external ID, or send null to clear it. It must be unique among live employees in your organization.","example":"EMP-001","minLength":1,"maxLength":100,"nullable":true},"routingMinConfidence":{"type":"number","description":"Minimum confidence for work type detection, on a scale from 0 to 1. Defaults to 0.60.","default":0.6,"minimum":0,"maximum":1},"includeDepartmentQuestionnaires":{"type":"boolean","description":"Include eligible department questionnaires when work types are assigned.","default":true},"firstName":{"type":"string","description":"The first name.","example":"John","minLength":1,"maxLength":100},"lastName":{"type":"string","description":"The last name.","example":"Doe","minLength":1,"maxLength":100},"skills":{"description":"The skills of the employee. The list you send replaces the old list.","example":["sales","support"],"type":"array","items":{"type":"string"}},"departmentId":{"type":"string","description":"The `id` of the primary department.","example":"550e8400-e29b-41d4-a716-446655440000"},"timezone":{"type":"string","description":"The IANA time zone of the employee.","example":"Europe/London"},"userId":{"type":"string","description":"The `id` of the Drellia user to link to this employee. Send `null` to unlink.","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true}}},"EmployeeStatsResponseDto":{"type":"object","properties":{"totalConversations":{"type":"number","description":"The number of conversations of the employee.","example":150},"totalAnswers":{"type":"number","description":"The number of answers recorded for the employee.","example":500},"teamsCount":{"type":"number","description":"The number of teams the employee is in.","example":3},"providersCount":{"type":"number","description":"The number of providers the employee uses.","example":2}},"required":["totalConversations","totalAnswers","teamsCount","providersCount"]},"CreateDepartmentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the department.","example":"Billing"},"externalId":{"type":"string","description":"The id of the department in your system, unique among your departments. It is also the folder you deliver its calls to over SFTP (`calls/<externalId>/`). Up to 100 characters: letters, digits and `. _ -`, starting with a letter or digit.","example":"MERCADOLIBRE"},"description":{"type":"string","description":"A short description of the department.","example":"Invoices, refunds, and payment failures"},"evaluateTransfer":{"type":"boolean","description":"Whether Drellia evaluates transfers to this department. Default: `false`.","example":true,"default":false},"transferContext":{"type":"string","description":"What this department handles, in free text. Drellia reads it to judge whether a transfer to this department was correct.","example":"Billing handles invoices and refunds. Technical issues go to Support."},"skills":{"description":"The skills and responsibilities of the department.","example":["invoices","refunds","payment failures"],"type":"array","items":{"type":"string"}},"color":{"type":"string","description":"The color of the department in the web app: a hex color, for example `#FF5733`, or a color name, for example `indigo`. Drellia picks a color when you omit it.","example":"indigo"},"icon":{"type":"string","description":"The name of the icon of the department in the web app.","example":"users"}},"required":["name","icon"]},"DepartmentResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"The department `id`.","example":"550e8400-e29b-41d4-a716-446655440000"},"entityKey":{"type":"string","description":"The short key of the department. Department paths accept it in place of `id`.","example":"DEP-A1B2C3"},"name":{"type":"string","description":"The name of the department.","example":"Billing"},"externalId":{"type":"string","description":"The id of the department in your system, or `null` when it has none.","example":"MERCADOLIBRE","nullable":true},"description":{"type":"string","description":"A short description of the department.","example":"Invoices, refunds, and payment failures"},"evaluateTransfer":{"type":"boolean","description":"Whether Drellia evaluates transfers to this department.","example":false},"transferContext":{"type":"object","description":"What this department handles, in free text. Drellia reads it to judge whether a transfer to this department was correct.","example":"Billing handles invoices and refunds. Technical issues go to Support.","nullable":true},"skills":{"description":"The skills and responsibilities of the department.","example":["invoices","refunds","payment failures"],"type":"array","items":{"type":"string"}},"color":{"type":"string","description":"The color of the department in the web app.","example":"#FF5733"},"icon":{"type":"string","description":"The icon of the department in the web app.","example":"users"},"createdAt":{"format":"date-time","type":"string","description":"When the department was created. This resource uses `createdAt`; most others use `createdOn`.","example":"2023-01-01T00:00:00Z"},"updatedAt":{"format":"date-time","type":"string","description":"When the department was last changed. This resource uses `updatedAt`; most others use `updatedOn`.","example":"2023-01-01T00:00:00Z"}},"required":["id","entityKey","name","externalId","description","evaluateTransfer","skills","color","icon","createdAt","updatedAt"]},"DepartmentsListResponseDto":{"type":"object","properties":{"page":{"type":"number","description":"The page you got.","example":1},"pageSize":{"type":"number","description":"The number of items in each page.","example":50},"total":{"type":"number","description":"The total number of departments.","example":12},"results":{"description":"The departments in this page.","type":"array","items":{"$ref":"#/components/schemas/DepartmentResponseDto"}}},"required":["page","pageSize","total","results"]},"UpdateDepartmentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the department.","example":"Billing"},"externalId":{"type":"string","description":"The id of the department in your system, unique among your departments. It is also the folder you deliver its calls to over SFTP (`calls/<externalId>/`). Up to 100 characters: letters, digits and `. _ -`, starting with a letter or digit.","example":"MERCADOLIBRE"},"description":{"type":"string","description":"A short description of the department.","example":"Invoices, refunds, and payment failures"},"evaluateTransfer":{"type":"boolean","description":"Whether Drellia evaluates transfers to this department.","example":true},"transferContext":{"type":"string","description":"What this department handles, in free text. Drellia reads it to judge whether a transfer to this department was correct.","example":"Billing handles invoices and refunds. Technical issues go to Support."},"skills":{"description":"The skills and responsibilities of the department.","example":["invoices","refunds","payment failures"],"type":"array","items":{"type":"string"}},"color":{"type":"string","description":"The color of the department in the web app: a hex color, for example `#FF5733`, or a color name, for example `indigo`.","example":"blue"},"icon":{"type":"string","description":"The name of the icon of the department in the web app.","example":"users"}}},"CreateQuestionnaireDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the questionnaire.","example":"Customer service quality","minLength":2,"maxLength":255},"description":{"type":"string","description":"What the questionnaire measures.","example":"Greeting, identification, and closing of support calls"},"isActive":{"type":"boolean","description":"Accepted for compatibility. New questionnaires always start as `draft`.","default":false},"metadata":{"type":"object","description":"Extra data of your own. Drellia stores it and returns it as is.","additionalProperties":true},"status":{"type":"string","description":"The status. `draft`: not in use. `active`: Drellia evaluates conversations with it. `archived`: no longer in use. New questionnaires always start as `draft`.","enum":["draft","active","archived"],"example":"draft"},"departmentId":{"type":"string","description":"The `id` of the department the questionnaire applies to. Omit it for Work types only; this never applies to every conversation.","nullable":true,"format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}},"required":["name","status"]},"QuestionnaireResponseDto":{"type":"object","properties":{"hasEvaluations":{"type":"boolean","description":"Whether a completed, live evaluation exists for this questionnaire. Included on the questionnaire list."},"hasEvaluationRoute":{"type":"boolean","description":"Whether this questionnaire has a live reporting department and an enabled Evaluation rule, or a live Active Work type. Included on Audit list and detail reads; does not predict audience size."},"id":{"type":"string","description":"The questionnaire `id`.","example":"550e8400-e29b-41d4-a716-446655440000"},"entityKey":{"type":"string","description":"The short key of the questionnaire. `id` stays the identifier to use.","example":"QST-A1B2C3"},"name":{"type":"string","description":"The name of the questionnaire.","example":"Customer service quality"},"description":{"type":"string","description":"What the questionnaire measures.","example":"Greeting, identification, and closing of support calls"},"createdOn":{"format":"date-time","type":"string","description":"When the questionnaire was created."},"updatedOn":{"format":"date-time","type":"string","description":"When the questionnaire was last changed."},"questionCount":{"type":"number","description":"The number of questions in the questionnaire.","example":8},"status":{"type":"string","description":"The status. `draft`: not in use. `active`: Drellia evaluates conversations with it. `archived`: no longer in use.","enum":["draft","active","archived"],"example":"active"},"departmentId":{"type":"string","description":"The `id` of the department the questionnaire applies to, or null when none is assigned.","nullable":true,"format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"department":{"type":"object","description":"The department the questionnaire applies to.","nullable":true,"properties":{"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Billing"},"description":{"type":"string","example":"Invoices, refunds, and payment failures"},"color":{"type":"string","example":"#FF5733"},"icon":{"type":"string","example":"users"}}}},"required":["id","entityKey","name","createdOn","updatedOn","status"]},"QuestionnairesListResponseDto":{"type":"object","properties":{"page":{"type":"number","description":"The page you got.","example":1},"pageSize":{"type":"number","description":"The number of items in each page.","example":50},"total":{"type":"number","description":"The total number of questionnaires.","example":6},"count":{"type":"number","description":"Deprecated. The same value as `total`.","deprecated":true,"example":6},"results":{"description":"The questionnaires in this page.","type":"array","items":{"$ref":"#/components/schemas/QuestionnaireResponseDto"}}},"required":["page","pageSize","total","results"]},"UpdateQuestionnaireDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the questionnaire.","example":"Customer service quality","minLength":2,"maxLength":255},"description":{"type":"string","description":"What the questionnaire measures.","example":"Greeting, identification, and closing of support calls","maxLength":1000},"isActive":{"type":"boolean","description":"Whether the questionnaire is active."},"metadata":{"type":"object","description":"Extra data of your own. Drellia stores it and returns it as is.","additionalProperties":true},"status":{"type":"string","description":"The status. `draft`: not in use. `active`: Drellia evaluates conversations with it. `archived`: no longer in use.","enum":["draft","active","archived"],"example":"active"},"departmentId":{"type":"string","description":"The `id` of the department the questionnaire applies to. Send null for Work types only; this never applies to every conversation.","nullable":true,"format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}}},"CreateCustomerDto":{"type":"object","properties":{"identificationNumber":{"type":"string","description":"The identification number of the customer, for example a national ID.","example":"ID-12345","minLength":2,"maxLength":255},"firstName":{"type":"string","description":"The first name. A customer can have a phone number only, with no name.","example":"John","maxLength":255},"lastName":{"type":"string","description":"The last name.","example":"Doe","maxLength":255},"externalId":{"type":"string","description":"The identifier of the customer in your own system.","example":"EXT-001","maxLength":255},"phoneNumber":{"type":"string","description":"The phone number, with the country code.","example":"+1234567890","minLength":2,"maxLength":255},"email":{"type":"string","description":"The email address. Drellia stores it in lower case.","example":"john.doe@example.com"},"metadata":{"type":"object","description":"Extra facts about the customer, as text values. The voice agents can use them during a call. These keys are not allowed: `first_name`, `last_name`, `phone_number`, `email`, `external_id`, `id`. Use the customer fields for those.","example":{"tier":"premium","source":"web"},"additionalProperties":{"type":"string"}}},"required":["identificationNumber"]},"CustomersListResponseDto":{"type":"object","properties":{"page":{"type":"number","description":"The page you got.","example":1},"pageSize":{"type":"number","description":"The number of items in each page.","example":50},"total":{"type":"number","description":"The total number of customers.","example":100},"results":{"description":"The customers in this page.","type":"array","items":{"$ref":"#/components/schemas/CustomerResponseDto"}}},"required":["page","pageSize","total","results"]},"CustomerStageChangeResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"stageId":{"type":"string","format":"uuid","nullable":true,"description":"Null: no stage."},"stageName":{"type":"string","nullable":true,"description":"The stage name, also for a stage deactivated or deleted since."},"effectiveOn":{"format":"date-time","type":"string","description":"When the stage took effect."},"recordedOn":{"format":"date-time","type":"string","description":"When Drellia recorded the change."},"source":{"type":"string","enum":["internal","public_api","migration"]},"sourceEventId":{"type":"string","nullable":true}},"required":["id","customerId","stageId","stageName","effectiveOn","recordedOn","source","sourceEventId"]},"CreateCustomerStageChangeDto":{"type":"object","properties":{"stageId":{"type":"string","description":"The stage the customer is in from `effectiveOn` on; null for no stage.","format":"uuid","nullable":true},"effectiveOn":{"type":"string","description":"When the stage took effect: an ISO 8601 date and time with `Z` or a UTC offset such as `+02:00`. It may lie in the past: an older change adds history without replacing the current stage. It may not lie in the future (`code` is `CUSTOMER_STAGE_CHANGE_IN_FUTURE`): record a change once it has taken effect. Up to two minutes ahead of Drellia's clock is accepted, for clock differences.","example":"2026-10-01T09:00:00.000Z"},"sourceEventId":{"type":"string","description":"Your id for this change. Sending the same id again returns the change already recorded instead of a second one.","maxLength":255}},"required":["stageId","effectiveOn"]},"UpdateCustomerDto":{"type":"object","properties":{"externalId":{"type":"string","description":"The identifier of the customer in your own system. Send it to assign or replace the external ID. It must be unique among live customers in your organization.","example":"EXT-001","minLength":1,"maxLength":255},"email":{"type":"string","description":"The email address. Send an empty string to clear it.","example":"john.doe@example.com"},"firstName":{"type":"string","description":"The first name. Send an empty string to clear it.","example":"John","maxLength":255},"identificationNumber":{"type":"string","description":"The identification number of the customer.","example":"ID-12345","minLength":2,"maxLength":255},"phoneNumber":{"type":"string","description":"The phone number, with the country code. Send an empty string to clear it.","example":"+1234567890","maxLength":255},"lastName":{"type":"string","description":"The last name. Send an empty string to clear it.","example":"Doe","maxLength":255},"isActive":{"type":"boolean","description":"Whether the customer is active.","example":true},"metadata":{"type":"object","description":"Extra facts about the customer, as text values. The voice agents can use them during a call. These keys are not allowed: `first_name`, `last_name`, `phone_number`, `email`, `external_id`, `id`. Use the customer fields for those.","example":{"tier":"premium","source":"web"},"additionalProperties":{"type":"string"}}}},"CustomerStageResponseDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"Renewing"},"sortOrder":{"type":"number","description":"Position in the stage list, lowest first.","example":0},"isActive":{"type":"boolean","description":"False when no customer can be moved into the stage."},"createdOn":{"format":"date-time","type":"string"},"updatedOn":{"format":"date-time","type":"string"}},"required":["id","name","sortOrder","isActive","createdOn","updatedOn"]},"CreateCustomerStageDto":{"type":"object","properties":{"name":{"type":"string","description":"The stage name. Unique in the organization, ignoring case.","example":"Renewing","minLength":1,"maxLength":100},"sortOrder":{"type":"number","description":"Position in the stage list, lowest first. Defaults to after the last stage.","example":0,"minimum":0,"maximum":100000},"isActive":{"type":"boolean","description":"False to create the stage without letting customers be moved into it yet.","default":true}},"required":["name"]},"UpdateCustomerStageDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name. Unique in the organization, ignoring case.","minLength":1,"maxLength":100},"sortOrder":{"type":"number","minimum":0,"maximum":100000},"isActive":{"type":"boolean","description":"False deactivates the stage: customers keep it, but none can be moved into it."}}},"AttachmentProcessingDto":{"type":"object","properties":{"status":{"type":"string","description":"Where processing is. `none`: not processed; you can ask for it. `queued` and `processing`: Drellia works on it. `done`: the results are in `content`. `failed`: see `errorCode`. `skipped`: processing is off for this kind of attachment.","enum":["none","queued","processing","done","failed","skipped"],"example":"done"},"trigger":{"type":"string","description":"What started the processing. `automatic`: the organization setting. `on_demand`: a request from a user or from your integration.","enum":["automatic","on_demand"],"nullable":true},"errorCode":{"type":"string","description":"Why processing failed. Empty unless `status` is `failed`.","enum":["UNSUPPORTED_FORMAT","EMPTY_CONTENT","TOO_LARGE","PROVIDER_ERROR","CONFIG_ERROR","INTERNAL_ERROR"],"nullable":true},"error":{"type":"string","description":"A description of the failure. Empty unless `status` is `failed`.","nullable":true},"attempt":{"type":"number","description":"How many times processing started.","example":1},"processedAt":{"type":"string","description":"When processing finished.","format":"date-time","nullable":true}},"required":["status","trigger","errorCode","error","attempt","processedAt"]},"AttachmentContentDto":{"type":"object","properties":{"transcript":{"type":"string","description":"The speech in a voice note, audio or video. Empty until processing is `done`.","nullable":true,"example":"Yes, this is the second time. I already complained in August."},"extractedText":{"type":"string","description":"The text that Drellia read in an image or document.","nullable":true,"example":"28/09 ZENZIYA TELECOM DIRECT DEBIT -$45,990"},"description":{"type":"string","description":"A short description of an image, written by AI.","nullable":true,"example":"Bank app screenshot with two direct debits of $45,990 on 28/09."},"summary":{"type":"string","description":"A short summary of a document, written by AI.","nullable":true},"language":{"type":"string","description":"The language of the content, as an ISO 639-1 code.","nullable":true,"example":"es"},"detectedType":{"type":"string","description":"What the image shows.","enum":["receipt","invoice","bank_statement","id_document","payment_card","screenshot","chat_screenshot","product_photo","document_page","handwriting","other"],"nullable":true,"example":"bank_statement"},"sensitive":{"type":"boolean","description":"True when the file shows a card number or an identity document number.","example":false}},"required":["transcript","extractedText","description","summary","language","detectedType","sensitive"]},"AttachmentUploadDto":{"type":"object","properties":{"method":{"type":"string","description":"The HTTP method of the upload.","enum":["PUT"],"example":"PUT"},"url":{"type":"string","description":"The pre-signed URL. Send the file bytes as the request body.","example":"https://files.drellia.com/..."},"headers":{"type":"object","description":"Headers to send with the upload, all of them. The storage also checks that `Content-Length` is the declared `fileSize`. The URL works once: a second upload to it gets 412 Precondition Failed.","additionalProperties":{"type":"string"},"example":{"Content-Type":"audio/ogg","If-None-Match":"*"}},"expiresAt":{"type":"string","description":"When the URL stops working.","format":"date-time"}},"required":["method","url","headers","expiresAt"]},"AttachmentDownloadDto":{"type":"object","properties":{"url":{"type":"string","description":"A pre-signed URL to download the file.","example":"https://files.drellia.com/..."},"expiresAt":{"type":"string","description":"When the URL stops working.","format":"date-time"}},"required":["url","expiresAt"]},"AttachmentResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"The attachment `id`.","example":"3f0c2a5e-8b1d-4f7a-9c2e-1a2b3c4d5e6f"},"conversationId":{"type":"string","description":"The `id` of the conversation.","example":"9d1e7c2a-4b3f-4e8d-a1c6-7f2e9b0d3c4a"},"messageId":{"type":"string","description":"The `messageId` of the message the file is attached to.","example":"wamid.HBg3"},"clientAttachmentId":{"type":"string","description":"Your own `id` for the attachment, when you sent one.","nullable":true,"example":"a2"},"kind":{"type":"string","description":"What the file is.","enum":["voice_note","audio","image","video","document","sticker"],"example":"voice_note"},"status":{"type":"string","description":"Where the file is. `awaiting_upload`: Drellia waits for the file. `ready`: the file arrived and matches its declaration. `rejected`: the file did not match its declaration and was deleted; see `errorCode`. `missing`: the file did not arrive before the conversation was evaluated. A missing file you upload later is still accepted.","enum":["awaiting_upload","ready","rejected","missing"],"example":"ready"},"errorCode":{"type":"string","description":"Why the file was rejected. Empty unless `status` is `rejected`.","enum":["TYPE_MISMATCH","SIZE_MISMATCH","TOO_LARGE","EMPTY_FILE","MALWARE","FETCH_FAILED"],"nullable":true},"error":{"type":"string","description":"A description of the rejection. Empty unless `status` is `rejected`.","nullable":true},"contentType":{"type":"string","description":"The MIME type of the file.","example":"audio/ogg"},"sizeBytes":{"type":"number","description":"The size of the file in bytes.","example":48211},"fileName":{"type":"string","description":"The original file name.","nullable":true},"caption":{"type":"string","description":"The caption sent with the file.","nullable":true},"durationSeconds":{"type":"number","description":"The length of a voice note, audio or video in seconds.","nullable":true,"example":42},"pageCount":{"type":"number","description":"The number of pages of a document.","nullable":true},"processing":{"description":"Transcription or text extraction.","allOf":[{"$ref":"#/components/schemas/AttachmentProcessingDto"}]},"content":{"description":"What Drellia read from the file.","allOf":[{"$ref":"#/components/schemas/AttachmentContentDto"}]},"upload":{"description":"Where to upload the file. Present while `status` is `awaiting_upload` in the response that declared the attachment, and in the response of the upload URL operation.","allOf":[{"$ref":"#/components/schemas/AttachmentUploadDto"}]},"download":{"description":"Where to download the file. Present only when you ask for it with `include=download`.","allOf":[{"$ref":"#/components/schemas/AttachmentDownloadDto"}]},"createdAt":{"type":"string","description":"When Drellia received the declaration.","format":"date-time"},"updatedAt":{"type":"string","description":"When the attachment last changed.","format":"date-time"}},"required":["id","conversationId","messageId","clientAttachmentId","kind","status","errorCode","error","contentType","sizeBytes","fileName","caption","durationSeconds","pageCount","processing","content","createdAt","updatedAt"]},"CreateRecordingUploadDto":{"type":"object","properties":{"contentType":{"type":"string","description":"The MIME type of the audio file.","enum":["audio/wav","audio/x-wav","audio/mpeg","audio/mp3","audio/ogg","audio/opus","audio/flac","audio/mp4","audio/x-m4a","audio/aac","audio/webm","audio/gsm"],"example":"audio/wav"},"fileSize":{"type":"number","description":"The size of the audio file in bytes. The maximum is 209715200 (200 MB).","minimum":1,"maximum":209715200,"example":18350000},"checksumSha256":{"type":"string","description":"The SHA-256 checksum of the file, Base64-encoded. When you send it, the storage rejects a file with a different checksum.","example":"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg="},"channelLayout":{"type":"string","description":"How the speakers are recorded. `mono`: all speakers on one channel. `stereo_split`: each speaker on a separate channel. With `stereo_split`, Drellia assigns the speakers from the channels.","enum":["mono","stereo_split"],"default":"mono"},"employeeChannel":{"type":"string","description":"The channel that records the employee. Use it only with `stereo_split`. When you omit it, Drellia finds the employee from the transcript.","enum":["left","right"]},"employeeSpeakerId":{"type":"string","description":"The diarization speaker that is the employee, as `speaker_<number>`. Use it only with `mono`. When you omit it, Drellia finds the employee from the transcript.","example":"speaker_0"},"language":{"type":"string","description":"The language of the conversation, as an ISO 639-1 code. When you omit it, Drellia uses the language of your organization.","example":"es"}},"required":["contentType","fileSize"]},"RecordingSpeakerAttributionDto":{"type":"object","properties":{"source":{"type":"string","description":"How Drellia found the employee. `channel`: from the stereo channels. `override`: from the speaker you sent. `llm`: from the transcript. `none`: not found.","enum":["channel","override","llm","none"],"nullable":true},"confidence":{"type":"number","description":"The confidence of the result, from 0 to 1.","nullable":true,"example":0.96}},"required":["source","confidence"]},"RecordingPlaybackDto":{"type":"object","properties":{"url":{"type":"string","description":"A pre-signed URL to play or download the recording.","example":"https://files.drellia.com/..."},"expiresAt":{"type":"string","description":"When the URL stops working.","format":"date-time"}},"required":["url","expiresAt"]},"RecordingResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"The recording `id`.","example":"3f0c2a5e-8b1d-4f7a-9c2e-1a2b3c4d5e6f"},"conversationId":{"type":"string","description":"The `id` of the conversation.","example":"9d1e7c2a-4b3f-4e8d-a1c6-7f2e9b0d3c4a"},"source":{"type":"string","description":"Where the recording came from. `upload`: you uploaded it. `voice_call`: Drellia recorded it during a voice agent call. A `voice_call` recording cannot be reprocessed.","enum":["upload","voice_call"],"example":"upload"},"status":{"type":"string","description":"Where the recording is in processing. `awaiting_upload`: Drellia waits for the file. `uploaded`: the file arrived and waits for transcription. `transcribing`: Drellia builds the transcript. `transcribed`: the transcript is ready. `failed`: processing stopped; see `errorCode`.","enum":["awaiting_upload","uploaded","transcribing","transcribed","failed"],"example":"transcribing"},"errorCode":{"type":"string","description":"Why processing stopped. Empty unless `status` is `failed`.","enum":["UNSUPPORTED_FORMAT","TOO_LARGE","TOO_LONG","EMPTY_AUDIO","PROVIDER_ERROR","CONFIG_ERROR","UPLOAD_EXPIRED","SIZE_MISMATCH","INTERNAL_ERROR"],"nullable":true},"error":{"type":"string","description":"A description of the failure. Empty unless `status` is `failed`.","nullable":true,"example":null},"contentType":{"type":"string","description":"The MIME type of the audio file.","example":"audio/wav"},"sizeBytes":{"type":"number","description":"The size of the file in bytes.","nullable":true,"example":18350000},"durationSeconds":{"type":"number","description":"The length of the audio in seconds.","nullable":true,"example":612.4},"channelLayout":{"type":"string","description":"How the speakers are recorded.","enum":["mono","stereo_split"]},"language":{"type":"string","description":"The language of the conversation. Empty when Drellia detects it.","nullable":true,"example":"es"},"speakerAttribution":{"description":"How Drellia found the employee.","allOf":[{"$ref":"#/components/schemas/RecordingSpeakerAttributionDto"}]},"needsReview":{"type":"boolean","description":"True when Drellia could not tell the employee from the customer. The conversation is not evaluated. Reprocess the recording with `employeeSpeakerId` or `employeeChannel`.","example":false},"attempt":{"type":"number","description":"The processing attempt. It increases each time you reprocess the recording.","example":1},"expiresAt":{"type":"string","description":"When the upload stops working. Empty unless `status` is `awaiting_upload`.","nullable":true,"format":"date-time"},"retryAfterSeconds":{"type":"number","description":"How many seconds to wait before you get the recording again. Empty when `status` is `transcribed` or `failed`.","nullable":true,"example":10},"playback":{"description":"A URL to play the recording. Only in Get a recording with `include=playback`, after the file arrived.","allOf":[{"$ref":"#/components/schemas/RecordingPlaybackDto"}]},"createdAt":{"type":"string","description":"When the recording was created.","format":"date-time"},"updatedAt":{"type":"string","description":"When the recording last changed.","format":"date-time"}},"required":["id","conversationId","source","status","errorCode","error","contentType","sizeBytes","durationSeconds","channelLayout","language","speakerAttribution","needsReview","attempt","expiresAt","retryAfterSeconds","createdAt","updatedAt"]},"RecordingUploadDto":{"type":"object","properties":{"method":{"type":"string","description":"The HTTP method of the upload.","enum":["POST"],"example":"POST"},"url":{"type":"string","description":"The URL to send the file to.","example":"https://bucket.s3.eu-north-1.amazonaws.com/"},"fields":{"type":"object","description":"The form fields to send with the file. Send all of them in a `multipart/form-data` request, in this order, and then the file in a field named `file`.","additionalProperties":{"type":"string"}},"expiresAt":{"type":"string","description":"When the upload stops working.","format":"date-time"}},"required":["method","url","fields","expiresAt"]},"RecordingUploadResponseDto":{"type":"object","properties":{"recording":{"description":"The recording.","allOf":[{"$ref":"#/components/schemas/RecordingResponseDto"}]},"upload":{"description":"How to upload the audio file.","allOf":[{"$ref":"#/components/schemas/RecordingUploadDto"}]}},"required":["recording","upload"]},"ReprocessRecordingDto":{"type":"object","properties":{"employeeSpeakerId":{"type":"string","description":"The diarization speaker that is the employee, as `speaker_<number>`. Use it when the recording `needsReview`.","example":"speaker_1"},"employeeChannel":{"type":"string","description":"The channel that records the employee, for a `stereo_split` recording.","enum":["left","right"]}}},"DeclareMessageAttachmentRequest":{"type":"object","properties":{"clientAttachmentId":{"type":"string","description":"Your own `id` for the attachment, unique within the conversation. Up to 128 characters: letters, digits, `.`, `_`, `:` and `-`. The response returns it next to the Drellia `id`.","example":"a1"},"kind":{"type":"string","description":"What the file is. `voice_note`: a voice message recorded in the chat. `audio`: an audio file someone shared. `image`, `video`, `document` and `sticker`: the other WhatsApp media types.","enum":["voice_note","audio","image","video","document","sticker"],"example":"voice_note"},"contentType":{"type":"string","description":"The MIME type of the file. Each `kind` accepts its own types; parameters such as `codecs=opus` are allowed.","enum":["audio/ogg","audio/opus","audio/mpeg","audio/mp3","audio/mp4","audio/x-m4a","audio/aac","audio/amr","audio/wav","audio/x-wav","audio/webm","image/jpeg","image/png","image/webp","video/mp4","video/3gpp","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/plain","text/csv"],"example":"audio/ogg"},"fileSize":{"type":"number","description":"The size of the file in bytes. The maximum is 16 MB for voice notes, audio and video, 5 MB for images, 500 KB for stickers and 100 MB for documents. Upload exactly this number of bytes.","minimum":1,"example":48211},"fileName":{"type":"string","description":"The original file name. Up to 255 characters.","example":"statement.jpg"},"caption":{"type":"string","description":"The caption sent with the file. Up to 1024 characters.","example":"here it is"},"durationSeconds":{"type":"number","description":"The length of a voice note, audio or video in seconds.","example":42}},"required":["kind","contentType","fileSize"]},"CreateConversationMessageRequest":{"type":"object","properties":{"messageId":{"type":"string","description":"Your own `id` for the message, unique within the conversation. Send it so that a retried request skips the messages it already saved instead of adding them again. We recommend it for every message, and it is required for a message with `attachments`. Up to 128 characters: letters, digits, `.`, `_`, `:` and `-`. When you leave it out, Drellia generates one.","example":"zd-55120-0003"},"content":{"type":"string","description":"The text of the message. Required unless the message has `attachments`.","example":"Hello, how are you today?"},"attachments":{"description":"Files sent with the message: voice notes, audio, images, documents, video and stickers. Up to 20 per message and 100 per request. The response returns an upload URL for each one.","type":"array","items":{"$ref":"#/components/schemas/DeclareMessageAttachmentRequest"}},"senderRole":{"type":"string","description":"Who sent the message: `customer` or `employee`.","example":"customer"},"senderId":{"type":"string","description":"The Drellia `id` of the sender: the customer `id` or the employee `id`. For an employee message you can send `senderExternalId` instead. An employee message with neither belongs to the employee of the conversation.","example":"550e8400-e29b-41d4-a716-446655440000"},"senderExternalId":{"type":"string","description":"The `externalId` of the employee who sent the message: your own identifier for the employee. Only for a message with `senderRole` `employee`: on any other message, and when null or empty, it is ignored. Send `senderId` or `senderExternalId`, not both. Drellia stores the employee `id` as `senderId`.","example":"EMP-4411","maxLength":100},"originalDateTime":{"type":"number","description":"When the message was sent, as a Unix time in milliseconds.","example":1701792000000}},"required":["senderRole","originalDateTime"]},"CreateConversationEventRequest":{"type":"object","properties":{"eventType":{"type":"string","description":"What happened. `transfer.requested`: someone asked for a transfer. `transfer.completed`: the transfer was made. `transfer.failed`: the transfer did not go through. `transfer.cancelled`: the transfer was cancelled.","enum":["transfer.requested","transfer.completed","transfer.failed","transfer.cancelled"],"example":"transfer.completed"},"originalDateTime":{"type":"number","description":"When the event happened, as a Unix time in milliseconds.","example":1760000005000},"triggeredByRole":{"type":"string","description":"The role of the person who caused the event, for example `employee`.","example":"employee"},"triggeredById":{"type":"string","description":"The Drellia `id` of the person who caused the event, when you know it.","example":"11111111-1111-1111-1111-111111111111"},"payload":{"type":"object","description":"Data specific to the event type. A `transfer.completed`, `transfer.failed`, or `transfer.cancelled` event needs `toDepartmentId` (a department `id`). `fromDepartmentId` is optional.","additionalProperties":true,"example":{"toDepartmentId":"22222222-2222-2222-2222-222222222222","fromDepartmentId":"33333333-3333-3333-3333-333333333333"}}},"required":["eventType","originalDateTime","payload"]},"CreateConversationDto":{"type":"object","properties":{"providerId":{"type":"string","description":"The `id` of the provider the conversation came through. See List providers.","example":"550e8400-e29b-41d4-a716-446655440000"},"caseId":{"type":"string","description":"The `id` of the case this conversation belongs to, when you track cases.","example":"550e8400-e29b-41d4-a716-446655440000"},"employeeId":{"type":"string","description":"The `id` of the employee in the conversation. Send `employeeId` or `employeeExternalId`, not both.","example":"550e8400-e29b-41d4-a716-446655440000"},"employeeExternalId":{"type":"string","description":"The `externalId` of the employee in the conversation: your own identifier for the employee. Send `employeeId` or `employeeExternalId`, not both.","example":"EMP-4411"},"agentId":{"type":"string","description":"The `id` of the voice agent in the conversation, for a call handled by an agent. Required when neither `employeeId` nor `employeeExternalId` is sent.","example":"550e8400-e29b-41d4-a716-446655440000"},"customerId":{"type":"string","description":"The `id` of the customer in the conversation. Send `customerId` or `customerExternalId`, not both.","example":"550e8400-e29b-41d4-a716-446655440000"},"customerExternalId":{"type":"string","description":"The `externalId` of the customer in the conversation: your own identifier for the customer. Send `customerId` or `customerExternalId`, not both.","example":"CRM-99812"},"externalId":{"type":"string","description":"Your own identifier for the conversation, for example the ticket or chat ID. It must be unique in your organization: a second conversation with the same `externalId` is rejected with 409, and the response gives the `id` of the existing one. Use it to retry a create safely. Up to 255 characters: letters, digits and `. _ : / # @ + -`.","example":"ZD-TICKET-55120"},"channel":{"type":"string","description":"Where the conversation took place. Send `whatsapp` for WhatsApp chats so the web app shows them as a chat.","enum":["whatsapp","chat","email","call"],"example":"whatsapp"},"messages":{"description":"The messages of the conversation, to send them with the create instead of in a later call. A conversation created with messages is complete: Drellia evaluates it and accepts no more messages for it. When messages have `attachments`, Drellia evaluates it once the files arrive, or 30 minutes after the create. At most 1000 messages.","type":"array","items":{"$ref":"#/components/schemas/CreateConversationMessageRequest"}},"events":{"description":"The events of the conversation, for example transfers. Sent only with `messages`. At most 1000 events.","type":"array","items":{"$ref":"#/components/schemas/CreateConversationEventRequest"}},"originalDateTime":{"type":"number","description":"When the conversation happened, as a Unix time in milliseconds. The value must be between the years 2000 and 2100.","example":1701792000000,"minimum":946684800000,"maximum":4102444800000}},"required":["providerId"]},"ConversationResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"The conversation `id`.","example":"550e8400-e29b-41d4-a716-446655440000"},"entityKey":{"type":"string","description":"The short key of the conversation. `id` stays the identifier to use.","example":"CNV-A1B2C3"},"organizationId":{"type":"string","description":"The `id` of your organization.","example":"550e8400-e29b-41d4-a716-446655440000"},"providerId":{"type":"string","description":"The `id` of the provider the conversation came through.","example":"550e8400-e29b-41d4-a716-446655440000"},"caseId":{"type":"string","description":"The `id` of the case.","example":"550e8400-e29b-41d4-a716-446655440000"},"employeeId":{"type":"string","description":"The `id` of the employee in the conversation.","example":"550e8400-e29b-41d4-a716-446655440000"},"customerId":{"type":"string","description":"The `id` of the customer in the conversation.","example":"550e8400-e29b-41d4-a716-446655440000"},"customerStageId":{"type":"string","description":"The `id` of the customer stage the customer was in when the conversation happened (`originalDateTime`, else `createdOn`), as their stage history reads now: a stage change you record or correct later for that time changes it. Null without a customer, or without a stage at that time.","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"customerStageName":{"type":"string","description":"The name of `customerStageId`, also of a stage deactivated or deleted since. Null with it.","example":"Onboarding","nullable":true},"createdOn":{"format":"date-time","type":"string","description":"When the conversation was created in Drellia."},"updatedOn":{"format":"date-time","type":"string","description":"When the conversation was last changed."},"originalDateTime":{"type":"number","description":"When the conversation happened, as a Unix time in milliseconds.","example":1701792000000},"status":{"type":"string","description":"The processing status. `PENDING`: not evaluated yet. `COMPLETED`: evaluated. `PARTIAL_SUCCESS`: some evaluations failed. `FAILED`: the evaluation failed. `ARCHIVED`: closed.","enum":["PENDING","COMPLETED","PARTIAL_SUCCESS","FAILED","ARCHIVED"],"example":"PENDING"},"externalId":{"type":"string","description":"Your own identifier for the conversation, when you sent one.","example":"ZD-TICKET-55120"},"transcriptFinalizedAt":{"type":"string","description":"When the transcript became complete. Empty while the conversation still accepts messages.","format":"date-time"},"transcriptFinalizedReason":{"type":"string","description":"Why the transcript became complete. `client`: you called Finalize. `final_batch`: you added messages with `final` true. `one_shot`: you created the conversation with its messages. `idle_timeout`: no messages arrived for 30 minutes. `backfill`: the conversation existed before transcripts could be completed in steps. Conversations from other channels can show other values.","example":"final_batch"},"recording":{"description":"The recording of the conversation, without a playback URL. Empty when the conversation has no recording.","nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/RecordingResponseDto"}]},"channel":{"type":"string","description":"Where the conversation took place, when you sent it.","enum":["whatsapp","chat","email","call"],"nullable":true},"attachmentDeadline":{"type":"string","description":"When Drellia stops waiting for attachment files that did not arrive. Empty when the conversation waits for none.","format":"date-time","nullable":true},"attachments":{"description":"The attachments declared with the create, each with an `upload` URL. Present only in the create response.","type":"array","items":{"$ref":"#/components/schemas/AttachmentResponseDto"}}},"required":["id","customerStageId","customerStageName","createdOn","updatedOn","status"]},"ConversationsListResponseDto":{"type":"object","properties":{"page":{"type":"number","description":"The page you got.","example":1},"pageSize":{"type":"number","description":"The number of items in each page.","example":50},"total":{"type":"number","description":"The total number of conversations.","example":120},"results":{"description":"The conversations in this page.","type":"array","items":{"$ref":"#/components/schemas/ConversationResponseDto"}}},"required":["page","pageSize","total","results"]},"UpdateConversationDto":{"type":"object","properties":{"externalId":{"type":"string","description":"The identifier of the conversation in your own system. Send it to assign or replace the external ID. It must be unique among live conversations in your organization.","example":"ZD-TICKET-55120","minLength":1,"maxLength":255},"providerId":{"type":"string","description":"The `id` of the provider the conversation came through.","example":"550e8400-e29b-41d4-a716-446655440000"},"caseId":{"type":"string","description":"The `id` of the case this conversation belongs to.","example":"550e8400-e29b-41d4-a716-446655440000"},"employeeId":{"type":"string","description":"The `id` of the employee in the conversation.","example":"550e8400-e29b-41d4-a716-446655440000"},"customerId":{"type":"string","description":"The `id` of the customer in the conversation.","example":"550e8400-e29b-41d4-a716-446655440000"},"originalDateTime":{"type":"number","description":"When the conversation happened, as a Unix time in milliseconds. The value must be between the years 2000 and 2100.","example":1701792000000,"minimum":946684800000,"maximum":4102444800000},"status":{"type":"string","description":"The processing status. Set `ARCHIVED` to close the conversation. Drellia sets the other values itself.","enum":["PENDING","COMPLETED","PARTIAL_SUCCESS","FAILED","ARCHIVED"],"example":"ARCHIVED"}}},"CreateConversationTimelineRequestDto":{"type":"object","properties":{"messages":{"description":"The messages of the conversation, in any order.","type":"array","items":{"$ref":"#/components/schemas/CreateConversationMessageRequest"}},"events":{"description":"The events of the conversation, for example transfers.","type":"array","items":{"$ref":"#/components/schemas/CreateConversationEventRequest"}},"process":{"type":"boolean","description":"Whether this is the last batch and Drellia should process the conversation. `true` (the default when neither `process` nor `final` is sent) completes the transcript and starts processing once its attachments have arrived: Drellia evaluates the conversation and accepts no more messages for it. `false` saves the messages and events and keeps the transcript open until you ask for processing: send more batches, then complete it with Process or with a last batch that has `process` true. Drellia never completes it on its own while you hold it open.","default":true},"final":{"type":"boolean","description":"The former name of `process`, still accepted. When you send both, they must have the same value.","default":true}},"required":["messages"]},"ConversationTimelineOperationResultDto":{"type":"object","properties":{"created":{"type":"number","description":"How many items were saved.","example":1},"skipped":{"type":"number","description":"How many messages were already saved by an earlier request with the same `messageId`, and so were not saved again.","example":0},"failed":{"type":"number","description":"How many items were not saved.","example":0},"errors":{"description":"One line for each item that was not saved, with the reason.","example":[],"type":"array","items":{"type":"string"}}},"required":["created","failed","errors"]},"TranscriptStateDto":{"type":"object","properties":{"finalized":{"type":"boolean","description":"`true` when the transcript is complete and accepts no more messages."},"finalizedAt":{"type":"string","description":"When the transcript became complete.","format":"date-time"},"reason":{"type":"string","description":"Why the transcript became complete. See `transcriptFinalizedReason`.","example":"client"},"awaitingAttachments":{"type":"boolean","description":"`true` when the transcript is complete on your side but waits for its attachments. Drellia completes it when every file arrived and the processing set to automatic finished, or at `attachmentDeadline`. It accepts no more messages.","example":true},"attachmentDeadline":{"type":"string","description":"When Drellia stops waiting for files that did not arrive. They become `missing` and the conversation is evaluated without them.","format":"date-time"}},"required":["finalized"]},"CreateConversationTimelineResponseDto":{"type":"object","properties":{"messages":{"description":"The result for the messages.","allOf":[{"$ref":"#/components/schemas/ConversationTimelineOperationResultDto"}]},"events":{"description":"The result for the events.","allOf":[{"$ref":"#/components/schemas/ConversationTimelineOperationResultDto"}]},"transcript":{"description":"Whether the transcript is now complete.","allOf":[{"$ref":"#/components/schemas/TranscriptStateDto"}]},"attachments":{"description":"The attachments declared in this batch, each with an `upload` while its file is awaited. Upload every file to its URL.","type":"array","items":{"$ref":"#/components/schemas/AttachmentResponseDto"}}},"required":["messages","events","transcript"]},"ConversationTimelineMessageDto":{"type":"object","properties":{"messageId":{"type":"string","description":"The message `id`.","example":"msg-001"},"conversationId":{"type":"string","description":"The `id` of the conversation the message belongs to.","example":"11111111-1111-1111-1111-111111111111"},"content":{"type":"string","description":"The text of the message. Empty for a message that has only attachments.","example":"Hello"},"attachments":{"description":"The files sent with the message, with what Drellia read from them.","type":"array","items":{"$ref":"#/components/schemas/AttachmentResponseDto"}},"senderRole":{"type":"string","description":"Who sent the message: `customer` or `employee`.","example":"customer"},"senderId":{"type":"string","description":"The `id` of the sender. For an employee message, the employee `id`: the one you sent, the one your `senderExternalId` named, or the employee of the conversation.","example":"22222222-2222-2222-2222-222222222222"},"timestamp":{"type":"number","description":"Deprecated. The same value as `originalDateTime`.","deprecated":true,"example":1760000000000},"originalDateTime":{"type":"number","description":"When the message was sent, as a Unix time in milliseconds.","example":1760000000000},"organizationId":{"type":"string","description":"The `id` of your organization.","example":"33333333-3333-3333-3333-333333333333"},"createdAt":{"type":"number","description":"When Drellia stored the message, as a Unix time in milliseconds.","example":1760000001000}},"required":["messageId","conversationId","content","senderRole","timestamp","originalDateTime"]},"ConversationEventDto":{"type":"object","properties":{"id":{"type":"string","description":"The event `id`.","example":"evt-001"},"conversationId":{"type":"string","description":"The `id` of the conversation the event belongs to.","example":"11111111-1111-1111-1111-111111111111"},"eventType":{"type":"string","description":"What happened.","enum":["transfer.requested","transfer.completed","transfer.failed","transfer.cancelled"],"example":"transfer.completed"},"eventVersion":{"type":"number","description":"The version of the event schema.","example":1},"originalDateTime":{"type":"number","description":"When the event happened, as a Unix time in milliseconds.","example":1760000005000},"triggeredByRole":{"type":"string","description":"The role of the person who caused the event.","example":"employee"},"triggeredById":{"type":"string","description":"The Drellia `id` of the person who caused the event.","example":"11111111-1111-1111-1111-111111111111"},"payload":{"type":"object","description":"Data specific to the event type.","additionalProperties":true},"transferCorrelationId":{"type":"string","description":"An `id` Drellia gives to all the events of one transfer.","example":"44444444-4444-4444-8444-444444444444"}},"required":["id","conversationId","eventType","eventVersion","originalDateTime","payload"]},"ConversationTimelineResultsDto":{"type":"object","properties":{"messages":{"description":"The messages, in order of `originalDateTime`.","type":"array","items":{"$ref":"#/components/schemas/ConversationTimelineMessageDto"}},"events":{"description":"The events, in order of `originalDateTime`.","type":"array","items":{"$ref":"#/components/schemas/ConversationEventDto"}}},"required":["messages","events"]},"ConversationTimelineResponseDto":{"type":"object","properties":{"results":{"description":"The messages and the events.","allOf":[{"$ref":"#/components/schemas/ConversationTimelineResultsDto"}]}},"required":["results"]},"StoreInteractionContextDto":{"type":"object","properties":{"id":{"type":"string","description":"The `id` of the interaction, a UUID v4 you choose. Use the same value in the path.","example":"550e8400-e29b-41d4-a716-446655440000"},"externalId":{"type":"string","description":"The identifier of the interaction in your own system. Unique in your organization. Printable ASCII only, with no spaces. Use it to find the context again with Find by external ID.","example":"crm-case-48213","maxLength":256},"data":{"type":"object","additionalProperties":true,"description":"The data of the interaction, as key and value pairs. The keys must be the context fields configured for your organization.","example":{"customerName":"Maria Lopez","amountDue":"1248.60","dueDate":"2026-10-01"}}},"required":["id","data"]},"InteractionContextResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"The `id` of the interaction.","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationId":{"type":"string","description":"The `id` of your organization.","example":"550e8400-e29b-41d4-a716-446655440000"},"externalId":{"type":"string","description":"The identifier of the interaction in your own system.","example":"crm-case-48213"},"data":{"type":"object","additionalProperties":true,"description":"The data of the interaction, as you stored it.","example":{"customerName":"Maria Lopez","amountDue":"1248.60","dueDate":"2026-10-01"}},"createdOn":{"type":"string","description":"When the context was first stored.","example":"2026-09-22T10:15:30.000Z"},"updatedOn":{"type":"string","description":"When the context was last replaced.","example":"2026-09-22T10:15:30.000Z"}},"required":["id","organizationId","data","createdOn","updatedOn"]},"ProviderResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"The provider `id`.","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","description":"The name of the provider.","example":"Twilio"},"channel":{"type":"string","description":"The channel the provider serves, for example `voice` or `chat`.","example":"voice"},"createdAt":{"format":"date-time","type":"string","description":"When the provider was created. This resource uses `createdAt`; most others use `createdOn`."},"updatedAt":{"format":"date-time","type":"string","description":"When the provider was last changed. This resource uses `updatedAt`; most others use `updatedOn`."}},"required":["id","name","channel","createdAt","updatedAt"]},"ProvidersListResponseDto":{"type":"object","properties":{"results":{"description":"The providers of your organization.","type":"array","items":{"$ref":"#/components/schemas/ProviderResponseDto"}}},"required":["results"]},"DateRangeDto":{"type":"object","properties":{"from":{"type":"string","description":"Start: an ISO date-time, or a calendar day (YYYY-MM-DD) read from the start of that day in the organization's time zone","example":"2024-01-01"},"to":{"type":"string","description":"End: an ISO date-time, or a calendar day (YYYY-MM-DD) read to the end of that day (inclusive) in the organization's time zone","example":"2024-12-31"}},"required":["from","to"]},"PublicEvaluationsExportRequestDto":{"type":"object","properties":{"dateRange":{"$ref":"#/components/schemas/DateRangeDto"},"departmentIds":{"type":"array","items":{"type":"string","format":"uuid"}},"employeeIds":{"type":"array","items":{"type":"string","format":"uuid"}},"questionnaireIds":{"type":"array","items":{"type":"string","format":"uuid"}},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"}},"customerStageIds":{"description":"Customer stage IDs: only evaluations whose customer stage, as recorded when the conversation was evaluated, is one of them.","maxItems":100,"type":"array","items":{"type":"string","format":"uuid"}},"timezone":{"type":"string","example":"America/Argentina/Buenos_Aires"},"locale":{"type":"string","enum":["es","en"]},"output":{"description":"The file format. `xlsx` puts each table on its own sheet. `csv`, `tsv` and `delimited` put one table in a text file: set `grain` to the table you want. Tables: `evaluation` (one row for each evaluation) and `answer` (one row for each answer).","oneOf":[{"type":"object","title":"XlsxReportOutput","required":["format"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["xlsx"]}}},{"type":"object","title":"CsvReportOutput","required":["format","grain"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["csv"]},"grain":{"type":"string"}}},{"type":"object","title":"TsvReportOutput","required":["format","grain"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["tsv"]},"grain":{"type":"string"}}},{"type":"object","title":"DelimitedReportOutput","required":["format","delimiter","grain"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["delimited"]},"delimiter":{"type":"string","minLength":1,"maxLength":1},"grain":{"type":"string"}}}],"example":{"format":"csv","grain":"evaluation"}}},"required":["dateRange","timezone","locale","output"]},"ReportRequesterDto":{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","description":"User id, or the id of the API key"}},"required":["type","id"]},"PublicReportRunDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reportId":{"type":"string","enum":["evaluations-export","conversations-export"]},"status":{"type":"string","enum":["pending","running","completed","failed"],"description":"The export is ready to download when `status` is `completed`."},"requestedBy":{"description":"Who asked for the export: a user of the web app, or an API key. Every export of your organization is shared.","allOf":[{"$ref":"#/components/schemas/ReportRequesterDto"}]},"output":{"oneOf":[{"type":"object","title":"XlsxReportOutput","required":["format"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["xlsx"]}}},{"type":"object","title":"CsvReportOutput","required":["format","grain"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["csv"]},"grain":{"type":"string"}}},{"type":"object","title":"TsvReportOutput","required":["format","grain"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["tsv"]},"grain":{"type":"string"}}},{"type":"object","title":"DelimitedReportOutput","required":["format","delimiter","grain"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["delimited"]},"delimiter":{"type":"string","minLength":1,"maxLength":1},"grain":{"type":"string"}}}]},"params":{"type":"object","description":"The filters the export was created with. An export started in the web app can have filters that this API does not accept."},"rowCounts":{"type":"object","description":"The number of rows in each table of the file.","additionalProperties":{"type":"number"}},"fileName":{"type":"string"},"errorMessage":{"type":"string","description":"Why the export failed, when `status` is `failed`."},"retryAfterSeconds":{"type":"number","description":"While the export is `pending` or `running`, get it again after this number of seconds."},"createdOn":{"type":"string","format":"date-time"},"startedOn":{"type":"string","format":"date-time"},"completedOn":{"type":"string","format":"date-time"},"expiresOn":{"type":"string","format":"date-time","description":"After this time, the file is deleted and cannot be downloaded."},"expired":{"type":"boolean"}},"required":["id","reportId","status","requestedBy","params","createdOn","expired"]},"PublicConversationsExportRequestDto":{"type":"object","properties":{"dateRange":{"$ref":"#/components/schemas/DateRangeDto"},"departmentIds":{"type":"array","items":{"type":"string","format":"uuid"}},"employeeIds":{"type":"array","items":{"type":"string","format":"uuid"}},"agentIds":{"type":"array","items":{"type":"string","format":"uuid"}},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"}},"customerStageIds":{"description":"Customer stage IDs: only conversations whose customer was in one of them at the conversation time, as the stage history reads now. Refused with 403 MODULE_DISABLED while the organization does not have Customer stages on.","maxItems":100,"type":"array","items":{"type":"string","format":"uuid"}},"statuses":{"type":"array","items":{"type":"string","enum":["PENDING","COMPLETED","PARTIAL_SUCCESS","FAILED","ARCHIVED"]}},"isArchived":{"type":"boolean"},"timezone":{"type":"string","example":"Europe/Berlin"},"locale":{"type":"string","enum":["es","en"]},"output":{"description":"The file format. `xlsx` puts each table on its own sheet. `csv`, `tsv` and `delimited` put one table in a text file: set `grain` to the table you want. Tables: `conversation` (one row for each conversation) and `transcript` (one row for each message).","oneOf":[{"type":"object","title":"XlsxReportOutput","required":["format"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["xlsx"]}}},{"type":"object","title":"CsvReportOutput","required":["format","grain"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["csv"]},"grain":{"type":"string"}}},{"type":"object","title":"TsvReportOutput","required":["format","grain"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["tsv"]},"grain":{"type":"string"}}},{"type":"object","title":"DelimitedReportOutput","required":["format","delimiter","grain"],"additionalProperties":false,"properties":{"format":{"type":"string","enum":["delimited"]},"delimiter":{"type":"string","minLength":1,"maxLength":1},"grain":{"type":"string"}}}],"example":{"format":"csv","grain":"conversation"}}},"required":["dateRange","timezone","locale","output"]},"PublicReportRunsResponseDto":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/PublicReportRunDto"}},"nextCursor":{"type":"string","description":"Send this value as `cursor` to get the next page."}},"required":["runs"]},"ReportRunDownloadDto":{"type":"object","properties":{"fileName":{"type":"string"},"downloadUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}},"required":["fileName","downloadUrl","expiresAt"]},"SendEmailRequestDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject line, one line of plain text. It is also the headline of the email.","example":"Customer wants to pay","maxLength":200},"body":{"type":"string","description":"What happened and what your team must do, as plain text. No HTML and no Markdown.","example":"Maria Lopez agreed to pay today; please follow up.","maxLength":10000},"customerName":{"type":"string","description":"The name of the customer, when known.","example":"Maria Lopez","maxLength":200},"customerId":{"type":"string","description":"The customer or account identifier in your system, when known.","example":"AC-40182","maxLength":64},"paymentAmount":{"type":"string","description":"The amount the customer said they will pay, with the currency symbol. When you send it, the email shows a payment panel.","example":"€1,248.60","maxLength":40},"paymentDueDate":{"type":"string","description":"When the customer said they will pay, as free text.","example":"March 21, 2025","maxLength":100},"paymentMethod":{"type":"string","description":"How the customer said they will pay, as free text.","example":"Bank transfer, single payment","maxLength":200},"customerQuote":{"type":"string","description":"A short quote of what the customer said, when it helps your team.","example":"I can send the transfer on the 21st once I'm paid.","maxLength":500},"locale":{"type":"string","description":"The language of the email. Default: the language of your organization (`es`).","example":"es","enum":["en","es"]}},"required":["subject","body"]},"SendEmailResponseDto":{"type":"object","properties":{"messageId":{"type":"string","description":"The message `id` from the email provider. Can be empty.","example":"<20260811100000.abcdef@mail.drellia.com>"},"recipientCount":{"type":"number","description":"The number of recipients the email went to.","example":2}},"required":["messageId","recipientCount"]},"VerifyIdentityRequestDto":{"type":"object","properties":{"fieldType":{"type":"string","description":"The kind of value to verify. Each kind has its own comparison rules. Only `customer_identification_number` is available now.","enum":["customer_identification_number"],"example":"customer_identification_number"},"providedValue":{"type":"string","description":"The value as the caller said it, exactly as it is in the transcript. Spaces, separators, letters, and spelled words such as \"Q de Queso\" are all accepted.","example":"12 34 56 78 Q de Queso","maxLength":200},"expectedValue":{"type":"string","description":"The value on file, for example the identification number of the customer. Configure it as a dynamic variable in your agent platform. Do not let the model fill it. The response never contains it.","example":"12345678Q","maxLength":200}},"required":["fieldType","providedValue","expectedValue"]},"VerifyIdentityResponseDto":{"type":"object","properties":{"match":{"type":"boolean","description":"Whether the two values match under the rules of `fieldType`. For `customer_identification_number`, only the digits are compared. Letters and separators are ignored on both sides.","example":true},"reason":{"type":"string","description":"Why the values do not match. Only present when `match` is false. `invalid_format`: the provided value has nothing to compare. `mismatch`: the values are different.","enum":["invalid_format","mismatch"],"example":"mismatch"}},"required":["match"]},"WorkingHoursResponseDto":{"type":"object","properties":{"employeeId":{"type":"string","nullable":true,"description":"The employee `id` when this is an employee override. `null` for the organization schedule."},"days":{"description":"The 7 days of the week, one entry each.","type":"array","items":{"$ref":"#/components/schemas/WorkingHoursDayDto"}},"resolvedFrom":{"type":"string","enum":["organization","employee"],"description":"Only on Get the effective working hours: which schedule you got. `employee`: the employee override. `organization`: the organization schedule.","example":"organization"}},"required":["days"]},"SetWorkingHoursDto":{"type":"object","properties":{"days":{"description":"The full week: exactly 7 entries, one for each `dayOfWeek` from 0 (Sunday) to 6 (Saturday), with no duplicates. Send `isEnabled: false` for a day off.","minItems":7,"maxItems":7,"type":"array","items":{"$ref":"#/components/schemas/WorkingHoursDayDto"}}},"required":["days"]}}},"x-tagGroups":[{"name":"Audit","tags":["Conversations","Questionnaires","Questions","Reports"]},{"name":"Voice Agents","tags":["Agents","Campaigns","Agent Tools","Interaction Context"]},{"name":"Organization data","tags":["Customers","Employees","Departments","Working Hours","Providers"]},{"name":"Platform","tags":["Health"]}]}