{"openapi":"3.1.0","info":{"title":"Agents API","version":"1.0.0"},"paths":{"/api/agent":{"post":{"operationId":"agents_createAgent","summary":"Create agent","description":"Creates a new agent. Required: name only. Optional: instructions, output_fields, output_instructions, language, voice, tools, interruption, call messages, DIDs, webhook, and call transfer. Returns full agent details.","tags":["agents"],"responses":{"201":{"description":"Agent created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetailsResponse"}}}},"400":{"description":"Validation error or bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}},"security":[{"ApiKeyAuth":[]}]},"get":{"operationId":"agents_listAgents","summary":"List agents","description":"Retrieves a paginated list of agents for the authenticated customer.","tags":["agents"],"parameters":[{"name":"offset","in":"query","description":"Number of records to skip (default: 0)","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","description":"Maximum number of records to return (default: 10, max: 100)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"sort","in":"query","description":"Sort order by created_at time (default: desc)","required":false,"schema":{"$ref":"#/components/schemas/ApiAgentGetParametersSort","default":"desc"}}],"responses":{"200":{"description":"Customer agents retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerAgentResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/agent/{id}":{"get":{"operationId":"agents_getAgent","summary":"Get agent","description":"Retrieves detailed information about an agent using its UUID.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"The UUID of the agent","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agent details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetailsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"security":[{"ApiKeyAuth":[]}]},"patch":{"operationId":"agents_updateAgent","summary":"Update agent","description":"Updates specific fields of an agent using its UUID. At least one field must be provided. Omitted keys are unchanged. New voice/runtime fields do not accept null (use empty string to clear voicemail or call-limit messages). LLM cannot be changed via API. **Caution:** When updating prompts or tools, include all data you want to keep (GET first, merge, then PATCH).","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"The UUID of the agent","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agent updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetailsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequest"}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"operationId":"agents_deleteAgent","summary":"Delete agent","description":"Deletes an agent. This permanently removes the agent and all associated data: all calls and call history, all batches and contacts, and all other related data for this agent. This action cannot be undone. If the agent has an active batch, the API returns 400 with a message to stop that batch first.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"The UUID of the agent to delete","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agent deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agents_deleteAgent_Response_200"}}}},"400":{"description":"Cannot delete: agent has an active batch. Stop the batch first (e.g. Stop your batch (id) before deleting).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAgentRequestBadRequestError"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/agent/{id}/clone":{"post":{"operationId":"agents_cloneAgent","summary":"Clone agent","description":"Creates a copy of the agent with all its settings: instructions, outputs, tools, `language_id`, `voice_id`, `languages`, `stt_language_mode`, `default_voice_id`, LLM, knowledge base, memory, transfer, webhook and call settings. The copy keeps the outgoing number (`out_did`) and has no inbound number (`in_did` is null), because a number answers for one agent only. Use it to create one agent per workflow from a template agent, then `PATCH` the copy's `instructions` or other settings.","tags":["agents"],"parameters":[{"name":"id","in":"path","description":"UUID of the agent to copy","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Agent cloned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetailsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the copy. Defaults to \"<agent name> (copy)\"."}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/call":{"post":{"operationId":"calls_initiateACall","summary":"Initiate a call","description":"Initiates a call using the specified agent. Requires API key authentication. Call initiation is rate limited per API key (default: 1 per 20 seconds; configurable per key). Other endpoints: 1 request per second per API key. Request body may include agent_args as a JSON object {} (e.g. {\"contact_name\": \"John\", \"order_id\": \"123\"}); agent_args is not an array.\n\n**Calling hours.** An immediate call (no `scheduled_at`) is placed only between 09:05 and 20:55 local time of the called number's country; for a country with several time zones the window must hold in all of them. Outside it the request gets a 400 with `code: \"OUTSIDE_CALLING_HOURS\"` and `next_allowed_at` (ISO time when it would be allowed). Scheduled calls are not affected. Accounts that need other hours can ask us to switch this off.","tags":["calls"],"responses":{"200":{"description":"Call initiated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"429":{"description":"Rate limit exceeded or Concurrency limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateACallRequestTooManyRequestsError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallRequest"}}}},"security":[{"ApiKeyAuth":[]}]},"get":{"operationId":"calls_listAgentCalls","summary":"List agent calls","description":"Retrieves a paginated list of calls for a specific agent. Requires agent_id.","tags":["calls"],"parameters":[{"name":"agent_id","in":"query","description":"The UUID of the agent (mandatory)","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","description":"Number of records to skip (default: 0)","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","description":"Maximum number of records to return (default: 10, max: 100)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"sort","in":"query","description":"Sort order by created_at time (default: desc)","required":false,"schema":{"$ref":"#/components/schemas/ApiCallGetParametersSort","default":"desc"}}],"responses":{"200":{"description":"Agent calls retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCallsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/call/{id}":{"get":{"operationId":"calls_getCallDetails","summary":"Get call details","description":"Retrieves detailed information about a call using its UUID. Requires API key authentication and verifies the call belongs to the customer.\n\n**Call Status Polling:**\nThe call `outcome` field can have three values:\n- **Pending**: Call is dialing or in progress\n- **Failure**: Call was not picked up or unable to dial\n- **Completed**: Call was answered\n\nYou can poll this endpoint to check the call status. It is recommended to poll every 2 minutes until the outcome is either \"Completed\" or \"Failure\".","tags":["calls"],"parameters":[{"name":"id","in":"path","description":"The UUID of the call","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Call details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallDetailsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"404":{"description":"Call not found or does not belong to this customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/batch":{"post":{"operationId":"batches_createBatch","summary":"Create batch","description":"Creates a new batch with contacts. Each contact must have contact_name and contact_phone. Additional fields are stored in agent_args and can be used during calls. Customer ID is automatically determined from the API key. To add contacts to an existing batch, use POST /api/batch/{id}/contacts.","tags":["batches"],"responses":{"200":{"description":"Batch created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"400":{"description":"Validation error or batch creation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Agent not found or does not belong to customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBatchRequest"}}}},"security":[{"ApiKeyAuth":[]}]},"get":{"operationId":"batches_listBatches","summary":"List batches","description":"Retrieves a paginated list of batches for a specific agent. Customer ID is automatically determined from the API key.","tags":["batches"],"parameters":[{"name":"agent_id","in":"query","description":"The UUID of the agent","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","description":"Number of records to skip (default: 0)","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","description":"Maximum number of records to return (default: 10, max: 100)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"sort","in":"query","description":"Sort order by created_at time (default: desc)","required":false,"schema":{"$ref":"#/components/schemas/ApiBatchGetParametersSort","default":"desc"}}],"responses":{"200":{"description":"Batches retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchListResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/batch/{id}":{"get":{"operationId":"batches_getBatchDetails","summary":"Get batch details","description":"Retrieves detailed information about a specific batch including contact counts. Customer ID is automatically determined from the API key.","tags":["batches"],"parameters":[{"name":"id","in":"path","description":"The batch ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Batch details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDetailsResponse"}}}},"404":{"description":"Batch not found or unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ApiKeyAuth":[]}]},"patch":{"operationId":"batches_updateBatch","summary":"Update batch","description":"Updates batch properties such as name, schedule, max_retries, retry_after_hrs, or concurrency. Customer ID is automatically determined from the API key.","tags":["batches"],"parameters":[{"name":"id","in":"path","description":"The batch ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Batch updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDetailsResponse"}}}},"404":{"description":"Batch not found or unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"description":"Request body for updating a batch. All fields are optional.\n\n**Schedule Field Details (if updating schedule):**\n- **timezone**: IANA timezone identifier (e.g., \"Asia/Kolkata\", \"America/New_York\", \"UTC\")\n- **start_time**: Start time in \"HH:mm\" format using 24-hour clock (e.g., \"09:00\" = 9 AM)\n- **end_time**: End time in \"HH:mm\" format using 24-hour clock (must be after start_time)\n- **days**: Array of day numbers where 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday, 7=Sunday","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBatchRequest"}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/batch/{id}/contacts":{"post":{"operationId":"batches_addContacts","summary":"Add contacts","description":"Adds contacts to an existing batch. Each contact must have contact_name and contact_phone. Additional fields are stored in agent_args. Customer ID is automatically determined from the API key.","tags":["batches"],"parameters":[{"name":"id","in":"path","description":"The batch ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Contacts added successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"400":{"description":"Validation error or batch update failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"404":{"description":"Batch not found or unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddContactsRequest"}}}},"security":[{"ApiKeyAuth":[]}]},"get":{"operationId":"batches_getBatchContacts","summary":"Get batch contacts","description":"Retrieves a paginated list of contacts in a batch, each with their complete call history (all calls as an array). Customer ID is automatically determined from the API key.","tags":["batches"],"parameters":[{"name":"id","in":"path","description":"The batch ID","required":true,"schema":{"type":"integer"}},{"name":"offset","in":"query","description":"Number of records to skip (default: 0)","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","description":"Maximum number of records to return (default: 100, max: 1000)","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}}],"responses":{"200":{"description":"Batch contacts retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchContactsResponse"}}}},"404":{"description":"Batch not found or unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/batch/{id}/contacts/cancel":{"post":{"operationId":"batches_cancelContacts","summary":"Cancel contacts","description":"Stops calls to some contacts of a batch while the rest of the batch keeps running. Use it when a contact has already answered you another way (for example on WhatsApp) and no longer needs the call.\n\nName the contacts either by `phones` (the numbers you added them with) or by `contact_ids` (from Get batch contacts), up to 500 per request. Phones follow the same rules as adding contacts: a 10-digit number for India, or any number with `country_code` (one country code per request).\n\nA contact still waiting for its call (status `Pending`, or `Unanswered` and waiting for a retry) is cancelled, and so is any callback booked for it. Its status becomes `Cancelled` and the batch never calls it again. It stays in the batch and in its contact list.\n\nEach phone or ID gets one result:\n- `cancelled`: it will not be called.\n- `in_call`: it is being called right now. That call is not cut. If you still want no further calls, send the request again after the call ends.\n- `already_done`: there is no call left to stop (the contact is `Completed`, `Failed`, `Invalid` or already `Cancelled`).\n- `not_found`: the batch has no contact with this phone or ID.\n\nIf a phone is in the batch more than once, every contact with that phone is cancelled, and the result is `in_call` if any of them is on a call. `counts` adds up the results.\n\nA cancel can't be undone through the API. To call a cancelled contact again, add it to the batch again.","tags":["batches"],"parameters":[{"name":"id","in":"path","description":"The batch ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"One result per phone or contact ID, plus counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBatchContactsResponse"}}}},"400":{"description":"Invalid request: neither or both of phones and contact_ids, more than 500 entries, or a phone that breaks the rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Batch not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBatchContactsRequest"}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/batch/{id}/start":{"post":{"operationId":"batches_startABatch","summary":"Start a batch","description":"Starts a batch with scheduling configuration. Updates contact statuses based on selected_statuses. Customer ID is automatically determined from the API key.\n\n**Calling hours.** Contacts are called only between 09:05 and 20:55 in each contact's local time. A schedule that reaches outside that window is still accepted; the response's `messages` says so, and contacts outside the window wait until it opens.","tags":["batches"],"parameters":[{"name":"id","in":"path","description":"The batch ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Batch started successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDetailsResponse"}}}},"404":{"description":"Batch not found or unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"description":"Request body for starting a batch. The schedule field is optional - if not provided, the existing schedule from the batch will be used.\n\n**Schedule Field Details:**\n- **timezone**: IANA timezone identifier (e.g., \"Asia/Kolkata\", \"America/New_York\", \"UTC\")\n- **start_time**: Start time in \"HH:mm\" format using 24-hour clock (e.g., \"09:00\" = 9 AM, \"18:30\" = 6:30 PM)\n- **end_time**: End time in \"HH:mm\" format using 24-hour clock (must be after start_time)\n- **days**: Array of day numbers where 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday, 7=Sunday\n\n**Other Fields:**\n- **max_retries**: Maximum number of retry attempts (0 = no retries, 3 = 3 retries)\n- **retry_after_hrs**: Hours to wait before retrying (e.g., 3 = wait 3 hours)\n- **max_concurrent_calls**: Maximum number of simultaneous calls (1 = sequential, 5 = up to 5 at once)\n- **selected_statuses**: Array of contact statuses to reset to \"Pending\". Use [\"Pending\"] for normal batch start/resume. Including \"Unanswered\" or \"Failed\" will immediately re-call those contacts (bypasses retry wait time).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartBatchRequest"}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/batch/{id}/stop":{"post":{"operationId":"batches_stopABatch","summary":"Stop a batch","description":"Stops a running batch. Sets batch status to \"Stopping\" (scheduler handles the actual stop). Customer ID is automatically determined from the API key.","tags":["batches"],"parameters":[{"name":"id","in":"path","description":"The batch ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Batch stopped successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopBatchResponse"}}}},"404":{"description":"Batch not found or unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/job-agent":{"post":{"operationId":"jobAgents_createJobAgent","summary":"Create job agent","description":"Creates a new job agent. Required: name, type (hr_pre_screening | hr_mock_interview | hr_interview). Optional: template fields (agent_role, introduction, about_job, about_company, closing_message, questions), output_fields, output_instructions, generate_from_jd_text (JD text to generate template content), out_did. Returns full job agent details including in_did and out_did.","tags":["jobAgents"],"responses":{"201":{"description":"Job agent created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAgentDetailsResponse"}}}},"400":{"description":"Validation error or bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}},"502":{"description":"Job description could not be processed (e.g. generate_from_jd_text provided but external service unavailable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobAgentRequest"}}}},"security":[{"ApiKeyAuth":[]}]},"get":{"operationId":"jobAgents_listJobAgents","summary":"List job agents","description":"Retrieves a paginated list of job agents for the authenticated account. Results are sorted by created_at. Only agents with at least one job are included.","tags":["jobAgents"],"parameters":[{"name":"offset","in":"query","description":"Number of records to skip (default: 0)","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","description":"Maximum number of records to return (default: 10, max: 100)","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"sort","in":"query","description":"Sort order by created_at time (default: desc)","required":false,"schema":{"$ref":"#/components/schemas/ApiJobAgentGetParametersSort","default":"desc"}}],"responses":{"200":{"description":"Customer job agents retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerJobAgentResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/job-agent/{id}":{"get":{"operationId":"jobAgents_getJobAgent","summary":"Get job agent","description":"Retrieves detailed information about a job agent by UUID. Requires API key authentication. The agent must have at least one job.","tags":["jobAgents"],"parameters":[{"name":"id","in":"path","description":"The UUID of the job agent","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job agent details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAgentDetailsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"404":{"description":"Job agent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"security":[{"ApiKeyAuth":[]}]},"patch":{"operationId":"jobAgents_updateJobAgent","summary":"Update job agent","description":"Updates specific fields of a job agent using its UUID. Verifies the agent has at least one job. At least one field must be provided for update. **Caution:** Update overwrites everything — ensure your payload includes all data you want to keep to prevent data loss (e.g. GET the job agent first, merge changes, then PATCH).","tags":["jobAgents"],"parameters":[{"name":"id","in":"path","description":"The UUID of the job agent","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job agent updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAgentDetailsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"404":{"description":"Job agent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJobAgentRequest"}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/nudge-user":{"post":{"operationId":"userInteraction_nudgeUser","summary":"Nudge user","description":"Sends a message to a user during an active call session.","tags":["userInteraction"],"responses":{"200":{"description":"User nudged successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NudgeUserResponse"}}}},"500":{"description":"Error while nudging user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NudgeUserRequest"}}}}}}},"tags":[{"name":"agents","description":"Endpoints for managing agents"},{"name":"calls","description":"Endpoints for initiating and managing calls"},{"name":"batches","description":"Endpoints for creating and managing batches of contacts"},{"name":"jobAgents","description":"Endpoints for managing job agents"},{"name":"userInteraction","description":"Endpoints for interacting with users during active sessions"}],"servers":[{"url":"https://v1.getraya.app","description":"Production server"}],"components":{"schemas":{"CreateAgentRequestOutputFieldsItems":{"type":"object","properties":{"key":{"type":"string"},"description":{"type":"string","default":""}},"required":["key"],"title":"CreateAgentRequestOutputFieldsItems"},"CreateAgentRequestSttLanguageMode":{"type":"string","enum":["auto","lock","handoff"],"description":"How the caller's language is detected. `auto`: detect every turn. `lock`: lock to the first detected language, code-mix on (the caller can still mix in other languages). `handoff`: lock to the detected language, code-mix off. On the portal: Detect every turn / Lock to detected language (code-mix on or off).","title":"CreateAgentRequestSttLanguageMode"},"CreateAgentRequestTools":{"type":"object","properties":{"llm_tools":{"type":"array","items":{"type":"object","additionalProperties":{"description":"Any type"}}}},"description":"Function tools: { llm_tools: [...] }. Each tool needs type function, function (name, description, parameters), and api_details (method, url). See documentation/agents-llm-tools.","title":"CreateAgentRequestTools"},"CreateAgentRequest":{"type":"object","properties":{"name":{"type":"string","description":"Agent name (required)"},"instructions":{"type":"string","description":"Instructions that define agent behavior"},"output_fields":{"type":"array","items":{"$ref":"#/components/schemas/CreateAgentRequestOutputFieldsItems"},"description":"Array of key-description pairs. Each item has key and description only (no extra properties)."},"output_instructions":{"type":"string","description":"Instructions for how to populate output_fields after a call."},"webhook_url":{"type":["string","null"],"format":"uri","description":"Webhook URL. Must be HTTPS or null."},"required_silence_after_speech":{"type":["number","null"],"format":"double","minimum":0.2,"default":0.4,"description":"Required silence after speech in seconds. Optional; defaults to 0.4 if omitted."},"allowed_silence_before_nudge":{"type":["integer","null"],"minimum":0,"default":20,"description":"Allowed silence before nudge in seconds. Optional; defaults to 20 if omitted."},"allowed_speech_before_nudge":{"type":["integer","null"],"minimum":0,"default":30,"description":"Allowed speech before nudge in seconds. Optional; defaults to 30 if omitted."},"out_did":{"type":["number","null"],"format":"double","description":"Outbound DID. If omitted, first DID from customer is used."},"allow_call_transfer":{"type":"boolean","description":"When true, transfer_destination_phone is required (10-digit India mobile). Defaults to false unless a transfer phone is provided."},"transfer_destination_phone":{"type":["string","null"],"pattern":"^[0-9]{10}$","description":"India mobile, 10 digits, no country code. Null or omit if not using transfer."},"language_id":{"type":"string","format":"uuid","description":"Call language UUID. Use Auto detect (`88296485-1c49-4931-919e-7333986e16da`) for an agent that speaks several languages. See [Language options](/voice-agents/language-options)."},"voice_id":{"type":"string","format":"uuid","description":"Voice UUID. See /documentation/agent-voice-options."},"languages":{"type":"array","items":{"type":"string"},"description":"Languages the agent speaks, as ISO 639-1 codes (hi, en, mr, te, kn, bn, as, gu, ml, ne, ta, pa). The first is the starting language. Two or more need `language_id` set to Auto detect (`88296485-1c49-4931-919e-7333986e16da`) and a multilingual `voice_id` that speaks all of them; otherwise the request gets a 400. More than 4 is allowed, but the response then has a note in `messages`: detection gets less reliable as the list grows (we recommend 3 or fewer). See [Language options](/voice-agents/language-options)."},"stt_language_mode":{"$ref":"#/components/schemas/CreateAgentRequestSttLanguageMode","description":"How the caller's language is detected. `auto`: detect every turn. `lock`: lock to the first detected language, code-mix on (the caller can still mix in other languages). `handoff`: lock to the detected language, code-mix off. On the portal: Detect every turn / Lock to detected language (code-mix on or off)."},"default_voice_id":{"type":["string","null"],"format":"uuid","description":"Starting voice when `voice_id` is a composite voice (a mix of one voice per language that our team prepares on request): one of that composite's member voices. `null` clears it. Any other voice gets a 400."},"tools":{"$ref":"#/components/schemas/CreateAgentRequestTools","description":"Function tools: { llm_tools: [...] }. Each tool needs type function, function (name, description, parameters), and api_details (method, url). See documentation/agents-llm-tools."},"allow_interruption":{"type":"boolean","description":"Whether the user may interrupt the agent while speaking."},"min_user_speech_to_interrupt":{"type":"number","format":"double","minimum":0,"description":"Minimum user speech (seconds) before interruption is allowed."},"max_call_duration_mins":{"type":"number","format":"double","minimum":0,"description":"Maximum call duration in minutes."},"say_hello":{"type":"boolean","description":"Whether the agent says hello at call start."},"voicemail_msg":{"type":"string","description":"Voicemail message. Send empty string to clear."},"call_duration_exceed_message":{"type":"string","description":"Message when max call duration is reached. Send empty string to clear."},"in_did":{"type":"number","format":"double","description":"Inbound DID. Must be assigned to your account."}},"required":["name"],"title":"CreateAgentRequest"},"AgentDetailsResponseOutputFieldsItems":{"type":"object","properties":{"key":{"type":"string","description":"Field name (e.g. visit_scheduled)"},"description":{"type":"string","default":"","description":"Description of what to extract"}},"required":["key"],"title":"AgentDetailsResponseOutputFieldsItems"},"AgentDetailsResponseSttLanguageMode":{"type":"string","enum":["auto","lock","handoff"],"description":"How the caller's language is detected: auto (every turn), lock (first detected language, code-mix on) or handoff (lock, code-mix off).","title":"AgentDetailsResponseSttLanguageMode"},"AgentDetailsResponseTools":{"type":"object","properties":{"llm_tools":{"type":"array","items":{"type":"object","additionalProperties":{"description":"Any type"}}}},"description":"Function tools (`{ \"llm_tools\": [...] }`). Empty array when none configured.","title":"AgentDetailsResponseTools"},"AgentDetailsResponse":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid","description":"Unique identifier of the agent"},"name":{"type":"string","description":"Name of the agent"},"instructions":{"type":"string","description":"Agent instructions"},"output_instructions":{"type":"string","description":"Instructions for how to populate output_fields after a call."},"output_fields":{"type":"array","items":{"$ref":"#/components/schemas/AgentDetailsResponseOutputFieldsItems"},"description":"Array of key-description pairs. Each item has key and description only (no extra properties)."},"agent_args":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Agent arguments as a JSON object (e.g. {\"contact_name\": \"John\", \"order_id\": \"123\"}). Not an array."},"required_silence_after_speech":{"type":["number","null"],"format":"double","description":"Required silence after speech in seconds"},"allowed_silence_before_nudge":{"type":["number","null"],"format":"double","description":"Allowed silence before nudge in seconds"},"allowed_speech_before_nudge":{"type":["number","null"],"format":"double","description":"Allowed speech before nudge in seconds"},"out_did":{"type":["number","null"],"format":"double","description":"Outbound DID number"},"in_did":{"type":["number","null"],"format":"double","description":"Inbound DID number (read-only; for reference)"},"webhook_url":{"type":["string","null"],"description":"Webhook URL for callbacks (sent on call completed or call failure). See [Webhooks](/voice-agents/core-concepts#webhooks) for payload format."},"allow_call_transfer":{"type":"boolean","description":"When true, the voice agent may use live call transfer to a human (India only). Default true."},"transfer_destination_phone":{"type":["string","null"],"pattern":"^[0-9]{10}$","description":"India mobile, 10 digits, no country code. Null or omit if not using transfer."},"language_id":{"type":["string","null"],"format":"uuid","description":"Call language UUID. See /documentation/agent-language-options."},"voice_id":{"type":["string","null"],"format":"uuid","description":"Voice UUID. See /documentation/agent-voice-options."},"languages":{"type":"array","items":{"type":"string"},"description":"Languages the agent speaks (ISO 639-1); the first is the starting language. Empty for a single-language agent."},"stt_language_mode":{"$ref":"#/components/schemas/AgentDetailsResponseSttLanguageMode","description":"How the caller's language is detected: auto (every turn), lock (first detected language, code-mix on) or handoff (lock, code-mix off)."},"default_voice_id":{"type":["string","null"],"format":"uuid","description":"Starting voice of a composite `voice_id`, or null."},"tools":{"$ref":"#/components/schemas/AgentDetailsResponseTools","description":"Function tools (`{ \"llm_tools\": [...] }`). Empty array when none configured."},"allow_interruption":{"type":"boolean","description":"Whether the user may interrupt the agent while speaking."},"min_user_speech_to_interrupt":{"type":["number","null"],"format":"double","minimum":0,"description":"Minimum user speech duration (seconds) before interruption is allowed."},"max_call_duration_mins":{"type":["number","null"],"format":"double","minimum":0,"description":"Maximum call duration in minutes."},"say_hello":{"type":"boolean","description":"Whether the agent says hello at call start."},"voicemail_msg":{"type":["string","null"],"description":"Message played when voicemail is detected."},"call_duration_exceed_message":{"type":["string","null"],"description":"Message played when the maximum call duration is reached."},"messages":{"type":"array","items":{"type":"string"},"description":"Notes about the request, present only when there are any: an inbound number moved from another agent, or more than 4 `languages`. The change itself was applied."}},"title":"AgentDetailsResponse"},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"title":"Error"},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"title":"UnauthorizedError"},"InternalServerError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"title":"InternalServerError"},"ApiAgentGetParametersSort":{"type":"string","enum":["asc","desc"],"default":"desc","title":"ApiAgentGetParametersSort"},"CustomerAgentResponseAgentsItems":{"type":"object","properties":{"name":{"type":["string","null"],"description":"Name of the agent"},"id":{"type":"string","format":"uuid","description":"Unique identifier of the agent"},"created_at":{"type":["string","null"],"format":"date-time","description":"Timestamp when the agent was created"},"updated_at":{"type":["string","null"],"format":"date-time","description":"Timestamp when the agent was last updated"}},"title":"CustomerAgentResponseAgentsItems"},"CustomerAgentResponse":{"type":"object","properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAgentResponseAgentsItems"}},"total":{"type":"number","format":"double","description":"Total number of agents for this customer"},"offset":{"type":"number","format":"double","description":"Number of records skipped"},"limit":{"type":"number","format":"double","description":"Maximum number of records returned"}},"title":"CustomerAgentResponse"},"UpdateAgentRequestOutputFieldsItems":{"type":"object","properties":{"key":{"type":"string"},"description":{"type":"string","default":""}},"required":["key"],"title":"UpdateAgentRequestOutputFieldsItems"},"UpdateAgentRequestSttLanguageMode":{"type":"string","enum":["auto","lock","handoff"],"description":"How the caller's language is detected. `auto`: detect every turn. `lock`: lock to the first detected language, code-mix on (the caller can still mix in other languages). `handoff`: lock to the detected language, code-mix off. On the portal: Detect every turn / Lock to detected language (code-mix on or off).","title":"UpdateAgentRequestSttLanguageMode"},"UpdateAgentRequestTools":{"type":"object","properties":{"llm_tools":{"type":"array","items":{"type":"object","additionalProperties":{"description":"Any type"}}}},"description":"Function tools. Replaces the entire llm_tools list when provided.","title":"UpdateAgentRequestTools"},"UpdateAgentRequest":{"type":"object","properties":{"name":{"type":"string","description":"Agent name. If provided, replaces the existing name."},"instructions":{"type":"string","description":"Instructions that define agent behavior. If provided, replaces the agent's instructions."},"output_fields":{"type":"array","items":{"$ref":"#/components/schemas/UpdateAgentRequestOutputFieldsItems"},"description":"Array of key-description pairs. Each item has key and description only. If provided, replaces the agent's output_fields."},"output_instructions":{"type":"string","description":"Instructions for how to populate output_fields after a call. If provided, replaces the agent's output_instructions."},"webhook_url":{"type":"string","format":"uri","description":"Webhook URL for callbacks (sent on call completed or call failure). Must be a valid URL or null. See [Webhooks](/voice-agents/core-concepts#webhooks) for payload format and when webhooks are sent."},"required_silence_after_speech":{"type":"number","format":"double","minimum":0,"description":"Required silence after speech in seconds"},"allowed_silence_before_nudge":{"type":"number","format":"double","minimum":0,"description":"Allowed silence before nudge in seconds"},"allowed_speech_before_nudge":{"type":"number","format":"double","minimum":0,"description":"Allowed speech before nudge in seconds"},"out_did":{"type":"number","format":"double","description":"Outbound DID number for the agent's phone record"},"allow_call_transfer":{"type":"boolean","description":"When true, the voice agent may use live call transfer to a human (India only)."},"transfer_destination_phone":{"type":["string","null"],"pattern":"^[0-9]{10}$","description":"India mobile, 10 digits, no country code. Null clears stored transfer destination."},"language_id":{"type":"string","format":"uuid","description":"Call language UUID. Use Auto detect (`88296485-1c49-4931-919e-7333986e16da`) for an agent that speaks several languages. See [Language options](/voice-agents/language-options)."},"voice_id":{"type":"string","format":"uuid","description":"Voice UUID. See /documentation/agent-voice-options."},"languages":{"type":"array","items":{"type":"string"},"description":"Languages the agent speaks, as ISO 639-1 codes (hi, en, mr, te, kn, bn, as, gu, ml, ne, ta, pa). The first is the starting language. Two or more need `language_id` set to Auto detect (`88296485-1c49-4931-919e-7333986e16da`) and a multilingual `voice_id` that speaks all of them; otherwise the request gets a 400. More than 4 is allowed, but the response then has a note in `messages`: detection gets less reliable as the list grows (we recommend 3 or fewer). See [Language options](/voice-agents/language-options)."},"stt_language_mode":{"$ref":"#/components/schemas/UpdateAgentRequestSttLanguageMode","description":"How the caller's language is detected. `auto`: detect every turn. `lock`: lock to the first detected language, code-mix on (the caller can still mix in other languages). `handoff`: lock to the detected language, code-mix off. On the portal: Detect every turn / Lock to detected language (code-mix on or off)."},"default_voice_id":{"type":["string","null"],"format":"uuid","description":"Starting voice when `voice_id` is a composite voice (a mix of one voice per language that our team prepares on request): one of that composite's member voices. `null` clears it. Any other voice gets a 400."},"tools":{"$ref":"#/components/schemas/UpdateAgentRequestTools","description":"Function tools. Replaces the entire llm_tools list when provided."},"allow_interruption":{"type":"boolean","description":"Whether the user may interrupt the agent while speaking."},"min_user_speech_to_interrupt":{"type":"number","format":"double","minimum":0,"description":"Minimum user speech duration (seconds) before interruption is allowed."},"max_call_duration_mins":{"type":"number","format":"double","minimum":0,"description":"Maximum call duration in minutes."},"say_hello":{"type":"boolean","description":"Whether the agent says hello at call start."},"voicemail_msg":{"type":"string","description":"Voicemail message. Empty string clears the stored message."},"call_duration_exceed_message":{"type":"string","description":"Message when max call duration is reached. Empty string clears the stored message."},"in_did":{"type":["number","null"],"format":"double","description":"Inbound DID. Must be assigned to your account. Send null to clear."}},"description":"At least one field must be provided. Omitted keys are unchanged. For language_id, voice_id, and tools, omit the key instead of sending null. Send an empty string to clear voicemail_msg or call_duration_exceed_message. Fields mirror CreateAgentRequest.","title":"UpdateAgentRequest"},"Agents_deleteAgent_Response_200":{"type":"object","properties":{"message":{"type":"string"},"id":{"type":"string","format":"uuid","description":"Deleted agent UUID"}},"title":"Agents_deleteAgent_Response_200"},"DeleteAgentRequestBadRequestError":{"type":"object","properties":{"error":{"type":"string"}},"title":"DeleteAgentRequestBadRequestError"},"CallRequest":{"type":"object","properties":{"agent_id":{"type":"string","description":"The agent ID to use for the call"},"agent_args":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Optional JSON object with agent-specific arguments (e.g. contact_name, order_id). Must be an object {}, not an array."},"out_did":{"type":"string","description":"Outbound DID (must be assigned to the customer)"},"country_code":{"type":"string","default":"91","description":"Country code (only \"91\" is currently supported, defaults to \"91\")"},"to_number":{"type":"string","pattern":"^\\d{10}$","description":"Phone number - must be exactly 10 digits"},"timezone":{"type":"string","default":"Asia/Kolkata","description":"IANA timezone (e.g., \"Asia/Kolkata\" for IST, defaults to \"Asia/Kolkata\")"}},"required":["agent_id","to_number"],"title":"CallRequest"},"CallResponse":{"type":"object","properties":{"message":{"type":"string"},"uuid":{"type":"string","description":"The UUID of the originated call"}},"required":["message","uuid"],"title":"CallResponse"},"RateLimitError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number","format":"double","description":"Seconds to wait before retrying"}},"title":"RateLimitError"},"ConcurrencyLimitError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"pending_calls":{"type":"number","format":"double","description":"Number of currently pending calls"},"concurrency_limit":{"type":"number","format":"double","description":"Maximum allowed concurrent calls"}},"title":"ConcurrencyLimitError"},"InitiateACallRequestTooManyRequestsError":{"oneOf":[{"$ref":"#/components/schemas/RateLimitError"},{"$ref":"#/components/schemas/ConcurrencyLimitError"}],"title":"InitiateACallRequestTooManyRequestsError"},"ApiCallGetParametersSort":{"type":"string","enum":["asc","desc"],"default":"desc","title":"ApiCallGetParametersSort"},"AgentCallsResponseCallsItems":{"type":"object","properties":{"uuid":{"type":"string"},"caller_no":{"type":"string","description":"Phone number of the caller"},"to_number":{"type":"string","description":"Phone number to which the call was made"},"call_start_time":{"type":"string","format":"date-time"},"call_end_time":{"type":"string","format":"date-time"},"call_duration":{"type":"number","format":"double"},"created_at":{"type":"string","format":"date-time","description":"Timestamp when the call record was created"},"outcome":{"type":"string"}},"title":"AgentCallsResponseCallsItems"},"AgentCallsResponse":{"type":"object","properties":{"calls":{"type":"array","items":{"$ref":"#/components/schemas/AgentCallsResponseCallsItems"}},"total":{"type":"number","format":"double","description":"Total number of calls for this customer"},"offset":{"type":"number","format":"double","description":"Number of records skipped"},"limit":{"type":"number","format":"double","description":"Maximum number of records returned"}},"title":"AgentCallsResponse"},"CallDetailsResponseOutcome":{"type":"string","enum":["Pending","Failure","Completed"],"description":"Call outcome status. \"Pending\" means the call is dialing or in progress. \"Failure\" means the call was not picked up or unable to dial. \"Completed\" means the call was answered.","title":"CallDetailsResponseOutcome"},"CallDetailsResponse":{"type":"object","properties":{"uuid":{"type":"string"},"caller_no":{"type":"string","description":"Phone number of the caller"},"to_number":{"type":"string","description":"Phone number to which the call was made"},"in_did":{"type":"number","format":"double","description":"DID on which the call was received"},"out_did":{"type":"number","format":"double","description":"DID on which the call was made"},"call_transcript":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Call transcript as JSON object"},"call_recording_url":{"type":"string"},"outcome":{"$ref":"#/components/schemas/CallDetailsResponseOutcome","description":"Call outcome status. \"Pending\" means the call is dialing or in progress. \"Failure\" means the call was not picked up or unable to dial. \"Completed\" means the call was answered."},"call_start_time":{"type":"string","format":"date-time","description":"Call start time in UTC (ISO 8601)"},"call_end_time":{"type":"string","format":"date-time","description":"Call end time in UTC (ISO 8601)"},"call_duration":{"type":"number","format":"double"},"agent_id":{"type":"string","format":"uuid"},"agent_args":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Agent arguments as JSON object"},"timezone":{"type":"string"},"call_output":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Call output as JSON object"},"created_at":{"type":"string","format":"date-time","description":"Timestamp when the call record was created (UTC, ISO 8601)"}},"title":"CallDetailsResponse"},"CreateBatchRequestContactsItems":{"type":"object","properties":{"contact_name":{"type":"string","description":"Contact name (required, must contain only alphabets, spaces, and periods)"},"contact_phone":{"type":"string","description":"Contact phone number (required, 10 digits for India, or any numeric value if country_code is provided)"},"country_code":{"type":"string","description":"Country code (optional, 1-4 digits)"}},"required":["contact_name","contact_phone"],"title":"CreateBatchRequestContactsItems"},"CreateBatchRequest":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid","description":"The UUID of the agent to use for this batch"},"batch_name":{"type":"string","minLength":1,"description":"Name for the batch"},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/CreateBatchRequestContactsItems"},"description":"Array of contact objects. Each contact must have contact_name and contact_phone. Additional fields are allowed."}},"required":["agent_id","batch_name","contacts"],"title":"CreateBatchRequest"},"BatchResponseStatus":{"type":"string","enum":["success","error"],"description":"Status of the batch creation","title":"BatchResponseStatus"},"BatchResponseErrorsItems":{"type":"object","properties":{"row":{"type":"integer","description":"Row number (1-based) where the error occurred"},"field":{"type":"string","description":"Field name that has the error"},"value":{"type":"string","description":"Value that caused the error"},"message":{"type":"string","description":"Error message"}},"title":"BatchResponseErrorsItems"},"BatchResponse":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/BatchResponseStatus","description":"Status of the batch creation"},"message":{"type":"string","description":"Human-readable message about the result"},"totalRows":{"type":"integer","description":"Total number of contacts in the request"},"validRows":{"type":"integer","description":"Number of valid contacts that were processed"},"invalidRows":{"type":"integer","description":"Number of invalid contacts that were rejected"},"batchId":{"type":"integer","description":"ID of the created or updated batch"},"contactsInserted":{"type":"integer","description":"Number of contacts successfully added to the batch"},"data":{"type":"array","items":{"type":"object","additionalProperties":{"description":"Any type"}},"description":"Array of valid contact data that was processed"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/BatchResponseErrorsItems"},"description":"Array of validation errors (only present if status is error)"}},"title":"BatchResponse"},"ApiBatchGetParametersSort":{"type":"string","enum":["asc","desc"],"default":"desc","title":"ApiBatchGetParametersSort"},"BatchListResponseBatchesItemsSchedule":{"type":"object","properties":{"timezone":{"type":"string","description":"IANA timezone string"},"start_time":{"type":"string","description":"Start time in \"HH:mm\" format (24-hour)"},"end_time":{"type":"string","description":"End time in \"HH:mm\" format (24-hour)"},"days":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"Array of day numbers (1=Monday, 7=Sunday)"}},"required":["timezone","start_time","end_time","days"],"title":"BatchListResponseBatchesItemsSchedule"},"BatchListResponseBatchesItems":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"agent_id":{"type":"string","format":"uuid"},"created_at":{"type":["string","null"],"format":"date-time"},"schedule":{"oneOf":[{"$ref":"#/components/schemas/BatchListResponseBatchesItemsSchedule"},{"type":"null"}]},"max_retries":{"type":"integer"},"concurrency":{"type":"integer"},"retry_after_hrs":{"type":"number","format":"double"},"total_contacts":{"type":"integer"},"completed_contacts":{"type":"integer"},"unanswered_contacts":{"type":"integer"}},"title":"BatchListResponseBatchesItems"},"BatchListResponse":{"type":"object","properties":{"batches":{"type":"array","items":{"$ref":"#/components/schemas/BatchListResponseBatchesItems"}},"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}},"title":"BatchListResponse"},"BatchDetailsResponseSchedule":{"type":"object","properties":{"timezone":{"type":"string","description":"IANA timezone string"},"start_time":{"type":"string","description":"Start time in \"HH:mm\" format (24-hour)"},"end_time":{"type":"string","description":"End time in \"HH:mm\" format (24-hour)"},"days":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"Array of day numbers (1=Monday, 7=Sunday)"}},"required":["timezone","start_time","end_time","days"],"title":"BatchDetailsResponseSchedule"},"BatchDetailsResponse":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"agent_id":{"type":"string","format":"uuid"},"created_at":{"type":["string","null"],"format":"date-time"},"schedule":{"oneOf":[{"$ref":"#/components/schemas/BatchDetailsResponseSchedule"},{"type":"null"}]},"max_retries":{"type":"integer"},"concurrency":{"type":"integer"},"retry_after_hrs":{"type":"number","format":"double"},"total_contacts":{"type":"integer"},"completed_contacts":{"type":"integer"},"unanswered_contacts":{"type":"integer"}},"title":"BatchDetailsResponse"},"UpdateBatchRequestSchedule":{"type":"object","properties":{"timezone":{"type":"string","description":"IANA timezone identifier. This determines the timezone for interpreting start_time and end_time.\n\nCommon examples:\n- \"Asia/Kolkata\" - India Standard Time (IST)\n- \"America/New_York\" - Eastern Time (ET)\n- \"America/Los_Angeles\" - Pacific Time (PT)\n- \"Europe/London\" - Greenwich Mean Time / British Summer Time\n- \"UTC\" - Coordinated Universal Time\n\nThe timezone must be a valid IANA timezone string in the format \"Region/City\"."},"start_time":{"type":"string","pattern":"^([0-1][0-9]|2[0-3]):[0-5][0-9]$","description":"Start time when the batch should begin making calls. \n\nFormat: \"HH:mm\" using 24-hour clock (00:00 to 23:59)\n- Hours: 00-23 (00 = midnight, 12 = noon, 23 = 11 PM)\n- Minutes: 00-59\n\nExamples:\n- \"09:00\" = 9:00 AM\n- \"14:30\" = 2:30 PM\n- \"00:00\" = Midnight\n- \"23:59\" = 11:59 PM\n\nThis time is interpreted in the timezone specified in the timezone field."},"end_time":{"type":"string","pattern":"^([0-1][0-9]|2[0-3]):[0-5][0-9]$","description":"End time when the batch should stop making calls.\n\nFormat: \"HH:mm\" using 24-hour clock (00:00 to 23:59)\n- Hours: 00-23 (00 = midnight, 12 = noon, 23 = 11 PM)\n- Minutes: 00-59\n\nExamples:\n- \"18:00\" = 6:00 PM\n- \"17:30\" = 5:30 PM\n- \"23:59\" = 11:59 PM\n\n**Important:** end_time must be after start_time. For example, if start_time is \"09:00\", end_time must be later than \"09:00\" on the same day.\n\nThis time is interpreted in the timezone specified in the timezone field."},"days":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"Array of day numbers representing which days of the week the batch should be active.\n\n**Day Number Mapping:**\n- 1 = Monday\n- 2 = Tuesday\n- 3 = Wednesday\n- 4 = Thursday\n- 5 = Friday\n- 6 = Saturday\n- 7 = Sunday\n\n**Examples:**\n- [1, 2, 3, 4, 5] = Monday through Friday (weekdays)\n- [6, 7] = Saturday and Sunday (weekends)\n- [1, 3, 5] = Monday, Wednesday, Friday\n- [1, 2, 3, 4, 5, 6, 7] = Every day of the week\n\nThe batch will only make calls on the specified days, during the time window defined by start_time and end_time."}},"required":["timezone","start_time","end_time","days"],"description":"Schedule configuration object for updating the batch schedule.\n\nThe schedule defines when the batch should be active and making calls. All times are interpreted in the specified timezone.\n\n**Required fields:**\n- timezone: IANA timezone identifier (e.g., \"Asia/Kolkata\", \"America/New_York\", \"Europe/London\", \"UTC\")\n- start_time: Start time in \"HH:mm\" format using 24-hour clock (e.g., \"09:00\" for 9 AM, \"18:30\" for 6:30 PM)\n- end_time: End time in \"HH:mm\" format using 24-hour clock (must be after start_time)\n- days: Array of day numbers representing which days of the week the batch should run\n\n**Day Numbers:**\n- 1 = Monday\n- 2 = Tuesday\n- 3 = Wednesday\n- 4 = Thursday\n- 5 = Friday\n- 6 = Saturday\n- 7 = Sunday\n\n**Example:** {\"timezone\": \"Asia/Kolkata\", \"start_time\": \"09:00\", \"end_time\": \"18:00\", \"days\": [1,2,3,4,5]}\nThis means the batch will run Monday through Friday from 9:00 AM to 6:00 PM India Standard Time (IST).","title":"UpdateBatchRequestSchedule"},"UpdateBatchRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Batch name"},"schedule":{"$ref":"#/components/schemas/UpdateBatchRequestSchedule","description":"Schedule configuration object for updating the batch schedule.\n\nThe schedule defines when the batch should be active and making calls. All times are interpreted in the specified timezone.\n\n**Required fields:**\n- timezone: IANA timezone identifier (e.g., \"Asia/Kolkata\", \"America/New_York\", \"Europe/London\", \"UTC\")\n- start_time: Start time in \"HH:mm\" format using 24-hour clock (e.g., \"09:00\" for 9 AM, \"18:30\" for 6:30 PM)\n- end_time: End time in \"HH:mm\" format using 24-hour clock (must be after start_time)\n- days: Array of day numbers representing which days of the week the batch should run\n\n**Day Numbers:**\n- 1 = Monday\n- 2 = Tuesday\n- 3 = Wednesday\n- 4 = Thursday\n- 5 = Friday\n- 6 = Saturday\n- 7 = Sunday\n\n**Example:** {\"timezone\": \"Asia/Kolkata\", \"start_time\": \"09:00\", \"end_time\": \"18:00\", \"days\": [1,2,3,4,5]}\nThis means the batch will run Monday through Friday from 9:00 AM to 6:00 PM India Standard Time (IST)."},"max_retries":{"type":"integer","minimum":0,"description":"Maximum number of retry attempts"},"retry_after_hrs":{"type":"number","format":"double","minimum":0,"description":"Hours to wait before retrying"},"concurrency":{"type":"integer","minimum":1,"description":"Maximum concurrent calls"}},"title":"UpdateBatchRequest"},"AddContactsRequestContactsItems":{"type":"object","properties":{"contact_name":{"type":"string","description":"Contact name (required, must contain only alphabets, spaces, and periods)"},"contact_phone":{"type":"string","description":"Contact phone number (required, 10 digits for India, or any numeric value if country_code is provided)"},"country_code":{"type":"string","description":"Country code (optional, 1-4 digits)"}},"required":["contact_name","contact_phone"],"title":"AddContactsRequestContactsItems"},"AddContactsRequest":{"type":"object","properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/AddContactsRequestContactsItems"},"description":"Array of contact objects. Each contact must have contact_name and contact_phone. Additional fields are allowed."}},"required":["contacts"],"title":"AddContactsRequest"},"CancelBatchContactsRequest":{"type":"object","properties":{"phones":{"type":"array","items":{"type":"string"},"description":"Phone numbers as you added them: 10 digits for India, or any digits with `country_code`."},"country_code":{"type":"string","description":"Country code for every phone in `phones` (1 to 4 digits, no \"+\"). Leave it out for Indian 10-digit numbers."},"contact_ids":{"type":"array","items":{"type":"integer"},"description":"Contact IDs from Get batch contacts."}},"description":"Send either `phones` or `contact_ids`, not both.","title":"CancelBatchContactsRequest"},"CancelBatchContactsResponseResultsItemsResult":{"type":"string","enum":["cancelled","in_call","already_done","not_found"],"title":"CancelBatchContactsResponseResultsItemsResult"},"CancelBatchContactsResponseResultsItems":{"type":"object","properties":{"phone":{"type":"string","description":"Present when you sent phones."},"contact_ids":{"type":"array","items":{"type":"integer"},"description":"Present when you sent phones: the batch contacts with this phone (empty when not_found)."},"contact_id":{"type":"integer","description":"Present when you sent contact_ids."},"result":{"$ref":"#/components/schemas/CancelBatchContactsResponseResultsItemsResult"}},"required":["result"],"title":"CancelBatchContactsResponseResultsItems"},"CancelBatchContactsResponseCounts":{"type":"object","properties":{"cancelled":{"type":"integer"},"in_call":{"type":"integer"},"already_done":{"type":"integer"},"not_found":{"type":"integer"}},"title":"CancelBatchContactsResponseCounts"},"CancelBatchContactsResponse":{"type":"object","properties":{"batch_id":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/CancelBatchContactsResponseResultsItems"},"description":"One entry per phone or contact ID sent, in the order sent (repeated values are listed once)."},"counts":{"$ref":"#/components/schemas/CancelBatchContactsResponseCounts"}},"title":"CancelBatchContactsResponse"},"BatchContactsResponseContactsItemsCallsItems":{"type":"object","properties":{"id":{"type":"integer"},"uuid":{"type":["string","null"]},"outcome":{"type":["string","null"]},"call_start_time":{"type":["string","null"],"format":"date-time","description":"Call start time in UTC (ISO 8601)"},"call_end_time":{"type":["string","null"],"format":"date-time","description":"Call end time in UTC (ISO 8601)"},"call_duration":{"type":["integer","null"]},"call_output":{"type":["object","null"],"additionalProperties":{"description":"Any type"}},"created_at":{"type":["string","null"],"format":"date-time"}},"title":"BatchContactsResponseContactsItemsCallsItems"},"BatchContactsResponseContactsItems":{"type":"object","properties":{"contact_id":{"type":"integer"},"name":{"type":"string"},"phone":{"type":"integer"},"batch_id":{"type":"integer"},"status":{"type":["string","null"],"description":"Pending, Dialing, Connected, Completed, Unanswered, Failed, Invalid, or Cancelled (stopped with Cancel contacts; never called again)."},"attempts":{"type":"integer"},"agent_args":{"type":"object","additionalProperties":{"description":"Any type"}},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BatchContactsResponseContactsItemsCallsItems"},"description":"Complete call history for this contact"}},"title":"BatchContactsResponseContactsItems"},"BatchContactsResponse":{"type":"object","properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/BatchContactsResponseContactsItems"}},"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}},"title":"BatchContactsResponse"},"StartBatchRequestSchedule":{"type":"object","properties":{"timezone":{"type":"string","description":"IANA timezone identifier. This determines the timezone for interpreting start_time and end_time.\n\nCommon examples:\n- \"Asia/Kolkata\" - India Standard Time (IST)\n- \"America/New_York\" - Eastern Time (ET)\n- \"America/Los_Angeles\" - Pacific Time (PT)\n- \"Europe/London\" - Greenwich Mean Time / British Summer Time\n- \"UTC\" - Coordinated Universal Time\n\nThe timezone must be a valid IANA timezone string in the format \"Region/City\"."},"start_time":{"type":"string","pattern":"^([0-1][0-9]|2[0-3]):[0-5][0-9]$","description":"Start time when the batch should begin making calls. \n\nFormat: \"HH:mm\" using 24-hour clock (00:00 to 23:59)\n- Hours: 00-23 (00 = midnight, 12 = noon, 23 = 11 PM)\n- Minutes: 00-59\n\nExamples:\n- \"09:00\" = 9:00 AM\n- \"14:30\" = 2:30 PM\n- \"00:00\" = Midnight\n- \"23:59\" = 11:59 PM\n\nThis time is interpreted in the timezone specified in the timezone field."},"end_time":{"type":"string","pattern":"^([0-1][0-9]|2[0-3]):[0-5][0-9]$","description":"End time when the batch should stop making calls.\n\nFormat: \"HH:mm\" using 24-hour clock (00:00 to 23:59)\n- Hours: 00-23 (00 = midnight, 12 = noon, 23 = 11 PM)\n- Minutes: 00-59\n\nExamples:\n- \"18:00\" = 6:00 PM\n- \"17:30\" = 5:30 PM\n- \"23:59\" = 11:59 PM\n\n**Important:** end_time must be after start_time. For example, if start_time is \"09:00\", end_time must be later than \"09:00\" on the same day.\n\nThis time is interpreted in the timezone specified in the timezone field."},"days":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"Array of day numbers representing which days of the week the batch should be active.\n\n**Day Number Mapping:**\n- 1 = Monday\n- 2 = Tuesday\n- 3 = Wednesday\n- 4 = Thursday\n- 5 = Friday\n- 6 = Saturday\n- 7 = Sunday\n\n**Examples:**\n- [1, 2, 3, 4, 5] = Monday through Friday (weekdays)\n- [6, 7] = Saturday and Sunday (weekends)\n- [1, 3, 5] = Monday, Wednesday, Friday\n- [1, 2, 3, 4, 5, 6, 7] = Every day of the week\n\nThe batch will only make calls on the specified days, during the time window defined by start_time and end_time."}},"required":["timezone","start_time","end_time","days"],"description":"Schedule configuration object (optional). If not provided, the existing schedule from the batch will be used. If no schedule exists, an error will be returned.\n\nThe schedule defines when the batch should be active and making calls. All times are interpreted in the specified timezone.\n\n**Required fields:**\n- timezone: IANA timezone identifier (e.g., \"Asia/Kolkata\", \"America/New_York\", \"Europe/London\", \"UTC\")\n- start_time: Start time in \"HH:mm\" format using 24-hour clock (e.g., \"09:00\" for 9 AM, \"18:30\" for 6:30 PM)\n- end_time: End time in \"HH:mm\" format using 24-hour clock (must be after start_time)\n- days: Array of day numbers representing which days of the week the batch should run\n\n**Day Numbers:**\n- 1 = Monday\n- 2 = Tuesday\n- 3 = Wednesday\n- 4 = Thursday\n- 5 = Friday\n- 6 = Saturday\n- 7 = Sunday\n\n**Example:** {\"timezone\": \"Asia/Kolkata\", \"start_time\": \"09:00\", \"end_time\": \"18:00\", \"days\": [1,2,3,4,5]}\nThis means the batch will run Monday through Friday from 9:00 AM to 6:00 PM India Standard Time (IST).","title":"StartBatchRequestSchedule"},"StartBatchRequest":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/StartBatchRequestSchedule","description":"Schedule configuration object (optional). If not provided, the existing schedule from the batch will be used. If no schedule exists, an error will be returned.\n\nThe schedule defines when the batch should be active and making calls. All times are interpreted in the specified timezone.\n\n**Required fields:**\n- timezone: IANA timezone identifier (e.g., \"Asia/Kolkata\", \"America/New_York\", \"Europe/London\", \"UTC\")\n- start_time: Start time in \"HH:mm\" format using 24-hour clock (e.g., \"09:00\" for 9 AM, \"18:30\" for 6:30 PM)\n- end_time: End time in \"HH:mm\" format using 24-hour clock (must be after start_time)\n- days: Array of day numbers representing which days of the week the batch should run\n\n**Day Numbers:**\n- 1 = Monday\n- 2 = Tuesday\n- 3 = Wednesday\n- 4 = Thursday\n- 5 = Friday\n- 6 = Saturday\n- 7 = Sunday\n\n**Example:** {\"timezone\": \"Asia/Kolkata\", \"start_time\": \"09:00\", \"end_time\": \"18:00\", \"days\": [1,2,3,4,5]}\nThis means the batch will run Monday through Friday from 9:00 AM to 6:00 PM India Standard Time (IST)."},"max_retries":{"type":"integer","minimum":0,"description":"Maximum number of retry attempts for failed calls.\n\nThis determines how many times the system will attempt to call a contact if the initial call fails or is not completed.\n\n- 0 = No retries (only one attempt per contact)\n- 1 = One retry attempt (total of 2 attempts)\n- 3 = Three retry attempts (total of 4 attempts)\n- etc.\n\nA call is considered for retry if it fails, is unanswered, or has an unsuccessful outcome. The system will wait for the duration specified in retry_after_hrs before making the next attempt."},"retry_after_hrs":{"type":"number","format":"double","minimum":0,"description":"Hours to wait before retrying a failed call.\n\nThis is the time delay between retry attempts. The system will wait this many hours after a failed call before attempting to call the contact again.\n\nExamples:\n- 0 = Retry immediately (not recommended for most use cases)\n- 3 = Wait 3 hours before retrying\n- 24 = Wait 24 hours (1 day) before retrying\n- 48 = Wait 48 hours (2 days) before retrying\n\nThe retry will only occur if:\n1. The number of attempts is less than max_retries\n2. The batch is still active\n3. The current time is within the schedule window"},"max_concurrent_calls":{"type":"integer","minimum":1,"description":"Maximum number of concurrent calls the batch can make simultaneously.\n\nThis controls how many calls can be in progress at the same time for this batch. Higher values allow more parallel calls but require more system resources.\n\nExamples:\n- 1 = One call at a time (sequential calling)\n- 5 = Up to 5 calls simultaneously\n- 10 = Up to 10 calls simultaneously\n\n**Important:** The actual number of concurrent calls may be limited by:\n- Your account's concurrency limit\n- Available system resources\n- The batch's schedule (calls only happen during scheduled hours)\n\nSetting this too high may cause rate limiting or resource exhaustion."},"selected_statuses":{"type":"array","items":{"type":"string"},"description":"Array of contact statuses to reset to \"Pending\" when starting the batch. Contacts with these statuses will become eligible for calling immediately.\n\n**Important Behavior:**\n- Contacts with the specified statuses will be reset to \"Pending\" status\n- Only contacts with \"Pending\" status will be called by the batch\n- **If you include \"Unanswered\" or \"Failed\" statuses, those contacts will be re-called immediately without waiting for the retry duration** (retry_after_hrs). This bypasses the normal retry wait time.\n\n**Common Status Values:**\n- \"Pending\" - Contact has not been called yet (new contacts)\n- \"Unanswered\" - Previous call was not answered (will be re-called immediately if included)\n- \"Invalid\" - Dialing to this number isn't allowed from the given DID.\n- \"Completed\" - Contact was successfully reached (rarely included for retries)\n\n**Usage Guidelines:**\n\n**For Resuming/Starting a Batch (Recommended):**\n- Use only [\"Pending\"] to call only new contacts that haven't been called yet\n- This is the standard approach when starting or resuming a batch\n\n**For Immediate Retry (Use with Caution):**\n- Include \"Unanswered\" or \"Failed\" only if you want to immediately re-call contacts that were previously unsuccessful\n- **Warning:** This will bypass the retry_after_hrs wait time and call them right away\n- Example: [\"Pending\", \"Unanswered\"] will call both new contacts AND immediately retry unanswered contacts\n\n**Best Practice:** For normal batch operations, use [\"Pending\"] only. Only include \"Unanswered\" or \"Failed\" if you specifically need to bypass the retry wait time."}},"required":["max_retries","retry_after_hrs","max_concurrent_calls","selected_statuses"],"title":"StartBatchRequest"},"StopBatchResponse":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"agent_id":{"type":"string","format":"uuid"}},"title":"StopBatchResponse"},"CreateJobAgentRequestType":{"type":"string","enum":["hr_pre_screening","hr_mock_interview","hr_interview"],"description":"Job agent template type","title":"CreateJobAgentRequestType"},"CreateJobAgentRequestOutputFieldsItems":{"type":"object","properties":{"key":{"type":"string"},"description":{"type":"string","default":""}},"required":["key"],"title":"CreateJobAgentRequestOutputFieldsItems"},"CreateJobAgentRequest":{"type":"object","properties":{"name":{"type":"string","description":"Job agent name (required)"},"type":{"$ref":"#/components/schemas/CreateJobAgentRequestType","description":"Job agent template type"},"agent_role":{"type":"string","description":"Agent role: how the voice agent should behave (e.g. prescreening interviewer). Not the job/position title."},"introduction":{"type":"string","description":"Introduction text"},"about_job":{"type":"string","description":"About the job"},"about_company":{"type":"string","description":"About the company"},"extra_instructions":{"type":"string","description":"Extra instructions"},"closing_message":{"type":"string","description":"Closing message"},"questions":{"type":"array","items":{"type":"string"},"description":"Interview questions"},"output_fields":{"type":"array","items":{"$ref":"#/components/schemas/CreateJobAgentRequestOutputFieldsItems"},"description":"Array of key-description pairs. Each item has key and description only (no extra properties)."},"output_instructions":{"type":"string","description":"Instructions for how to populate output_fields after a call."},"generate_from_jd_text":{"type":"string","description":"Optional job description (JD) text. When provided, the API generates template content (agent_role, introduction, about_job, etc.) and merges with any fields you supplied."},"webhook_url":{"type":["string","null"],"format":"uri"},"required_silence_after_speech":{"type":["number","null"],"format":"double","minimum":0},"allowed_silence_before_nudge":{"type":["integer","null"],"minimum":0},"allowed_speech_before_nudge":{"type":["integer","null"],"minimum":0},"out_did":{"type":["number","null"],"format":"double","description":"Outbound DID. If omitted, first DID from customer is used."},"allow_call_transfer":{"type":"boolean","description":"India only. When true, live call transfer to a human is allowed."},"transfer_destination_phone":{"type":["string","null"],"pattern":"^[0-9]{10}$","description":"India mobile (10 digits, no +91). Null or omit if not using transfer."}},"required":["name","type"],"title":"CreateJobAgentRequest"},"JobAgentDetailsResponseOutputFieldsItems":{"type":"object","properties":{"key":{"type":"string","description":"Field name (e.g. current_ctc)"},"description":{"type":"string","default":"","description":"Description of what to extract"}},"required":["key"],"title":"JobAgentDetailsResponseOutputFieldsItems"},"JobAgentDetailsResponse":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid","description":"Unique identifier of the agent"},"name":{"type":"string","description":"Name of the agent"},"agent_role":{"type":"string","description":"Agent role: how the voice agent should behave (e.g. prescreening interviewer). Distinct from job role (the position being hired for)."},"introduction":{"type":"string","description":"Introduction"},"about_job":{"type":"string","description":"About job"},"about_company":{"type":"string","description":"About company"},"extra_instructions":{"type":"string","description":"Extra instructions"},"output_instructions":{"type":"string","description":"Instructions for how to populate output_fields after a call."},"closing_message":{"type":"string","description":"Closing message"},"questions":{"type":"array","items":{"type":"string"},"description":"Questions"},"output_fields":{"type":"array","items":{"$ref":"#/components/schemas/JobAgentDetailsResponseOutputFieldsItems"},"description":"Array of key-description pairs. Each item has key and description only (no extra properties)."},"agent_args":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Agent arguments as a JSON object (e.g. {\"contact_name\": \"John\", \"order_id\": \"123\"}). Not an array."},"required_silence_after_speech":{"type":["number","null"],"format":"double","description":"Required silence after speech in seconds"},"allowed_silence_before_nudge":{"type":["number","null"],"format":"double","description":"Allowed silence before nudge in seconds"},"allowed_speech_before_nudge":{"type":["number","null"],"format":"double","description":"Allowed speech before nudge in seconds"},"out_did":{"type":["number","null"],"format":"double","description":"Outbound DID number"},"in_did":{"type":["number","null"],"format":"double","description":"Inbound DID number (read-only; for reference)"},"webhook_url":{"type":["string","null"],"description":"Webhook URL for callbacks (sent on call completed or call failure). See [Webhooks](/voice-agents/core-concepts#webhooks) for payload format."},"allow_call_transfer":{"type":"boolean","description":"India only. When true, live call transfer to a human is allowed."},"transfer_destination_phone":{"type":["string","null"],"pattern":"^[0-9]{10}$","description":"India mobile (10 digits, no +91). Null if unused."}},"title":"JobAgentDetailsResponse"},"ApiJobAgentGetParametersSort":{"type":"string","enum":["asc","desc"],"default":"desc","title":"ApiJobAgentGetParametersSort"},"CustomerJobAgentResponseAgentsItems":{"type":"object","properties":{"name":{"type":["string","null"],"description":"Name of the agent"},"id":{"type":"string","format":"uuid","description":"Unique identifier of the agent"},"created_at":{"type":["string","null"],"format":"date-time","description":"Timestamp when the agent was created"},"updated_at":{"type":["string","null"],"format":"date-time","description":"Timestamp when the agent was last updated"}},"title":"CustomerJobAgentResponseAgentsItems"},"CustomerJobAgentResponse":{"type":"object","properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/CustomerJobAgentResponseAgentsItems"}},"total":{"type":"number","format":"double","description":"Total number of agents with jobs for this customer"},"offset":{"type":"number","format":"double","description":"Number of records skipped"},"limit":{"type":"number","format":"double","description":"Maximum number of records returned"}},"title":"CustomerJobAgentResponse"},"UpdateJobAgentRequestOutputFieldsItems":{"type":"object","properties":{"key":{"type":"string"},"description":{"type":"string","default":""}},"required":["key"],"title":"UpdateJobAgentRequestOutputFieldsItems"},"UpdateJobAgentRequest":{"type":"object","properties":{"name":{"type":"string","description":"Job agent name. If provided, replaces the existing name."},"agent_role":{"type":"string","description":"How the voice agent should behave (e.g. prescreening interviewer). Not the job/position title. If provided, replaces the agent role."},"introduction":{"type":"string","description":"Introduction text. If provided, replaces the introduction."},"about_job":{"type":"string","description":"About the job. If provided, replaces the about-job section."},"about_company":{"type":"string","description":"About the company. If provided, replaces the about-company section."},"extra_instructions":{"type":"string","description":"Extra instructions. If provided, replaces the extra instructions."},"closing_message":{"type":"string","description":"Closing message. If provided, replaces the closing message."},"questions":{"type":"array","items":{"type":"string"},"description":"Interview questions. If provided, replaces the questions list."},"output_fields":{"type":"array","items":{"$ref":"#/components/schemas/UpdateJobAgentRequestOutputFieldsItems"},"description":"Array of key-description pairs. Each item has key and description only. If provided, replaces the agent's output_fields."},"output_instructions":{"type":"string","description":"Instructions for how to populate output_fields after a call. If provided, replaces the agent's output_instructions."},"webhook_url":{"type":"string","format":"uri","description":"Webhook URL for callbacks (sent on call completed or call failure). Must be a valid URL or null. See [Webhooks](/voice-agents/core-concepts#webhooks) for payload format and when webhooks are sent."},"required_silence_after_speech":{"type":"number","format":"double","minimum":0,"description":"Required silence after speech in seconds"},"allowed_silence_before_nudge":{"type":"number","format":"double","minimum":0,"description":"Allowed silence before nudge in seconds"},"allowed_speech_before_nudge":{"type":"number","format":"double","minimum":0,"description":"Allowed speech before nudge in seconds"},"out_did":{"type":"number","format":"double","description":"Outbound DID number for the agent's phone record"},"allow_call_transfer":{"type":"boolean","description":"India only. When true, live call transfer to a human is allowed."},"transfer_destination_phone":{"type":["string","null"],"pattern":"^[0-9]{10}$","description":"India mobile (10 digits, no +91). Null clears stored transfer destination."}},"description":"At least one field must be provided for update. Fields mirror CreateJobAgentRequest, except generate_from_jd_text is not supported on PATCH.","title":"UpdateJobAgentRequest"},"NudgeUserRequest":{"type":"object","properties":{"message":{"type":"string","description":"Message to send to the user"},"session_id":{"type":"string","description":"Session ID of the active call"},"process_id":{"type":"string","description":"Process ID for tracking"}},"required":["message","session_id","process_id"],"title":"NudgeUserRequest"},"NudgeUserResponse":{"type":"object","properties":{"message":{"type":"string"}},"title":"NudgeUserResponse"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key for authentication. Example: raya_ABCD1234567890abcdef"}}}}