{"components":{"examples":{"agent_not_found":{"summary":"Agent not found.","value":{"detail":"Agent not found.","error":{"code":"agent_not_found","docUrl":"https://docs.callmitra.ai/errors/agent_not_found","message":"Agent not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"agent_state_blocked":{"summary":"The agent cannot make this change yet.","value":{"detail":[{"loc":["body","phone"],"msg":"Field required","type":"missing"}],"error":{"code":"agent_state_blocked","docUrl":"https://docs.callmitra.ai/errors/agent_state_blocked","message":"The agent cannot make this change yet.","param":"phone","requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"agent_test_call_failed":{"summary":"The test call could not be placed.","value":{"detail":"The test call could not be placed.","error":{"code":"agent_test_call_failed","docUrl":"https://docs.callmitra.ai/errors/agent_test_call_failed","message":"The test call could not be placed.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"api_key_expired":{"summary":"The API key has expired.","value":{"detail":"The API key has expired.","error":{"code":"api_key_expired","docUrl":"https://docs.callmitra.ai/errors/api_key_expired","message":"The API key has expired.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"authentication_error"}}},"api_key_scope_denied":{"summary":"The API key does not have the scope required for this request.","value":{"detail":"The API key does not have the scope required for this request.","error":{"code":"api_key_scope_denied","docUrl":"https://docs.callmitra.ai/errors/api_key_scope_denied","message":"The API key does not have the scope required for this request.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"permission_error"}}},"bad_request":{"summary":"The request could not be processed.","value":{"detail":"The request could not be processed.","error":{"code":"bad_request","docUrl":"https://docs.callmitra.ai/errors/bad_request","message":"The request could not be processed.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"call_not_found":{"summary":"Call not found.","value":{"detail":"Call not found.","error":{"code":"call_not_found","docUrl":"https://docs.callmitra.ai/errors/call_not_found","message":"Call not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"call_recording_deleted":{"summary":"This recording was deleted under the data retention policy.","value":{"detail":"This recording was deleted under the data retention policy.","error":{"code":"call_recording_deleted","docUrl":"https://docs.callmitra.ai/errors/call_recording_deleted","message":"This recording was deleted under the data retention policy.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"call_recording_not_found":{"summary":"No recording is available for this call.","value":{"detail":"No recording is available for this call.","error":{"code":"call_recording_not_found","docUrl":"https://docs.callmitra.ai/errors/call_recording_not_found","message":"No recording is available for this call.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"campaign_call_limit_reached":{"summary":"Campaign already has an active call in progress.","value":{"detail":"Campaign already has an active call in progress.","error":{"code":"campaign_call_limit_reached","docUrl":"https://docs.callmitra.ai/errors/campaign_call_limit_reached","message":"Campaign already has an active call in progress.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"campaign_daily_cap_reached":{"summary":"Daily call limit reached for this campaign.","value":{"detail":"Daily call limit reached for this campaign.","error":{"code":"campaign_daily_cap_reached","docUrl":"https://docs.callmitra.ai/errors/campaign_daily_cap_reached","message":"Daily call limit reached for this campaign.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"rate_limit_error"}}},"campaign_default_inbound_exists":{"summary":"Another default inbound campaign already exists for this phone number.","value":{"detail":"Another default inbound campaign already exists for this phone number.","error":{"code":"campaign_default_inbound_exists","docUrl":"https://docs.callmitra.ai/errors/campaign_default_inbound_exists","message":"Another default inbound campaign already exists for this phone number.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"campaign_dial_busy":{"summary":"Campaign dial in progress.","value":{"detail":"Campaign dial in progress.","error":{"code":"campaign_dial_busy","docUrl":"https://docs.callmitra.ai/errors/campaign_dial_busy","message":"Campaign dial in progress.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"campaign_has_no_agent":{"summary":"Campaign has no agent assigned.","value":{"detail":"Campaign has no agent assigned.","error":{"code":"campaign_has_no_agent","docUrl":"https://docs.callmitra.ai/errors/campaign_has_no_agent","message":"Campaign has no agent assigned.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"campaign_leads_need_confirmation":{"summary":"Some leads were already contacted in this campaign.","value":{"detail":"Some leads were already contacted in this campaign.","error":{"code":"campaign_leads_need_confirmation","docUrl":"https://docs.callmitra.ai/errors/campaign_leads_need_confirmation","message":"Some leads were already contacted in this campaign.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"campaign_no_eligible_leads":{"summary":"No leads available for calling.","value":{"detail":"No leads available for calling.","error":{"code":"campaign_no_eligible_leads","docUrl":"https://docs.callmitra.ai/errors/campaign_no_eligible_leads","message":"No leads available for calling.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"campaign_not_found":{"summary":"Campaign not found.","value":{"detail":"Campaign not found.","error":{"code":"campaign_not_found","docUrl":"https://docs.callmitra.ai/errors/campaign_not_found","message":"Campaign not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"campaign_not_ready":{"summary":"The campaign is not ready to start.","value":{"detail":[{"loc":["body","phone"],"msg":"Field required","type":"missing"}],"error":{"code":"campaign_not_ready","docUrl":"https://docs.callmitra.ai/errors/campaign_not_ready","message":"The campaign is not ready to start.","param":"phone","requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"campaign_not_running":{"summary":"Campaign is not active.","value":{"detail":"Campaign is not active.","error":{"code":"campaign_not_running","docUrl":"https://docs.callmitra.ai/errors/campaign_not_running","message":"Campaign is not active.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"carrier_capacity_reached":{"summary":"The phone number or carrier account is at its call limit.","value":{"detail":"The phone number or carrier account is at its call limit.","error":{"code":"carrier_capacity_reached","docUrl":"https://docs.callmitra.ai/errors/carrier_capacity_reached","message":"The phone number or carrier account is at its call limit.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"concurrent_call_limit_reached":{"summary":"Merchant concurrent call limit reached.","value":{"detail":"Merchant concurrent call limit reached.","error":{"code":"concurrent_call_limit_reached","docUrl":"https://docs.callmitra.ai/errors/concurrent_call_limit_reached","message":"Merchant concurrent call limit reached.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"rate_limit_error"}}},"daily_call_limit_reached":{"summary":"Your workspace reached its daily limit for calls placed through the API.","value":{"detail":"Your workspace reached its daily limit for calls placed through the API.","error":{"code":"daily_call_limit_reached","docUrl":"https://docs.callmitra.ai/errors/daily_call_limit_reached","message":"Your workspace reached its daily limit for calls placed through the API.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"rate_limit_error"}}},"destination_not_allowed":{"summary":"Calls to this country are not enabled for your workspace.","value":{"detail":[{"loc":["body","phone"],"msg":"Field required","type":"missing"}],"error":{"code":"destination_not_allowed","docUrl":"https://docs.callmitra.ai/errors/destination_not_allowed","message":"Calls to this country are not enabled for your workspace.","param":"phone","requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"dial_failed":{"summary":"Failed to place outbound call.","value":{"detail":"Failed to place outbound call.","error":{"code":"dial_failed","docUrl":"https://docs.callmitra.ai/errors/dial_failed","message":"Failed to place outbound call.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"api_error"}}},"dial_rejected":{"summary":"The carrier rejected the call.","value":{"detail":"The carrier rejected the call.","error":{"code":"dial_rejected","docUrl":"https://docs.callmitra.ai/errors/dial_rejected","message":"The carrier rejected the call.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"dnc_no_valid_numbers":{"summary":"Add at least one Indian mobile number.","value":{"detail":[{"loc":["body","phone"],"msg":"Field required","type":"missing"}],"error":{"code":"dnc_no_valid_numbers","docUrl":"https://docs.callmitra.ai/errors/dnc_no_valid_numbers","message":"Add at least one Indian mobile number.","param":"phone","requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"idempotency_key_reused":{"summary":"This Idempotency-Key was already used with a different request body.","value":{"detail":"This Idempotency-Key was already used with a different request body.","error":{"code":"idempotency_key_reused","docUrl":"https://docs.callmitra.ai/errors/idempotency_key_reused","message":"This Idempotency-Key was already used with a different request body.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"idempotency_error"}}},"idempotency_request_in_progress":{"summary":"A request with this Idempotency-Key is still being processed.","value":{"detail":"A request with this Idempotency-Key is still being processed.","error":{"code":"idempotency_request_in_progress","docUrl":"https://docs.callmitra.ai/errors/idempotency_request_in_progress","message":"A request with this Idempotency-Key is still being processed.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"idempotency_error"}}},"internal_error":{"summary":"Something went wrong on our side.","value":{"detail":"Something went wrong on our side.","error":{"code":"internal_error","docUrl":"https://docs.callmitra.ai/errors/internal_error","message":"Something went wrong on our side.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"api_error"}}},"invalid_api_key":{"summary":"The API key is invalid or has been revoked.","value":{"detail":"The API key is invalid or has been revoked.","error":{"code":"invalid_api_key","docUrl":"https://docs.callmitra.ai/errors/invalid_api_key","message":"The API key is invalid or has been revoked.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"authentication_error"}}},"invalid_phone_number":{"summary":"The phone number is not valid.","value":{"detail":[{"loc":["body","phone"],"msg":"Field required","type":"missing"}],"error":{"code":"invalid_phone_number","docUrl":"https://docs.callmitra.ai/errors/invalid_phone_number","message":"The phone number is not valid.","param":"phone","requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"lead_call_in_progress":{"summary":"Lead already has an active call.","value":{"detail":"Lead already has an active call.","error":{"code":"lead_call_in_progress","docUrl":"https://docs.callmitra.ai/errors/lead_call_in_progress","message":"Lead already has an active call.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"lead_changed":{"summary":"This lead changed since you opened it.","value":{"detail":"This lead changed since you opened it.","error":{"code":"lead_changed","docUrl":"https://docs.callmitra.ai/errors/lead_changed","message":"This lead changed since you opened it.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"lead_has_no_campaign":{"summary":"Lead is not on a campaign.","value":{"detail":[{"loc":["body","phone"],"msg":"Field required","type":"missing"}],"error":{"code":"lead_has_no_campaign","docUrl":"https://docs.callmitra.ai/errors/lead_has_no_campaign","message":"Lead is not on a campaign.","param":"phone","requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"lead_not_found":{"summary":"Lead not found.","value":{"detail":"Lead not found.","error":{"code":"lead_not_found","docUrl":"https://docs.callmitra.ai/errors/lead_not_found","message":"Lead not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"lead_not_on_campaign":{"summary":"Lead is not on this campaign.","value":{"detail":"Lead is not on this campaign.","error":{"code":"lead_not_on_campaign","docUrl":"https://docs.callmitra.ai/errors/lead_not_on_campaign","message":"Lead is not on this campaign.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"lead_note_changed":{"summary":"This note was changed by someone else.","value":{"detail":"This note was changed by someone else.","error":{"code":"lead_note_changed","docUrl":"https://docs.callmitra.ai/errors/lead_note_changed","message":"This note was changed by someone else.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"lead_note_not_found":{"summary":"Note not found.","value":{"detail":"Note not found.","error":{"code":"lead_note_not_found","docUrl":"https://docs.callmitra.ai/errors/lead_note_not_found","message":"Note not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"lead_note_pin_limit":{"summary":"A lead can have at most 3 pinned notes.","value":{"detail":"A lead can have at most 3 pinned notes.","error":{"code":"lead_note_pin_limit","docUrl":"https://docs.callmitra.ai/errors/lead_note_pin_limit","message":"A lead can have at most 3 pinned notes.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"number_on_dnc":{"summary":"This number is on the DNC list and will not be dialed.","value":{"detail":"This number is on the DNC list and will not be dialed.","error":{"code":"number_on_dnc","docUrl":"https://docs.callmitra.ai/errors/number_on_dnc","message":"This number is on the DNC list and will not be dialed.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"parameter_invalid":{"summary":"One or more parameters are invalid.","value":{"detail":[{"loc":["body","phone"],"msg":"Field required","type":"missing"}],"error":{"code":"parameter_invalid","docUrl":"https://docs.callmitra.ai/errors/parameter_invalid","message":"One or more parameters are invalid.","param":"phone","requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"payload_too_large":{"summary":"The request body is too large.","value":{"detail":"The request body is too large.","error":{"code":"payload_too_large","docUrl":"https://docs.callmitra.ai/errors/payload_too_large","message":"The request body is too large.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"payment_required":{"summary":"Your account does not have enough balance or an active plan for this request.","value":{"detail":"Your account does not have enough balance or an active plan for this request.","error":{"code":"payment_required","docUrl":"https://docs.callmitra.ai/errors/payment_required","message":"Your account does not have enough balance or an active plan for this request.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"billing_error"}}},"permission_denied":{"summary":"You do not have permission to perform this action.","value":{"detail":"You do not have permission to perform this action.","error":{"code":"permission_denied","docUrl":"https://docs.callmitra.ai/errors/permission_denied","message":"You do not have permission to perform this action.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"permission_error"}}},"phone_number_not_dialable":{"summary":"This phone number cannot place calls.","value":{"detail":[{"loc":["body","phone"],"msg":"Field required","type":"missing"}],"error":{"code":"phone_number_not_dialable","docUrl":"https://docs.callmitra.ai/errors/phone_number_not_dialable","message":"This phone number cannot place calls.","param":"phone","requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"phone_number_not_found":{"summary":"Phone number not found.","value":{"detail":"Phone number not found.","error":{"code":"phone_number_not_found","docUrl":"https://docs.callmitra.ai/errors/phone_number_not_found","message":"Phone number not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"rate_limit_exceeded":{"summary":"Too many requests. Slow down and retry later.","value":{"detail":"Too many requests. Slow down and retry later.","error":{"code":"rate_limit_exceeded","docUrl":"https://docs.callmitra.ai/errors/rate_limit_exceeded","message":"Too many requests. Slow down and retry later.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"rate_limit_error"}}},"resource_not_found":{"summary":"The requested resource was not found.","value":{"detail":"The requested resource was not found.","error":{"code":"resource_not_found","docUrl":"https://docs.callmitra.ai/errors/resource_not_found","message":"The requested resource was not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"service_unavailable":{"summary":"The service is temporarily unavailable.","value":{"detail":"The service is temporarily unavailable.","error":{"code":"service_unavailable","docUrl":"https://docs.callmitra.ai/errors/service_unavailable","message":"The service is temporarily unavailable.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"api_error"}}},"sip_trunk_not_found":{"summary":"SIP trunk not found.","value":{"detail":"SIP trunk not found.","error":{"code":"sip_trunk_not_found","docUrl":"https://docs.callmitra.ai/errors/sip_trunk_not_found","message":"SIP trunk not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"ticket_attachment_unavailable":{"summary":"An attachment was already sent or removed.","value":{"detail":"An attachment was already sent or removed.","error":{"code":"ticket_attachment_unavailable","docUrl":"https://docs.callmitra.ai/errors/ticket_attachment_unavailable","message":"An attachment was already sent or removed.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"ticket_edit_forbidden":{"summary":"You can only update tickets assigned to you or unassigned.","value":{"detail":"You can only update tickets assigned to you or unassigned.","error":{"code":"ticket_edit_forbidden","docUrl":"https://docs.callmitra.ai/errors/ticket_edit_forbidden","message":"You can only update tickets assigned to you or unassigned.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"permission_error"}}},"ticket_merged":{"summary":"The ticket was merged into another ticket.","value":{"detail":"The ticket was merged into another ticket.","error":{"code":"ticket_merged","docUrl":"https://docs.callmitra.ai/errors/ticket_merged","message":"The ticket was merged into another ticket.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"ticket_reopen_forbidden":{"summary":"Only a manager can reopen a closed ticket.","value":{"detail":"Only a manager can reopen a closed ticket.","error":{"code":"ticket_reopen_forbidden","docUrl":"https://docs.callmitra.ai/errors/ticket_reopen_forbidden","message":"Only a manager can reopen a closed ticket.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"permission_error"}}},"ticket_reply_blocked":{"summary":"The reply cannot be sent to the customer.","value":{"detail":"The reply cannot be sent to the customer.","error":{"code":"ticket_reply_blocked","docUrl":"https://docs.callmitra.ai/errors/ticket_reply_blocked","message":"The reply cannot be sent to the customer.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"ticket_version_conflict":{"summary":"The ticket was changed since you read it.","value":{"detail":"The ticket was changed since you read it.","error":{"code":"ticket_version_conflict","docUrl":"https://docs.callmitra.ai/errors/ticket_version_conflict","message":"The ticket was changed since you read it.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"tool_not_found":{"summary":"Tool not found.","value":{"detail":"Tool not found.","error":{"code":"tool_not_found","docUrl":"https://docs.callmitra.ai/errors/tool_not_found","message":"Tool not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"unauthenticated":{"summary":"Authentication required.","value":{"detail":"Authentication required.","error":{"code":"unauthenticated","docUrl":"https://docs.callmitra.ai/errors/unauthenticated","message":"Authentication required.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"authentication_error"}}},"webhook_delivery_not_found":{"summary":"Webhook delivery not found.","value":{"detail":"Webhook delivery not found.","error":{"code":"webhook_delivery_not_found","docUrl":"https://docs.callmitra.ai/errors/webhook_delivery_not_found","message":"Webhook delivery not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"webhook_endpoint_disabled":{"summary":"The webhook endpoint is disabled.","value":{"detail":"The webhook endpoint is disabled.","error":{"code":"webhook_endpoint_disabled","docUrl":"https://docs.callmitra.ai/errors/webhook_endpoint_disabled","message":"The webhook endpoint is disabled.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"webhook_endpoint_limit_reached":{"summary":"This workspace already has the maximum number of webhook endpoints.","value":{"detail":"This workspace already has the maximum number of webhook endpoints.","error":{"code":"webhook_endpoint_limit_reached","docUrl":"https://docs.callmitra.ai/errors/webhook_endpoint_limit_reached","message":"This workspace already has the maximum number of webhook endpoints.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"webhook_endpoint_not_found":{"summary":"Webhook endpoint not found.","value":{"detail":"Webhook endpoint not found.","error":{"code":"webhook_endpoint_not_found","docUrl":"https://docs.callmitra.ai/errors/webhook_endpoint_not_found","message":"Webhook endpoint not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"webhook_event_type_unknown":{"summary":"One or more event types are not recognised.","value":{"detail":"One or more event types are not recognised.","error":{"code":"webhook_event_type_unknown","docUrl":"https://docs.callmitra.ai/errors/webhook_event_type_unknown","message":"One or more event types are not recognised.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"webhook_https_required":{"summary":"The webhook URL must use https.","value":{"detail":"The webhook URL must use https.","error":{"code":"webhook_https_required","docUrl":"https://docs.callmitra.ai/errors/webhook_https_required","message":"The webhook URL must use https.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"webhook_url_invalid":{"summary":"The webhook URL is not a valid public URL.","value":{"detail":"The webhook URL is not a valid public URL.","error":{"code":"webhook_url_invalid","docUrl":"https://docs.callmitra.ai/errors/webhook_url_invalid","message":"The webhook URL is not a valid public URL.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}},"webhook_workspace_required":{"summary":"Webhooks are managed inside a workspace.","value":{"detail":"Webhooks are managed inside a workspace.","error":{"code":"webhook_workspace_required","docUrl":"https://docs.callmitra.ai/errors/webhook_workspace_required","message":"Webhooks are managed inside a workspace.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"permission_error"}}},"whatsapp_client_message_id_reused":{"summary":"This message id was already used for a different conversation.","value":{"detail":"This message id was already used for a different conversation.","error":{"code":"whatsapp_client_message_id_reused","docUrl":"https://docs.callmitra.ai/errors/whatsapp_client_message_id_reused","message":"This message id was already used for a different conversation.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"whatsapp_marketing_opted_out":{"summary":"The recipient stopped marketing messages.","value":{"detail":"The recipient stopped marketing messages.","error":{"code":"whatsapp_marketing_opted_out","docUrl":"https://docs.callmitra.ai/errors/whatsapp_marketing_opted_out","message":"The recipient stopped marketing messages.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"whatsapp_number_not_connected":{"summary":"No connected WhatsApp number.","value":{"detail":"No connected WhatsApp number.","error":{"code":"whatsapp_number_not_connected","docUrl":"https://docs.callmitra.ai/errors/whatsapp_number_not_connected","message":"No connected WhatsApp number.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"whatsapp_opt_in_required":{"summary":"Marketing templates need a recorded opt-in.","value":{"detail":"Marketing templates need a recorded opt-in.","error":{"code":"whatsapp_opt_in_required","docUrl":"https://docs.callmitra.ai/errors/whatsapp_opt_in_required","message":"Marketing templates need a recorded opt-in.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"whatsapp_recipient_opted_out":{"summary":"The recipient opted out of WhatsApp messages.","value":{"detail":"The recipient opted out of WhatsApp messages.","error":{"code":"whatsapp_recipient_opted_out","docUrl":"https://docs.callmitra.ai/errors/whatsapp_recipient_opted_out","message":"The recipient opted out of WhatsApp messages.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"whatsapp_template_not_approved":{"summary":"The template is not approved.","value":{"detail":"The template is not approved.","error":{"code":"whatsapp_template_not_approved","docUrl":"https://docs.callmitra.ai/errors/whatsapp_template_not_approved","message":"The template is not approved.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"whatsapp_template_not_found":{"summary":"Template not found.","value":{"detail":"Template not found.","error":{"code":"whatsapp_template_not_found","docUrl":"https://docs.callmitra.ai/errors/whatsapp_template_not_found","message":"Template not found.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"not_found_error"}}},"whatsapp_upstream_throttled":{"summary":"WhatsApp is limiting messages from this number right now.","value":{"detail":"WhatsApp is limiting messages from this number right now.","error":{"code":"whatsapp_upstream_throttled","docUrl":"https://docs.callmitra.ai/errors/whatsapp_upstream_throttled","message":"WhatsApp is limiting messages from this number right now.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"rate_limit_error"}}},"whatsapp_upstream_unavailable":{"summary":"WhatsApp could not take the message right now.","value":{"detail":"WhatsApp could not take the message right now.","error":{"code":"whatsapp_upstream_unavailable","docUrl":"https://docs.callmitra.ai/errors/whatsapp_upstream_unavailable","message":"WhatsApp could not take the message right now.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"api_error"}}},"whatsapp_window_closed":{"summary":"The 24-hour customer service window is closed.","value":{"detail":"The 24-hour customer service window is closed.","error":{"code":"whatsapp_window_closed","docUrl":"https://docs.callmitra.ai/errors/whatsapp_window_closed","message":"The 24-hour customer service window is closed.","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"conflict_error"}}},"workspace_required":{"summary":"Merchant workspace required","value":{"detail":"Merchant workspace required","error":{"code":"workspace_required","docUrl":"https://docs.callmitra.ai/errors/workspace_required","message":"Merchant workspace required","param":null,"requestId":"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69","type":"invalid_request_error"}}}},"headers":{"Idempotent-Replayed":{"description":"`true` when this is the stored response of an earlier request with the same `Idempotency-Key`.","schema":{"enum":["true"],"type":"string"}},"RateLimit-Limit":{"description":"Requests allowed in the current window.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the window resets.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-ID":{"description":"Unique id of this request. Quote it when contacting support.","schema":{"type":"string"}}},"schemas":{"AgencyClient":{"additionalProperties":true,"properties":{"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the client workspace was created (ISO 8601).","title":"Createdat"},"id":{"description":"Client workspace id. Send it as `X-Workspace-Id` to work inside that workspace.","title":"Id","type":"string"},"name":{"description":"Client workspace name.","title":"Name","type":"string"},"status":{"description":"`active`, `suspended` or `blocked`. Only active workspaces accept requests.","title":"Status","type":"string"}},"required":["id","name","status"],"title":"AgencyClient","type":"object"},"AgencyClientList":{"additionalProperties":true,"properties":{"agency":{"$ref":"#/components/schemas/AgencyRef"},"clients":{"description":"Every client workspace, oldest first.","items":{"$ref":"#/components/schemas/AgencyClient"},"title":"Clients","type":"array"},"success":{"const":true,"default":true,"title":"Success","type":"boolean"}},"required":["agency","clients"],"title":"AgencyClientList","type":"object"},"AgencyRef":{"additionalProperties":true,"properties":{"id":{"description":"Your agency workspace id.","title":"Id","type":"string"},"name":{"description":"Your agency workspace name.","title":"Name","type":"string"}},"required":["id","name"],"title":"AgencyRef","type":"object"},"Agent":{"additionalProperties":true,"description":"An AI agent: its live configuration, draft, status and numbers.","properties":{"assignedPhoneNumberId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary phone number id.","title":"Assignedphonenumberid"},"assignedPhoneNumberIds":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Every assigned phone number id.","title":"Assignedphonenumberids"},"assignedPhoneNumbers":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentPhoneNumber"},"type":"array"},{"type":"null"}],"description":"Assigned phone numbers.","title":"Assignedphonenumbers"},"businessFields":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"description":"Editable business details.","title":"Businessfields"},"callDirection":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`inbound`, `outbound` or empty.","title":"Calldirection"},"callObjective":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the calls are for, or empty.","title":"Callobjective"},"callingMode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`instant`, `bulk` or empty.","title":"Callingmode"},"config":{"anyOf":[{"$ref":"#/components/schemas/AgentConfig"},{"type":"null"}],"description":"Published configuration used on calls. Secrets are never included."},"contentLimits":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Length limits for script and knowledge.","title":"Contentlimits"},"contentVersion":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Content format: 3 is the structured script and knowledge.","title":"Contentversion"},"contentWarnings":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Problems found in the script or knowledge.","title":"Contentwarnings"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 creation time.","title":"Createdat"},"draftConfig":{"anyOf":[{"$ref":"#/components/schemas/AgentConfig"},{"type":"null"}],"description":"Working copy: the saved draft, or the published configuration when there is no draft."},"extraLanguage":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Second language, or empty.","title":"Extralanguage"},"hasNumber":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"At least one phone number is assigned.","title":"Hasnumber"},"id":{"description":"Agent id.","title":"Id","type":"string"},"jobRole":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Job title the agent plays.","title":"Jobrole"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary language, for example `hi-IN`.","title":"Language"},"merchantId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Workspace id.","title":"Merchantid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name.","title":"Name"},"rosterState":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`in_training`, `paused`, `ready`, `live` or `archived`.","title":"Rosterstate"},"sourceTemplateId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Template the agent was created from.","title":"Sourcetemplateid"},"sourceTemplateSlug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Slug of that template.","title":"Sourcetemplateslug"},"sourceTemplateVersion":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Version of that template.","title":"Sourcetemplateversion"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lifecycle: `draft`, `published` or `archived`.","title":"Status"},"takingCalls":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Switched on to answer calls (startAgent / pauseAgent).","title":"Takingcalls"},"unpublishedChanges":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"A saved draft is waiting to be published.","title":"Unpublishedchanges"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 last update time.","title":"Updatedat"},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User who created the agent.","title":"Userid"}},"required":["id"],"title":"Agent","type":"object"},"AgentBackgroundSound":{"additionalProperties":true,"description":"Room tone mixed quietly under the agent's voice.","properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Play the background sound on calls.","title":"Enabled"},"preset":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Background sound slug from `GET /background-sounds`, or `off`.","title":"Preset"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Loudness of the background sound.","maximum":1,"minimum":0.02,"title":"Volume"}},"title":"AgentBackgroundSound","type":"object"},"AgentConfig":{"additionalProperties":true,"description":"Agent configuration. Omitted keys keep their current (or default) value.\n\nKeys are snake_case by design: this object is the stored agent config and the\nshape importAgent produces, so it is saved and returned exactly as written here,\nwhile the rest of the API uses camelCase. A known key with a bad value is refused\nwith `parameter_invalid` and a `param` path such as `config.tts_volume`. Unknown keys\nare not refused: they are dropped without an error and do not appear in the saved config.","properties":{"agent_gender":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Voice gender: `female`, `male` or `any`.","title":"Agent Gender"},"agent_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Kind of call the agent runs.","enum":["announcement","awareness","conversation","ivr_survey","survey"],"title":"Agent Mode"},"ai_disclosure":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Tell the caller they are speaking to an AI agent.","title":"Ai Disclosure"},"auto_adapt_language":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Follow the caller when they switch language.","title":"Auto Adapt Language"},"background_sound":{"anyOf":[{"$ref":"#/components/schemas/AgentBackgroundSound"},{"type":"null"}],"description":"Background room tone."},"call_recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Record calls.","title":"Call Recording"},"call_time_limit_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Hard limit on call length.","maximum":3600,"minimum":10,"title":"Call Time Limit Seconds"},"caller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name the agent introduces itself with.","title":"Caller Name"},"calling_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`instant` answers new leads right away; `bulk` runs campaigns; empty means not set.","enum":["","bulk","instant"],"title":"Calling Mode"},"conversation_engine":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Turn-taking engine version.","enum":["v1","v2"],"title":"Conversation Engine"},"extra_language":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Second language the agent may switch to, e.g. `hi-IN`.","title":"Extra Language"},"greeting_message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Shortcut for `template_payload.greeting_message` on write.","title":"Greeting Message"},"interrupt_min_speech_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Caller speech needed to interrupt (time mode).","maximum":2000,"minimum":100,"title":"Interrupt Min Speech Ms"},"interrupt_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"How the caller interrupts the agent: by speaking time or by word count.","enum":["time","words"],"title":"Interrupt Mode"},"interrupt_word_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Caller words needed to interrupt (words mode).","maximum":3,"minimum":1,"title":"Interrupt Word Count"},"interruption_sensitivity":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"How easily the caller can interrupt.","enum":["low","medium","high"],"title":"Interruption Sensitivity"},"job_role":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Job title the agent plays, e.g. `Sales associate`.","title":"Job Role"},"knowledge":{"anyOf":[{"$ref":"#/components/schemas/AgentKnowledgeConfig"},{"type":"null"}],"description":"Structured knowledge."},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary call language code from `GET /voices` languages, e.g. `en-IN`, `hi-IN`.","title":"Language"},"llm_model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language model id, e.g. `gpt-4o-mini`, `gpt-4.1-mini`.","title":"Llm Model"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Longest reply in tokens.","maximum":32000,"minimum":1,"title":"Max Tokens"},"noise_reduction":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Background noise filtering.","enum":["off","standard","strong"],"title":"Noise Reduction"},"post_call_webhook":{"anyOf":[{"$ref":"#/components/schemas/AgentPostCallWebhookConfig"},{"type":"null"}],"description":"Post-call webhook. Prefer setAgentPostCallWebhook, which also stores the signing secret."},"realtime_model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Realtime speech model when `voice_engine` is not pipeline.","title":"Realtime Model"},"realtime_voice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Realtime voice when `voice_engine` is not pipeline.","title":"Realtime Voice"},"reasoning_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reasoning effort for models that support it; lower is faster.","enum":["none","minimal","low","medium","high","xhigh","max"],"title":"Reasoning Effort"},"recording_notice":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Tell the caller the call is recorded.","title":"Recording Notice"},"required_fields":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"description":"Values to collect on the call, as `{key, label, type}` objects.","title":"Required Fields"},"script":{"anyOf":[{"$ref":"#/components/schemas/AgentScriptConfig"},{"type":"null"}],"description":"Structured call script."},"stt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Speech-to-text provider id from the active catalog, for example `deepgram` or `sarvam`. An id that is not active is refused with `parameter_invalid`.","title":"Stt"},"success_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What counts as a successful call, for call analysis.","title":"Success Criteria"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Shortcut for `template_payload.system_prompt` on write.","title":"System Prompt"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Sampling temperature.","maximum":2,"minimum":0,"title":"Temperature"},"template_payload":{"anyOf":[{"$ref":"#/components/schemas/AgentPromptContent"},{"type":"null"}],"description":"Free-form prompt content (system prompt, greeting, knowledge text)."},"tone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Speaking style, e.g. `natural`, `friendly`, `formal`.","title":"Tone"},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentToolConfig"},"type":"array"},{"type":"null"}],"description":"Tools the agent may use (at most 32).","title":"Tools"},"tts":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Text-to-speech provider id from `GET /voices` providers.","title":"Tts"},"tts_speed":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Speaking speed; 1.0 is normal.","maximum":1.5,"minimum":0.5,"title":"Tts Speed"},"tts_volume":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Voice loudness; 1.0 is full.","maximum":1,"minimum":0.2,"title":"Tts Volume"},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Voice id (`voiceId`) from `GET /voices` for the `tts` provider.","title":"Voice"},"voice_engine":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`pipeline` uses separate speech-to-text, model and voice; the others use a single realtime speech model.","enum":["pipeline","gemini_live","openai_realtime","elevenlabs_agents"],"title":"Voice Engine"}},"title":"AgentConfig","type":"object"},"AgentCreateInput":{"description":"A new agent. It starts as a draft unless `status` is `published`.","properties":{"config":{"$ref":"#/components/schemas/AgentConfig","description":"Agent configuration."},"name":{"default":"","description":"Display name; also the name the agent introduces itself with.","maxLength":255,"title":"Name","type":"string"},"sourceTemplateId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Template id this agent is based on.","title":"Sourcetemplateid"},"sourceTemplateSlug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Template slug this agent is based on.","title":"Sourcetemplateslug"},"sourceTemplateVersion":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Template version this agent is based on.","title":"Sourcetemplateversion"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`draft` (default) or `published`.","enum":["draft","published"],"title":"Status"}},"title":"AgentCreateInput","type":"object"},"AgentDeleteResponse":{"additionalProperties":true,"description":"The agent was deleted.","properties":{"message":{"default":"Agent deleted","description":"Human-readable confirmation.","title":"Message","type":"string"},"success":{"default":true,"description":"Always true on success.","title":"Success","type":"boolean"}},"title":"AgentDeleteResponse","type":"object"},"AgentImportInput":{"description":"An agent exported from another platform.","properties":{"config":{"additionalProperties":true,"description":"The exported JSON: a Vapi assistant, a Retell agent (with its LLM as `llm`), a Bland call or agent configuration, or a Call Mitra agent from getAgent.","title":"Config","type":"object"},"source":{"description":"Platform the JSON comes from.","enum":["vapi","retell","bland","callmitra"],"title":"Source","type":"string"}},"required":["source","config"],"title":"AgentImportInput","type":"object"},"AgentImportResponse":{"additionalProperties":true,"description":"The new draft agent and what could not be carried over.","properties":{"agent":{"$ref":"#/components/schemas/Agent"},"success":{"default":true,"description":"Always true on success.","title":"Success","type":"boolean"},"warnings":{"items":{"$ref":"#/components/schemas/AgentImportWarning"},"title":"Warnings","type":"array"}},"required":["agent"],"title":"AgentImportResponse","type":"object"},"AgentImportWarning":{"description":"A field that was not imported or was approximated.","properties":{"field":{"description":"Field path in the JSON you sent, for example `voice.voiceId`.","title":"Field","type":"string"},"message":{"description":"What happened to it.","title":"Message","type":"string"}},"required":["field","message"],"title":"AgentImportWarning","type":"object"},"AgentKnowledgeConfig":{"additionalProperties":true,"description":"Facts and answers the agent can use during the call.","properties":{"details":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"description":"Business details as `{key, label, value}` objects.","title":"Details"},"items":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"description":"Knowledge items as `{kind, q, text}`; kind is fact, qa, rule or objection.","title":"Items"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Free-text notes the agent may use.","title":"Notes"}},"title":"AgentKnowledgeConfig","type":"object"},"AgentLeaderboardRow":{"additionalProperties":true,"properties":{"agentId":{"description":"Agent id; empty for calls without an agent.","title":"Agentid","type":"string"},"calls":{"title":"Calls","type":"integer"},"connected":{"title":"Connected","type":"integer"},"minutes":{"description":"Billable minutes.","title":"Minutes","type":"integer"},"name":{"description":"Agent name.","title":"Name","type":"string"},"qualified":{"title":"Qualified","type":"integer"}},"required":["agentId","name","calls","connected","qualified","minutes"],"title":"AgentLeaderboardRow","type":"object"},"AgentListResponse":{"additionalProperties":true,"description":"Agents in the workspace, newest first.","properties":{"agents":{"items":{"$ref":"#/components/schemas/Agent"},"title":"Agents","type":"array"},"success":{"default":true,"description":"Always true on success.","title":"Success","type":"boolean"}},"required":["agents"],"title":"AgentListResponse","type":"object"},"AgentPhoneNumber":{"additionalProperties":true,"description":"A phone number this agent calls from or answers on.","properties":{"e164":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Number in E.164 format.","title":"E164"},"id":{"description":"Phone number id.","title":"Id","type":"string"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display label.","title":"Label"},"maxConcurrentCalls":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Calls this number may carry at once.","title":"Maxconcurrentcalls"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Carrier.","title":"Provider"}},"required":["id"],"title":"AgentPhoneNumber","type":"object"},"AgentPostCallWebhookConfig":{"additionalProperties":true,"description":"Where the call summary is sent after each call (read; set it with setAgentPostCallWebhook).","properties":{"trigger":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Which calls are sent.","enum":["completed","every","voicemail"],"title":"Trigger"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"HTTPS endpoint that receives the call summary.","title":"Url"}},"title":"AgentPostCallWebhookConfig","type":"object"},"AgentPostCallWebhookResponse":{"additionalProperties":true,"description":"The agent and its updated post-call webhook.","properties":{"agent":{"$ref":"#/components/schemas/Agent"},"success":{"default":true,"description":"Always true on success.","title":"Success","type":"boolean"},"webhook":{"$ref":"#/components/schemas/PostCallWebhookSettings"}},"required":["agent","webhook"],"title":"AgentPostCallWebhookResponse","type":"object"},"AgentPromptContent":{"additionalProperties":true,"description":"Free-form prompt content: system prompt, greeting and knowledge text.","properties":{"greeting_message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opening line spoken when the call connects.","title":"Greeting Message"},"knowledge_base":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reference text the agent may quote from.","title":"Knowledge Base"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Instructions for the language model.","title":"System Prompt"}},"title":"AgentPromptContent","type":"object"},"AgentResponse":{"additionalProperties":true,"description":"One agent.","properties":{"agent":{"$ref":"#/components/schemas/Agent"},"success":{"default":true,"description":"Always true on success.","title":"Success","type":"boolean"}},"required":["agent"],"title":"AgentResponse","type":"object"},"AgentScriptConfig":{"additionalProperties":true,"description":"Structured call script: opening line, goal, steps and closing.","properties":{"ask_first_question_in_greeting":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Ask the first step's question in the opening line.","title":"Ask First Question In Greeting"},"closing":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last thing the agent says before hanging up.","title":"Closing"},"end_rules":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"When the agent should end the call.","title":"End Rules"},"goal":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What a successful call achieves.","title":"Goal"},"opening":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First thing the agent says when the call connects.","title":"Opening"},"steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentScriptStep"},"type":"array"},{"type":"null"}],"description":"Ordered steps the agent follows.","title":"Steps"},"strictness":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"How closely the agent sticks to the steps.","enum":["flexible","balanced","strict"],"title":"Strictness"}},"title":"AgentScriptConfig","type":"object"},"AgentScriptStep":{"additionalProperties":true,"description":"One step of the call plan, in order.","properties":{"instruction":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the agent does or asks in this step.","title":"Instruction"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Short step title.","title":"Name"}},"title":"AgentScriptStep","type":"object"},"AgentTestCallIn":{"description":"Place a test call from one of your numbers.","properties":{"destination":{"description":"E.164 or local number to dial.","minLength":3,"title":"Destination","type":"string"},"dynamicValues":{"additionalProperties":true,"description":"Values for the script's placeholders, e.g. `{\"name\": \"Asha\"}`.","title":"Dynamicvalues","type":"object"},"phoneNumberId":{"description":"Your phone number id to call from.","minLength":1,"title":"Phonenumberid","type":"string"}},"required":["phoneNumberId","destination"],"title":"AgentTestCallIn","type":"object"},"AgentTestCallResponse":{"additionalProperties":true,"description":"The test call was placed.","properties":{"callId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Id of the call; read it with getCall.","title":"Callid"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable status.","title":"Message"},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Number being dialed, in E.164 format.","title":"Phonenumber"},"success":{"default":true,"description":"Always true on success.","title":"Success","type":"boolean"}},"title":"AgentTestCallResponse","type":"object"},"AgentToolConfig":{"additionalProperties":true,"description":"A tool the agent may use during calls (end call, transfer, HTTP request, ...).","properties":{"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Tool settings, for example `{\"phone_number\": \"+9198...\"}` for transfer_call or `{\"url\": ..., \"method\": ...}` for api_request.","title":"Config"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the model should use the tool.","title":"Description"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Tool is offered to the model.","title":"Enabled"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Tool type.","enum":["end_call","transfer_call","api_request","function","mcp","lookup_open_tickets","create_ticket","add_ticket_note","schedule_callback","send_whatsapp"],"title":"Kind"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name the model uses to call the tool.","title":"Name"}},"title":"AgentToolConfig","type":"object"},"AgentUpdateInput":{"description":"Fields to change. The change is saved as a draft; publish it with publishAgent.","properties":{"config":{"anyOf":[{"$ref":"#/components/schemas/AgentConfig"},{"type":"null"}],"description":"Config keys to change; omitted keys keep their current value. Nested objects are replaced."},"name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"description":"New display name.","title":"Name"}},"title":"AgentUpdateInput","type":"object"},"Call":{"additionalProperties":true,"description":"One call: who, when, how it went, and what the agent collected.","properties":{"agentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Agent that spoke on the call.","title":"Agentid"},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Agent's name.","title":"Agentname"},"billableMinutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Minutes charged for the call.","title":"Billableminutes"},"billedInr":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Amount charged for the call, in rupees.","title":"Billedinr"},"callAnalysis":{"description":"Post-call analysis object, when the agent has it on.","title":"Callanalysis"},"callType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`manual`, `campaign`, `inbound` or `browser`.","title":"Calltype"},"campaignId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Campaign the call belongs to (empty for inbound and test calls).","title":"Campaignid"},"campaignName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Campaign's name.","title":"Campaignname"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`instant`, `bulk`, `inbound` or `browser`.","title":"Channel"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the call row was created (ISO 8601).","title":"Createdat"},"duration":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Talk time in seconds.","title":"Duration"},"endTime":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the call ended (ISO 8601).","title":"Endtime"},"endedReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the call ended, for example `customer-ended-call`.","title":"Endedreason"},"extractedFields":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Details the agent collected, keyed by your capture fields.","title":"Extractedfields"},"failureReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the call failed, when it did.","title":"Failurereason"},"fromNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Caller ID used for an outbound call.","title":"Fromnumber"},"hasRecording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Download it from `GET /calls/{callId}/recording`.","title":"Hasrecording"},"id":{"description":"Call ID.","title":"Id","type":"string"},"isEscalated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"The call was transferred to a person.","title":"Isescalated"},"leadId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead called (empty for browser test calls).","title":"Leadid"},"leadName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead's name.","title":"Leadname"},"merchantOutcome":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The outcome shown in the console: `qualified`, `interested`, `callback`, `not_interested`, `no_response`, `no_answer`, `busy`, `call_failed` or `voicemail`.","title":"Merchantoutcome"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"The `metadata` you sent with `POST /calls`, returned unchanged.","title":"Metadata"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`successful` or `failed`.","title":"Outcome"},"outcomeCategory":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Detailed disposition, for example `interested`, `callback_requested`, `voicemail`.","title":"Outcomecategory"},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The other party's number.","title":"Phonenumber"},"phoneNumberId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your phone number the call used.","title":"Phonenumberid"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`positive`, `neutral`, `negative`, or empty.","title":"Sentiment"},"startTime":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the call started (ISO 8601).","title":"Starttime"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`initiated`, `ringing`, `answered`, `completed`, `no_answer`, `busy` or `failed`.","title":"Status"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"AI summary written after the call.","title":"Summary"},"toolInvocations":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"description":"Tools the agent called during the call.","title":"Toolinvocations"},"transcript":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`User:` / `Assistant:` lines. Parsed turns: `GET /calls/{callId}/transcript`.","title":"Transcript"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last change (ISO 8601).","title":"Updatedat"},"whatsappSent":{"anyOf":[{"items":{"$ref":"#/components/schemas/CallWhatsAppSend"},"type":"array"},{"type":"null"}],"description":"WhatsApp messages the agent sent on this call, oldest first. Only on `GET /calls/{callId}`.","title":"Whatsappsent"}},"required":["id"],"title":"Call","type":"object"},"CallDailyCounts":{"additionalProperties":true,"properties":{"daily":{"description":"One entry per day, oldest first; days without calls are zeros.","items":{"$ref":"#/components/schemas/CallDayCount"},"title":"Daily","type":"array"},"days":{"description":"Days covered, ending today.","title":"Days","type":"integer"},"success":{"default":true,"title":"Success","type":"boolean"},"timezone":{"description":"Timezone that decides where a day starts (IANA name).","title":"Timezone","type":"string"},"totals":{"$ref":"#/components/schemas/CallDayTotals"}},"required":["days","timezone","totals","daily"],"title":"CallDailyCounts","type":"object"},"CallDayCount":{"additionalProperties":true,"properties":{"avgDurationSeconds":{"description":"Average length of the completed calls, in seconds.","title":"Avgdurationseconds","type":"number"},"completed":{"description":"Calls that ended normally.","title":"Completed","type":"integer"},"date":{"description":"Calendar day (YYYY-MM-DD) in the report timezone.","title":"Date","type":"string"},"failed":{"description":"Calls that failed.","title":"Failed","type":"integer"},"noAnswer":{"description":"Calls nobody answered.","title":"Noanswer","type":"integer"},"total":{"description":"Calls created that day.","title":"Total","type":"integer"}},"required":["date","total","completed","failed","noAnswer","avgDurationSeconds"],"title":"CallDayCount","type":"object"},"CallDayTotals":{"additionalProperties":true,"properties":{"avgDurationSeconds":{"description":"Average length of the completed calls, in seconds.","title":"Avgdurationseconds","type":"number"},"completed":{"title":"Completed","type":"integer"},"failed":{"title":"Failed","type":"integer"},"noAnswer":{"title":"Noanswer","type":"integer"},"total":{"description":"Calls in the whole range.","title":"Total","type":"integer"}},"required":["total","completed","failed","noAnswer","avgDurationSeconds"],"title":"CallDayTotals","type":"object"},"CallEnvelope":{"additionalProperties":true,"description":"One call.","properties":{"call":{"$ref":"#/components/schemas/Call","description":"The call."},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["call"],"title":"CallEnvelope","type":"object"},"CallList":{"additionalProperties":true,"description":"A page of calls, newest first.","properties":{"calls":{"description":"Calls on this page, newest first.","items":{"$ref":"#/components/schemas/Call"},"title":"Calls","type":"array"},"hasMore":{"default":false,"description":"True when another page follows.","title":"Hasmore","type":"boolean"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` to get the next page; null on the last page or in page mode.","title":"Nextcursor"},"pagination":{"$ref":"#/components/schemas/Pagination"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["calls","pagination"],"title":"CallList","type":"object"},"CallNowIn":{"properties":{"campaignId":{"description":"A running campaign the lead belongs to; its agent and numbers are used.","title":"Campaignid","type":"string"},"leadId":{"description":"Lead to call. It must be on the campaign and not on do-not-call.","title":"Leadid","type":"string"}},"required":["leadId","campaignId"],"title":"CallNowIn","type":"object"},"CallPerformance":{"additionalProperties":true,"properties":{"byChannel":{"additionalProperties":{"type":"integer"},"description":"Calls per channel: `instant`, `bulk`, `inbound`, `browser`, or `unknown`.","title":"Bychannel","type":"object"},"byHour":{"additionalProperties":{"type":"integer"},"description":"Calls per hour of day (`0` to `23`, report timezone); empty hours are left out.","title":"Byhour","type":"object"},"byOutcome":{"additionalProperties":{"type":"integer"},"description":"Calls per outcome: `qualified`, `interested`, `callback`, `not_interested`, `no_response`, `no_answer`, `busy`, `call_failed` or `voicemail`.","title":"Byoutcome","type":"object"},"funnel":{"$ref":"#/components/schemas/CallPerformanceFunnel"},"includeTests":{"description":"Whether test calls from the console are counted.","title":"Includetests","type":"boolean"},"kpis":{"$ref":"#/components/schemas/CallPerformanceKpis"},"leaderboard":{"description":"Agents, most qualified calls first.","items":{"$ref":"#/components/schemas/AgentLeaderboardRow"},"title":"Leaderboard","type":"array"},"prior":{"$ref":"#/components/schemas/CallPerformancePrior"},"rangeDays":{"description":"Days covered: 7, 30 or 90.","title":"Rangedays","type":"integer"},"recent":{"$ref":"#/components/schemas/CallPerformanceRecent"},"success":{"default":true,"title":"Success","type":"boolean"}},"required":["rangeDays","includeTests","kpis","prior","recent","funnel","byChannel","byOutcome","byHour","leaderboard"],"title":"CallPerformance","type":"object"},"CallPerformanceFunnel":{"additionalProperties":true,"properties":{"calls":{"title":"Calls","type":"integer"},"connected":{"title":"Connected","type":"integer"},"qualified":{"title":"Qualified","type":"integer"}},"required":["calls","connected","qualified"],"title":"CallPerformanceFunnel","type":"object"},"CallPerformanceKpis":{"additionalProperties":true,"properties":{"avgLengthSeconds":{"description":"Average length of connected calls, in seconds.","title":"Avglengthseconds","type":"number"},"calls":{"description":"Calls in the range.","title":"Calls","type":"integer"},"connectRate":{"description":"Share of calls that connected (0 to 1).","title":"Connectrate","type":"number"},"conversion":{"description":"Share of connected calls whose outcome is `qualified` or `interested` (0 to 1).","title":"Conversion","type":"number"},"leads":{"description":"Distinct leads called.","title":"Leads","type":"integer"},"minutesUsed":{"description":"Billable minutes.","title":"Minutesused","type":"integer"},"successRate":{"description":"Share of connected calls the agent marked successful (0 to 1).","title":"Successrate","type":"number"}},"required":["calls","connectRate","conversion","avgLengthSeconds","leads","successRate","minutesUsed"],"title":"CallPerformanceKpis","type":"object"},"CallPerformancePrior":{"additionalProperties":true,"properties":{"calls":{"description":"Calls in the range just before this one, for comparison.","title":"Calls","type":"integer"},"connectRate":{"title":"Connectrate","type":"number"},"conversion":{"title":"Conversion","type":"number"}},"required":["calls","connectRate","conversion"],"title":"CallPerformancePrior","type":"object"},"CallPerformanceRecent":{"additionalProperties":true,"properties":{"last24h":{"title":"Last24H","type":"integer"},"lastHour":{"title":"Lasthour","type":"integer"},"today":{"description":"Calls since midnight in the report timezone.","title":"Today","type":"integer"}},"required":["today","lastHour","last24h"],"title":"CallPerformanceRecent","type":"object"},"CallTranscript":{"additionalProperties":true,"description":"The call's conversation as text and as turns.","properties":{"callId":{"description":"Call ID.","title":"Callid","type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Call status; the transcript is final once the call has ended.","title":"Status"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"toolInvocations":{"description":"Tools the agent called during the call.","items":{},"title":"Toolinvocations","type":"array"},"transcript":{"description":"`User:` / `Assistant:` lines, empty when nothing was said.","title":"Transcript","type":"string"},"turns":{"description":"The same conversation split into turns, in order.","items":{"$ref":"#/components/schemas/TranscriptTurn"},"title":"Turns","type":"array"}},"required":["callId","transcript","turns","toolInvocations"],"title":"CallTranscript","type":"object"},"CallWhatsAppSend":{"additionalProperties":true,"description":"A WhatsApp message the agent sent during the call.","properties":{"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the agent asked to send it (ISO 8601).","title":"Createdat"},"error":{"description":"Why it failed or was skipped; empty otherwise.","title":"Error","type":"string"},"id":{"description":"Send ID.","title":"Id","type":"string"},"kind":{"description":"`template` or `text`.","title":"Kind","type":"string"},"status":{"description":"`pending`, `sent`, `delivered`, `read`, `failed`, `skipped` or `cancelled`.","title":"Status","type":"string"},"statusAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When WhatsApp last reported a status (ISO 8601).","title":"Statusat"},"template":{"description":"Template name; empty for a plain text message.","title":"Template","type":"string"}},"required":["id","template","kind","status","error"],"title":"CallWhatsAppSend","type":"object"},"Campaign":{"additionalProperties":true,"description":"A set of leads one agent calls on a schedule (outbound), or a routing rule for incoming calls (inbound).","properties":{"agentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Agent that makes the calls, or empty.","title":"Agentid"},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"That agent's name.","title":"Agentname"},"autoDialEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"False while dialing is paused.","title":"Autodialenabled"},"budget":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Budget in rupees; 0 when none is set.","title":"Budget"},"connectedCalls":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Connected leads when last counted.","title":"Connectedcalls"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the campaign was created.","format":"date-time","title":"Createdat"},"crmWebhookSecretSet":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether a signing secret is saved (never returned).","title":"Crmwebhooksecretset"},"crmWebhookUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where this campaign's call results are sent, or empty.","title":"Crmwebhookurl"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Free-text description.","title":"Description"},"dialHealth":{"anyOf":[{"$ref":"#/components/schemas/CampaignDialHealth"},{"type":"null"}],"description":"Running campaigns in lists only."},"dialStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When dialing last started.","format":"date-time","title":"Dialstartedat"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`outbound` or `inbound`.","title":"Direction"},"endDate":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Planned end date as entered, or empty.","title":"Enddate"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Campaign ID.","title":"Id"},"isActive":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True while the campaign is running.","title":"Isactive"},"isDefaultInbound":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Inbound only: takes calls no other campaign matches.","title":"Isdefaultinbound"},"leadSource":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"How the leads were added: `type`, `name`, `id`.","title":"Leadsource"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Campaign name.","title":"Name"},"phoneNumberId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary caller ID, or empty.","title":"Phonenumberid"},"phoneNumberIds":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Every number the campaign calls from.","title":"Phonenumberids"},"phoneNumberLabel":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Label of the primary caller ID.","title":"Phonenumberlabel"},"phoneNumberLabels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Their labels, same order.","title":"Phonenumberlabels"},"phoneNumbers":{"anyOf":[{"items":{"$ref":"#/components/schemas/CampaignCallerNumber"},"type":"array"},{"type":"null"}],"description":"Those numbers in detail.","title":"Phonenumbers"},"settings":{"anyOf":[{"$ref":"#/components/schemas/CampaignSettings"},{"type":"null"}],"description":"Dialing rules."},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Planned start date as entered, or empty.","title":"Startdate"},"stats":{"anyOf":[{"$ref":"#/components/schemas/CampaignStats"},{"type":"null"}],"description":"Live progress."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display status, for example `draft`, `active` or `completed`.","title":"Status"},"successRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Connected percentage when last counted.","title":"Successrate"},"totalLeads":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads on the campaign when it was last counted.","title":"Totalleads"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last change.","format":"date-time","title":"Updatedat"}},"title":"Campaign","type":"object"},"CampaignActiveCall":{"additionalProperties":true,"description":"A campaign call in progress.","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Call ID.","title":"Id"},"leadId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead being called.","title":"Leadid"},"phoneNumberId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Number the call is placed from.","title":"Phonenumberid"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Call status.","title":"Status"}},"title":"CampaignActiveCall","type":"object"},"CampaignCallerNumber":{"additionalProperties":true,"description":"One of the numbers the campaign calls from.","properties":{"e164":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The number in E.164 form.","title":"E164"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Phone number ID.","title":"Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Label shown in the console.","title":"Label"},"maxConcurrentCalls":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Calls this number may carry at once.","title":"Maxconcurrentcalls"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Carrier, for example `plivo` or `twilio`.","title":"Provider"}},"title":"CampaignCallerNumber","type":"object"},"CampaignCreatedWithLeads":{"additionalProperties":true,"description":"The new campaign's ID and how many leads it holds.","properties":{"campaignId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ID of the new campaign.","title":"Campaignid"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable confirmation.","title":"Message"},"processedLeads":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads added to the campaign.","title":"Processedleads"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"CampaignCreatedWithLeads","type":"object"},"CampaignDeleted":{"additionalProperties":true,"description":"Confirms the delete.","properties":{"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable confirmation.","title":"Message"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"CampaignDeleted","type":"object"},"CampaignDialHealth":{"additionalProperties":true,"description":"Short dialing state of a running campaign (list responses only).","properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why calls are not being placed, when they are not.","title":"Code"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The same, as a sentence.","title":"Message"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Dialing state, for example `dialing`, `waiting` or `paused`.","title":"State"}},"title":"CampaignDialHealth","type":"object"},"CampaignDialStatus":{"additionalProperties":true,"description":"Whether the campaign is placing calls right now and, if not, why and when it will.","properties":{"activeCall":{"anyOf":[{"$ref":"#/components/schemas/CampaignActiveCall"},{"type":"null"}],"description":"First call in progress, or null."},"activeCallCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Calls in progress.","title":"Activecallcount"},"activeCalls":{"anyOf":[{"items":{"$ref":"#/components/schemas/CampaignActiveCall"},"type":"array"},{"type":"null"}],"description":"Every call in progress.","title":"Activecalls"},"autoDialEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Dialing is not paused.","title":"Autodialenabled"},"callsToday":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Calls placed today, in the dial time zone.","title":"Callstoday"},"dialState":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Dialing state, for example `dialing`, `waiting` or `paused`.","title":"Dialstate"},"dialTimezone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time zone of the dial window.","title":"Dialtimezone"},"dialWindowEnd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end, `HH:MM`.","title":"Dialwindowend"},"dialWindowStart":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start, `HH:MM`.","title":"Dialwindowstart"},"dialingAllowed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Calls may be placed right now.","title":"Dialingallowed"},"inDialWindow":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Now is inside the dial window and days.","title":"Indialwindow"},"isActive":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"The campaign is running.","title":"Isactive"},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last dialing error as reported, or null.","title":"Lasterror"},"lastErrorAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the last dialing error happened.","format":"date-time","title":"Lasterrorat"},"lastErrorCode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Code of the last dialing error, or null.","title":"Lasterrorcode"},"lastErrorMessage":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The last dialing error as a sentence, or null.","title":"Lasterrormessage"},"maxCallsPerDay":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Daily limit.","title":"Maxcallsperday"},"nextEligibleDialAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Earliest time a lead is due for a call.","format":"date-time","title":"Nexteligibledialat"},"nextJobRunAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Next scheduled dial round.","format":"date-time","title":"Nextjobrunat"},"nextWindowOpenAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the window opens next, when outside it.","format":"date-time","title":"Nextwindowopenat"},"pendingJobCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Dial rounds waiting to run.","title":"Pendingjobcount"},"providerBlocked":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"The carrier is refusing calls until you act.","title":"Providerblocked"},"skipReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why calls are not being placed, for example `outside_window` or `daily_cap`.","title":"Skipreason"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"CampaignDialStatus","type":"object"},"CampaignDialingChanged":{"additionalProperties":true,"description":"Dialing was paused or resumed.","properties":{"cancelledJobs":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Pause only: scheduled dial rounds that were cancelled.","title":"Cancelledjobs"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable confirmation.","title":"Message"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"CampaignDialingChanged","type":"object"},"CampaignInput":{"additionalProperties":true,"description":"Campaign fields to create or change. On update, send only the fields to change.","properties":{"agentId":{"description":"The agent that makes the calls.","format":"uuid","title":"Agentid","type":"string"},"crmWebhookSecret":{"description":"Secret used to sign those webhooks. Never returned.","title":"Crmwebhooksecret","type":"string"},"crmWebhookUrl":{"description":"Public HTTPS URL that receives this campaign's call results; empty clears it.","format":"uri","title":"Crmwebhookurl","type":"string"},"description":{"description":"Free-text description.","title":"Description","type":"string"},"direction":{"default":"outbound","description":"`outbound` (call leads) or `inbound` (answer calls).","enum":["outbound","inbound"],"title":"Direction","type":"string"},"endDate":{"description":"Planned end date, free text.","title":"Enddate","type":"string"},"isActive":{"description":"Update only: `true` starts the campaign, `false` stops it (same checks as start and stop).","title":"Isactive","type":"boolean"},"isDefaultInbound":{"description":"Inbound only: take calls to the number that no other campaign matches.","title":"Isdefaultinbound","type":"boolean"},"name":{"description":"Campaign name. Defaults to `Untitled`.","title":"Name","type":"string"},"phoneNumberId":{"description":"Caller ID. Required for inbound campaigns. Defaults to the agent's assigned number.","format":"uuid","title":"Phonenumberid","type":"string"},"phoneNumberIds":{"description":"Every number to call from, in order; the first is the primary caller ID.","items":{"format":"uuid","type":"string"},"title":"Phonenumberids","type":"array"},"settings":{"anyOf":[{"$ref":"#/components/schemas/CampaignSettings"},{"type":"null"}],"description":"Dialing rules; merged into the current ones."},"startDate":{"description":"Planned start date, free text (for example `2026-12-01`).","title":"Startdate","type":"string"},"status":{"description":"Display status to set, for example `draft`.","title":"Status","type":"string"}},"title":"CampaignInput","type":"object"},"CampaignLead":{"additionalProperties":true,"description":"A lead with its state in this campaign.","properties":{"assignedToUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team member who owns the lead, or null.","title":"Assignedtouserid"},"assigneeName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"That team member's name.","title":"Assigneename"},"attributeIssues":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Values that did not fit their field's type, kept aside: `{key: {raw, reason, at}}`.","title":"Attributeissues"},"attributes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Current profile facts, for example `{\"ward_no\": \"8\", \"age\": 31}`.","title":"Attributes"},"callAttempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Calls attempted so far.","title":"Callattempts"},"callStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Latest dialing state, for example `not_called`, `calling`, `called`, `no_answer`.","title":"Callstatus"},"callSummary":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Summary of that call, or empty.","title":"Callsummary"},"campaignCallStatus":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Per-campaign dialing state keyed by campaign ID: status, attempts, lastAttempt, nextScheduled.","title":"Campaigncallstatus"},"campaignIds":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Campaigns the lead is in.","title":"Campaignids"},"campaignNames":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Names of those campaigns, same order.","title":"Campaignnames"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Company name.","title":"Company"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the lead was created.","format":"date-time","title":"Createdat"},"dncOptOut":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when the number must never be dialed.","title":"Dncoptout"},"dncReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the lead is on do-not-call.","title":"Dncreason"},"dncUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When do-not-call last changed.","format":"date-time","title":"Dncupdatedat"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email address.","title":"Email"},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your business id (EPIC, patient id, order id). Unique inside a lead source.","title":"Externalid"},"extractedFieldLabels":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Display labels for those fields.","title":"Extractedfieldlabels"},"extractedFields":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Fields the agent captured on that call.","title":"Extractedfields"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead ID.","title":"Id"},"lastCallAttempt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the last call was attempted.","format":"date-time","title":"Lastcallattempt"},"lastCallId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last call to the lead in this campaign, or empty.","title":"Lastcallid"},"lastContactDate":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last time the lead was reached.","format":"date-time","title":"Lastcontactdate"},"lastSentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sentiment of the lead's last call in this campaign.","title":"Lastsentiment"},"leadSourceId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead source the lead belongs to, or empty.","title":"Leadsourceid"},"merchantOutcome":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Outcome of the latest result, for example `interested`, `callback` or `no_answer`.","title":"Merchantoutcome"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Full name.","title":"Name"},"nextCallScheduled":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the next automatic attempt is due.","format":"date-time","title":"Nextcallscheduled"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Deprecated: use the notes endpoints. The latest 20 notes as text, newest first; only on single-lead responses.","title":"Notes"},"notesCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Live notes on the lead.","title":"Notescount"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Phone number as stored.","title":"Phone"},"pinnedNotePreview":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start of the newest pinned note.","title":"Pinnednotepreview"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Same, falling back to the call's analysis.","title":"Sentiment"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where the lead came from.","title":"Source"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pipeline status key, one of your workspace's statuses (default `new`).","title":"Status"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Tags on the lead.","title":"Tags"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Job title.","title":"Title"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last change. Send it as `If-Match` on update to avoid overwriting someone's edit.","format":"date-time","title":"Updatedat"}},"title":"CampaignLead","type":"object"},"CampaignLeadInput":{"additionalProperties":true,"description":"One lead to create (or match by phone) while creating a campaign.","properties":{"attributes":{"additionalProperties":true,"description":"Extra fields the agent can use, for example `{\"city\": \"Pune\"}`.","title":"Attributes","type":"object"},"company":{"description":"Company.","title":"Company","type":"string"},"email":{"description":"Email address.","title":"Email","type":"string"},"externalId":{"description":"Your ID for this person.","title":"Externalid","type":"string"},"name":{"description":"Lead name.","title":"Name","type":"string"},"notes":{"description":"Added as one imported note; never replaces existing notes.","title":"Notes","type":"string"},"phone":{"description":"Phone number. Saved in E.164 form when it parses (no country code means India); otherwise saved as sent. A lead you already have with the same number is reused.","title":"Phone","type":"string"},"title":{"description":"Job title.","title":"Title","type":"string"}},"title":"CampaignLeadInput","type":"object"},"CampaignLeadList":{"additionalProperties":true,"description":"A campaign's active leads.","properties":{"hasMore":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether another page follows (only with `page`).","title":"Hasmore"},"leads":{"anyOf":[{"items":{"$ref":"#/components/schemas/CampaignLead"},"type":"array"},{"type":"null"}],"description":"Leads, newest first.","title":"Leads"},"pagination":{"anyOf":[{"$ref":"#/components/schemas/Pagination"},{"type":"null"}],"description":"Page position and totals."},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"CampaignLeadList","type":"object"},"CampaignLeadsChange":{"additionalProperties":true,"description":"Leads to add to or remove from a campaign.","properties":{"added":{"description":"Lead IDs to add. Removed leads are added back.","items":{"format":"uuid","type":"string"},"title":"Added","type":"array"},"confirmRemovedContacted":{"default":false,"description":"Required to remove leads that were already called; otherwise the request returns 409 `campaign_leads_need_confirmation` with their IDs.","title":"Confirmremovedcontacted","type":"boolean"},"removed":{"description":"Lead IDs to remove.","items":{"format":"uuid","type":"string"},"title":"Removed","type":"array"}},"title":"CampaignLeadsChange","type":"object"},"CampaignLeadsUpdated":{"additionalProperties":true,"description":"What changed on the campaign's lead list.","properties":{"added":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads added, including re-added ones.","title":"Added"},"campaign":{"anyOf":[{"$ref":"#/components/schemas/Campaign"},{"type":"null"}],"description":"The campaign."},"dialScheduled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"A dial round was scheduled for the new leads.","title":"Dialscheduled"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable confirmation.","title":"Message"},"reactivated":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Previously removed leads added back.","title":"Reactivated"},"removed":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads removed.","title":"Removed"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"CampaignLeadsUpdated","type":"object"},"CampaignList":{"additionalProperties":true,"description":"One page of campaigns.","properties":{"campaigns":{"anyOf":[{"items":{"$ref":"#/components/schemas/Campaign"},"type":"array"},{"type":"null"}],"description":"Campaigns on this page.","title":"Campaigns"},"hasMore":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether another page follows.","title":"Hasmore"},"pagination":{"anyOf":[{"$ref":"#/components/schemas/Pagination"},{"type":"null"}],"description":"Page position and totals."},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"CampaignList","type":"object"},"CampaignResult":{"additionalProperties":true,"description":"The campaign after the request.","properties":{"campaign":{"anyOf":[{"$ref":"#/components/schemas/Campaign"},{"type":"null"}],"description":"The campaign."},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"CampaignResult","type":"object"},"CampaignSettings":{"additionalProperties":true,"description":"Dialing rules. On update, send only the keys to change; they merge into the current settings.","properties":{"autoDialEnabled":{"default":true,"description":"Dial automatically while the campaign is running; false pauses dialing.","title":"Autodialenabled","type":"boolean"},"callInterval":{"default":7200000,"description":"Milliseconds between attempts to the same lead (2 hours by default).","minimum":0,"title":"Callinterval","type":"integer"},"dialDaysOfWeek":{"default":[0,1,2,3,4,5,6],"description":"Days calls are placed: 0 = Monday ... 6 = Sunday.","items":{"maximum":6,"minimum":0,"type":"integer"},"title":"Dialdaysofweek","type":"array"},"dialTimezone":{"default":"Asia/Kolkata","description":"IANA time zone of the dial window.","title":"Dialtimezone","type":"string"},"dialWindowEnd":{"default":"17:00","description":"Local time `HH:MM`.","title":"Dialwindowend","type":"string"},"dialWindowStart":{"default":"10:00","description":"Local time `HH:MM`. Calls are placed only inside the window.","title":"Dialwindowstart","type":"string"},"firstCallDelayMs":{"default":0,"description":"Wait before a new lead's first call, in milliseconds.","minimum":0,"title":"Firstcalldelayms","type":"integer"},"maxCallsPerDay":{"default":50,"description":"Calls the campaign may place per day.","maximum":100000,"minimum":1,"title":"Maxcallsperday","type":"integer"},"maxConcurrentCalls":{"default":1,"description":"Calls the campaign may have in progress at once, 1 to 500. Also limited by your plan's parallel calls and by each number's capacity. Default on create: 1, or twice the number of `phoneNumberIds` when created with leads.","maximum":500,"minimum":1,"title":"Maxconcurrentcalls","type":"integer"},"pacingSeconds":{"default":5,"description":"Seconds to wait between dial rounds, 0 to 3600; 0 dials again as soon as the dialer polls.","maximum":3600,"minimum":0,"title":"Pacingseconds","type":"integer"},"retryAttempts":{"default":3,"description":"Extra attempts per lead after the first call.","maximum":10,"minimum":0,"title":"Retryattempts","type":"integer"},"retryIntervalBusyMs":{"default":1800000,"description":"Milliseconds before retrying a busy lead.","minimum":0,"title":"Retryintervalbusyms","type":"integer"},"retryIntervalNoAnswerMs":{"description":"Milliseconds before retrying a lead that did not answer; null uses `callInterval`.","minimum":0,"title":"Retryintervalnoanswerms","type":["integer","null"]},"retryShortAnsweredCalls":{"default":false,"description":"Retry a lead whose call was answered but ended within seconds.","title":"Retryshortansweredcalls","type":"boolean"}},"title":"CampaignSettings","type":"object"},"CampaignStarted":{"additionalProperties":true,"description":"The campaign is running.","properties":{"leadCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Active leads on the campaign.","title":"Leadcount"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable confirmation.","title":"Message"},"processedCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Same as `leadCount`, kept for older clients.","title":"Processedcount"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"},"warnings":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Things that may hurt answer rates, for example a caller ID outside the usual series.","title":"Warnings"}},"title":"CampaignStarted","type":"object"},"CampaignStats":{"additionalProperties":true,"description":"Live progress counted from the campaign's leads.","properties":{"busy":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads that were busy.","title":"Busy"},"calledLeads":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads dialed at least once.","title":"Calledleads"},"calling":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads being called now.","title":"Calling"},"connectRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Connected leads as a percentage of all leads.","title":"Connectrate"},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Same as `connectRate`, kept for older clients.","title":"Conversionrate"},"failedCalls":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads whose last call failed.","title":"Failedcalls"},"noAnswer":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads that did not answer.","title":"Noanswer"},"queued":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads not called yet.","title":"Queued"},"retry":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Latest retry round, if any: `round`, `contacts`, `pending`, `connected`.","title":"Retry"},"successfulCalls":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Leads whose call connected.","title":"Successfulcalls"},"totalLeads":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Active leads on the campaign.","title":"Totalleads"}},"title":"CampaignStats","type":"object"},"CampaignStopped":{"additionalProperties":true,"description":"The campaign is stopped.","properties":{"campaign":{"anyOf":[{"$ref":"#/components/schemas/Campaign"},{"type":"null"}],"description":"The campaign."},"cancelledJobs":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Scheduled dial rounds that were cancelled.","title":"Cancelledjobs"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable confirmation.","title":"Message"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"CampaignStopped","type":"object"},"CampaignWithLeadsInput":{"additionalProperties":true,"description":"A new campaign plus the leads to put on it.","properties":{"campaignData":{"anyOf":[{"$ref":"#/components/schemas/CampaignInput"},{"type":"null"}],"description":"The campaign. `name` and `agentId` are required."},"copySettingsFromCampaignId":{"description":"Start from another campaign's settings and webhook; `campaignData.settings` overrides them.","format":"uuid","title":"Copysettingsfromcampaignid","type":"string"},"leadSourceType":{"description":"`bulk_upload` creates the leads in `uploadedLeads`; `existing_leads` adds leads you already have. Optional only for a catch-all inbound campaign.","enum":["bulk_upload","existing_leads"],"title":"Leadsourcetype","type":"string"},"selectedLeadIds":{"description":"With `existing_leads`: IDs of leads to add.","items":{"format":"uuid","type":"string"},"title":"Selectedleadids","type":"array"},"selectedLeadSourceIds":{"description":"With `existing_leads`: add every lead of these sources (used when no lead IDs are given).","items":{"format":"uuid","type":"string"},"title":"Selectedleadsourceids","type":"array"},"uploadedLeads":{"anyOf":[{"items":{"$ref":"#/components/schemas/CampaignLeadInput"},"type":"array"},{"type":"null"}],"description":"With `bulk_upload`: the leads to create. Repeated numbers are added once.","title":"Uploadedleads"}},"title":"CampaignWithLeadsInput","type":"object"},"CatalogLanguage":{"additionalProperties":true,"description":"A language agents can use (`config.language`).","properties":{"id":{"description":"Language code, for example `hi-IN`.","title":"Id","type":"string"},"name":{"description":"Display name.","title":"Name","type":"string"}},"required":["id","name"],"title":"CatalogLanguage","type":"object"},"CatalogVoice":{"additionalProperties":true,"description":"A voice the agent can speak with (`config.tts` = `provider`, `config.voice` = `voiceId`).","properties":{"gender":{"default":"","description":"`female`, `male` or empty.","title":"Gender","type":"string"},"languageCodes":{"description":"Languages the voice speaks.","items":{"type":"string"},"title":"Languagecodes","type":"array"},"name":{"description":"Voice display name.","title":"Name","type":"string"},"previewSupported":{"default":false,"description":"A sample clip can be played.","title":"Previewsupported","type":"boolean"},"provider":{"description":"Speech provider id; use it as `config.tts`.","title":"Provider","type":"string"},"providerName":{"description":"Provider display name.","title":"Providername","type":"string"},"sortOrder":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Display order.","title":"Sortorder"},"voiceId":{"description":"Voice id; use it as `config.voice`.","title":"Voiceid","type":"string"}},"required":["provider","providerName","voiceId","name"],"title":"CatalogVoice","type":"object"},"CatalogVoiceProvider":{"additionalProperties":true,"description":"A speech provider and how many active voices it has.","properties":{"count":{"default":0,"description":"Active voices from this provider.","title":"Count","type":"integer"},"id":{"description":"Provider id.","title":"Id","type":"string"},"name":{"description":"Provider display name.","title":"Name","type":"string"},"previewSupported":{"default":false,"description":"Sample clips can be played.","title":"Previewsupported","type":"boolean"}},"required":["id","name"],"title":"CatalogVoiceProvider","type":"object"},"CreateCallRequest":{"additionalProperties":false,"description":"Who to call, with which agent, and what to tell the agent.","properties":{"agentId":{"description":"Agent that speaks on the call. Archived agents cannot call.","title":"Agentid","type":"string"},"fromNumberId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your phone number to call from (`GET /phone-numbers`). Omitted: a free number from the agent's phone numbers.","title":"Fromnumberid"},"leadId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead this call belongs to; its phone must match `to`. Omitted: the lead with this number, or a new lead named `name`.","title":"Leadid"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Your own data (at most 4096 bytes of JSON). Returned as `metadata` on the call (`GET /calls/{callId}`); never spoken.","title":"Metadata"},"name":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"description":"Name for a new lead. Ignored when the lead exists.","title":"Name"},"to":{"description":"Number to call in E.164 format, e.g. `+919812345678`.","maxLength":32,"title":"To","type":"string"},"variables":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"type":"object"},{"type":"null"}],"description":"Up to 50 values the agent's script can use as `{{name}}`. Keys are letters, digits and underscores and must not start with a digit.","title":"Variables"}},"required":["agentId","to"],"title":"CreateCallRequest","type":"object"},"DncAdd":{"description":"Numbers to put on the do-not-call list.","properties":{"phones":{"description":"Indian mobile numbers, one per line or separated by commas. Invalid ones are skipped.","maxLength":20000,"minLength":8,"title":"Phones","type":"string"},"reason":{"default":"","description":"Why, shown on each entry.","maxLength":255,"title":"Reason","type":"string"}},"required":["phones"],"title":"DncAdd","type":"object"},"DoNotCallAdded":{"additionalProperties":true,"description":"Numbers now on do-not-call.","properties":{"added":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"New do-not-call entries created for unknown numbers.","title":"Added"},"entries":{"anyOf":[{"items":{"$ref":"#/components/schemas/Lead"},"type":"array"},{"type":"null"}],"description":"The leads for every valid number sent.","title":"Entries"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"updated":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Existing leads newly marked do-not-call.","title":"Updated"}},"title":"DoNotCallAdded","type":"object"},"DoNotCallList":{"additionalProperties":true,"description":"The workspace's do-not-call list: the 500 most recently changed entries.","properties":{"entries":{"description":"Leads marked do-not-call, newest change first.","items":{"$ref":"#/components/schemas/Lead"},"title":"Entries","type":"array"},"hasMore":{"default":false,"description":"True when more than 500 leads are marked do-not-call and older entries were left out.","title":"Hasmore","type":"boolean"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Number of entries in this response (at most 500).","title":"Total"}},"required":["entries"],"title":"DoNotCallList","type":"object"},"Error":{"description":"Every error response has this shape.","properties":{"detail":{"anyOf":[{"type":"string"},{"type":"object"},{"items":{"type":"object"},"type":"array"}],"description":"The message kept for older clients: a string, an object, or (for 422) a list of field errors. Prefer `error`."},"error":{"$ref":"#/components/schemas/ErrorBody"}},"required":["detail","error"],"type":"object"},"ErrorBody":{"properties":{"code":{"description":"Stable machine-readable code, for example `resource_not_found`. Listed under each operation's responses.","type":"string"},"docUrl":{"anyOf":[{"description":"Page describing this code and how to fix it.","format":"uri","type":"string"},{"type":"null"}]},"message":{"description":"Human-readable explanation. May change; do not parse it.","type":"string"},"param":{"anyOf":[{"description":"The request field that caused the error, when there is one.","type":"string"},{"type":"null"}]},"requestId":{"description":"Same as the `X-Request-ID` response header. Quote it when contacting support.","type":"string"},"type":{"description":"Broad category; branch on `code` for specifics.","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","conflict_error","idempotency_error","rate_limit_error","api_error"],"type":"string"}},"required":["type","code","message","requestId"],"type":"object"},"FieldWarning":{"additionalProperties":true,"description":"A value that was not saved as sent; the rest of the write succeeded.","properties":{"key":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Field key, for example `status` or an attribute key.","title":"Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Field label.","title":"Label"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What happened to the value.","title":"Reason"},"value":{"description":"The value you sent.","title":"Value"}},"title":"FieldWarning","type":"object"},"Lead":{"additionalProperties":true,"description":"A person you can call, with their latest call state and profile facts.","properties":{"assignedToUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team member who owns the lead, or null.","title":"Assignedtouserid"},"assigneeName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"That team member's name.","title":"Assigneename"},"attributeIssues":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Values that did not fit their field's type, kept aside: `{key: {raw, reason, at}}`.","title":"Attributeissues"},"attributes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Current profile facts, for example `{\"ward_no\": \"8\", \"age\": 31}`.","title":"Attributes"},"callAttempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Calls attempted so far.","title":"Callattempts"},"callStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Latest dialing state, for example `not_called`, `calling`, `called`, `no_answer`.","title":"Callstatus"},"campaignCallStatus":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Per-campaign dialing state keyed by campaign ID: status, attempts, lastAttempt, nextScheduled.","title":"Campaigncallstatus"},"campaignIds":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Campaigns the lead is in.","title":"Campaignids"},"campaignNames":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Names of those campaigns, same order.","title":"Campaignnames"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Company name.","title":"Company"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the lead was created.","format":"date-time","title":"Createdat"},"dncOptOut":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when the number must never be dialed.","title":"Dncoptout"},"dncReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the lead is on do-not-call.","title":"Dncreason"},"dncUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When do-not-call last changed.","format":"date-time","title":"Dncupdatedat"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email address.","title":"Email"},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your business id (EPIC, patient id, order id). Unique inside a lead source.","title":"Externalid"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead ID.","title":"Id"},"lastCallAttempt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the last call was attempted.","format":"date-time","title":"Lastcallattempt"},"lastContactDate":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last time the lead was reached.","format":"date-time","title":"Lastcontactdate"},"leadSourceId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead source the lead belongs to, or empty.","title":"Leadsourceid"},"merchantOutcome":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Outcome of the latest result, for example `interested`, `callback` or `no_answer`.","title":"Merchantoutcome"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Full name.","title":"Name"},"nextCallScheduled":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the next automatic attempt is due.","format":"date-time","title":"Nextcallscheduled"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Deprecated: use the notes endpoints. The latest 20 notes as text, newest first; only on single-lead responses.","title":"Notes"},"notesCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Live notes on the lead.","title":"Notescount"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Phone number as stored.","title":"Phone"},"pinnedNotePreview":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start of the newest pinned note.","title":"Pinnednotepreview"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where the lead came from.","title":"Source"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pipeline status key, one of your workspace's statuses (default `new`).","title":"Status"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"Tags on the lead.","title":"Tags"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Job title.","title":"Title"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last change. Send it as `If-Match` on update to avoid overwriting someone's edit.","format":"date-time","title":"Updatedat"}},"title":"Lead","type":"object"},"LeadBulkAction":{"description":"One action applied to up to 500 leads.","properties":{"action":{"description":"`status` sets `value` as the status; `assign` assigns to user `value` (empty unassigns); `tag` / `untag` add or remove tag `value`; `dnc` / `undnc` set or clear do-not-call (`value` is the reason); `delete` deletes the leads.","enum":["status","assign","tag","untag","dnc","undnc","delete"],"title":"Action","type":"string"},"ids":{"description":"Lead IDs, 1 to 500.","items":{"format":"uuid","type":"string"},"maxItems":500,"minItems":1,"title":"Ids","type":"array"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Argument for the action, see `action`.","title":"Value"}},"required":["ids","action"],"title":"LeadBulkAction","type":"object"},"LeadBulkResult":{"additionalProperties":true,"description":"How many leads the bulk action changed.","properties":{"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"updated":{"description":"Leads changed. Leads already in the requested state, or not in your workspace, are not counted.","title":"Updated","type":"integer"}},"required":["updated"],"title":"LeadBulkResult","type":"object"},"LeadCreate":{"description":"A new lead. Every field is optional; send at least a phone number to call it.","properties":{"attributes":{"additionalProperties":true,"description":"Profile facts, for example `{\"city\": \"Pune\"}`. Typed by your lead fields.","title":"Attributes","type":"object"},"campaignIds":{"description":"Add the lead to these campaigns.","items":{"type":"string"},"title":"Campaignids","type":"array"},"company":{"default":"","description":"Company name.","title":"Company","type":"string"},"email":{"default":"","description":"Email address.","title":"Email","type":"string"},"leadSourceId":{"default":"","description":"ID of an existing lead source.","title":"Leadsourceid","type":"string"},"name":{"default":"","description":"Full name.","title":"Name","type":"string"},"notes":{"default":"","description":"Saved as the lead's first note.","title":"Notes","type":"string"},"phone":{"default":"","description":"Phone number, saved in E.164 form: `+919876543210`, `9876543210` and `098765 43210` all save as `+919876543210` (a number without a country code is taken as Indian). A value that is not a phone number returns 422 `invalid_phone_number`.","title":"Phone","type":"string"},"source":{"default":"","description":"Free-text source label, for example `website`.","title":"Source","type":"string"},"status":{"default":"new","description":"Pipeline status key. An unknown key saves as `new` with a warning.","title":"Status","type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"","description":"Job title.","title":"Title"}},"title":"LeadCreate","type":"object"},"LeadDeleted":{"additionalProperties":true,"description":"The lead was deleted.","properties":{"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`Lead deleted`.","title":"Message"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"title":"LeadDeleted","type":"object"},"LeadFieldDefinition":{"additionalProperties":true,"description":"A custom lead field defined in the workspace.","properties":{"id":{"description":"Field ID.","title":"Id","type":"string"},"key":{"description":"Key used in a lead's `attributes` and in audience rules.","title":"Key","type":"string"},"label":{"description":"Name shown in the console; the key when no label was set.","title":"Label","type":"string"},"valueType":{"description":"How the value is stored and compared: `text`, `number`, `boolean`, `list`, `date` (calendar day) or `datetime` (UTC instant).","enum":["text","number","boolean","list","date","datetime"],"title":"Valuetype","type":"string"}},"required":["id","key","label","valueType"],"title":"LeadFieldDefinition","type":"object"},"LeadFieldDefinitionList":{"additionalProperties":true,"description":"Every custom lead field of the workspace, by label.","properties":{"fields":{"description":"Field definitions, sorted by label.","items":{"$ref":"#/components/schemas/LeadFieldDefinition"},"title":"Fields","type":"array"}},"required":["fields"],"title":"LeadFieldDefinitionList","type":"object"},"LeadIntake":{"additionalProperties":true,"description":"Any other top-level fields are kept on the lead as additional data. Phone or email is required.","properties":{"company":{"type":"string"},"email":{"type":"string"},"is_test":{"description":"Check the connection without creating a lead.","type":"boolean"},"lead_id":{"description":"Your ID for this lead. A repeat with the same ID is ignored. Without it, repeats are recognised by phone, email and name.","type":"string"},"name":{"type":"string"},"phone":{"description":"Phone number, for example `+919876543210`. Saved in E.164 form when it parses (no country code means India); otherwise saved as sent.","type":"string"},"title":{"type":"string"}},"type":"object"},"LeadIntakeError":{"additionalProperties":true,"properties":{"error":{"description":"What went wrong.","type":"string"},"success":{"const":false,"type":"boolean"}},"required":["success","error"],"type":"object"},"LeadIntakeResult":{"additionalProperties":true,"description":"What happened to a pushed lead. Errors use the `LeadIntakeError` shape instead.","properties":{"campaignAttached":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"The lead was added to the integration's campaign and will be called.","title":"Campaignattached"},"duplicate":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Present and true when this `lead_id` was already received; nothing was created.","title":"Duplicate"},"externalLeadId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your ID for the lead, as received (`lead_id`).","title":"Externalleadid"},"leadId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ID of the new lead.","title":"Leadid"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable note, sent with test requests.","title":"Message"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when the lead was saved, already received, or a test.","title":"Success"},"test":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Present and true for an `is_test` request; nothing was created.","title":"Test"}},"title":"LeadIntakeResult","type":"object"},"LeadList":{"additionalProperties":true,"description":"One page of leads.","properties":{"hasMore":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when another page follows.","title":"Hasmore"},"leads":{"description":"Leads on this page.","items":{"$ref":"#/components/schemas/Lead"},"title":"Leads","type":"array"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` for the next page. Only with the default sort (newest first).","title":"Nextcursor"},"pagination":{"anyOf":[{"$ref":"#/components/schemas/Pagination"},{"type":"null"}],"description":"Page position and totals."},"stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"With `includeStats=true`: total, byStatus, recentlyAdded and notCalled for the filter.","title":"Stats"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["leads"],"title":"LeadList","type":"object"},"LeadNote":{"additionalProperties":true,"description":"One note on a lead, written by a person, an API key, the AI or an import.","properties":{"authorKind":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who wrote it: `user`, `api` (an API key), `ai`, `import` or `system`.","title":"Authorkind"},"authorName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"That team member's name, or empty.","title":"Authorname"},"authorUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team member who wrote it, if a person did.","title":"Authoruserid"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Note text.","title":"Body"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was written.","format":"date-time","title":"Createdat"},"editedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was last edited.","format":"date-time","title":"Editedat"},"editedByName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who last edited it, or empty.","title":"Editedbyname"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Note ID.","title":"Id"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`note`, `follow_up`, `call_reason`, `brief` (the lead summary) or `imported`. Older AI call summaries carry their own kind; treat unknown kinds as plain notes.","title":"Kind"},"leadId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead the note belongs to.","title":"Leadid"},"pinned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the note is pinned.","title":"Pinned"},"pinnedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was pinned.","format":"date-time","title":"Pinnedat"},"sourceCallId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Call the note came from, if any.","title":"Sourcecallid"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last change.","format":"date-time","title":"Updatedat"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Send this back with an edit; it goes up on every change.","title":"Version"}},"title":"LeadNote","type":"object"},"LeadNoteCreate":{"description":"A new note.","properties":{"body":{"description":"Note text, up to 10000 characters.","maxLength":10000,"minLength":1,"title":"Body","type":"string"},"kind":{"default":"note","description":"`note`, or `follow_up` for a to-do.","enum":["note","follow_up"],"title":"Kind","type":"string"}},"required":["body"],"title":"LeadNoteCreate","type":"object"},"LeadNoteDeleted":{"additionalProperties":true,"description":"Confirms the delete.","properties":{"notesCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Live notes left on the lead.","title":"Notescount"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"LeadNoteDeleted","type":"object"},"LeadNoteEdit":{"description":"New text for a note.","properties":{"body":{"description":"Note text, up to 10000 characters.","maxLength":10000,"minLength":1,"title":"Body","type":"string"},"version":{"description":"The note's `version` when you read it.","minimum":1,"title":"Version","type":"integer"}},"required":["body","version"],"title":"LeadNoteEdit","type":"object"},"LeadNoteList":{"additionalProperties":true,"description":"One page of a lead's notes: the brief and pins (first page only), then newest first.","properties":{"brief":{"anyOf":[{"$ref":"#/components/schemas/LeadNote"},{"type":"null"}],"description":"The lead's summary note, on the first page only."},"hasMore":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether another page exists.","title":"Hasmore"},"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/LeadNote"},"type":"array"},{"type":"null"}],"description":"Other notes, newest first.","title":"Items"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` for the next page; null on the last page.","title":"Nextcursor"},"notesCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Live notes on the lead.","title":"Notescount"},"pinned":{"anyOf":[{"items":{"$ref":"#/components/schemas/LeadNote"},"type":"array"},{"type":"null"}],"description":"Pinned notes (up to three), first page only.","title":"Pinned"}},"title":"LeadNoteList","type":"object"},"LeadNoteResult":{"additionalProperties":true,"description":"The note after the change.","properties":{"note":{"anyOf":[{"$ref":"#/components/schemas/LeadNote"},{"type":"null"}],"description":"The note."},"notesCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Live notes on the lead (on create).","title":"Notescount"},"success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Always true.","title":"Success"}},"title":"LeadNoteResult","type":"object"},"LeadResult":{"additionalProperties":true,"description":"The lead after the change.","properties":{"lead":{"$ref":"#/components/schemas/Lead","description":"The lead."},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"warnings":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldWarning"},"type":"array"},{"type":"null"}],"description":"Values saved differently than sent (for example an unknown status).","title":"Warnings"}},"required":["lead"],"title":"LeadResult","type":"object"},"LeadTimeline":{"additionalProperties":true,"description":"One page of a lead's timeline, newest first.","properties":{"hasMore":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when another page follows.","title":"Hasmore"},"items":{"description":"Events on this page.","items":{"$ref":"#/components/schemas/TimelineItem"},"title":"Items","type":"array"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` for the next page; null on the last.","title":"Nextcursor"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"upcomingCallbacks":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"description":"First page only: open callbacks and reminders, soonest first (callbackId, kind, channel, status, dueAt, dialAt, purpose, note, overdue).","title":"Upcomingcallbacks"}},"required":["items"],"title":"LeadTimeline","type":"object"},"LeadUpdate":{"additionalProperties":true,"description":"Send only the fields to change.","properties":{"assignedToUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A team member's user ID, or null to unassign.","title":"Assignedtouserid"},"attributes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Profile facts to set; a null value clears that fact. Other facts stay.","title":"Attributes"},"campaignIds":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"description":"Replaces the lead's campaigns: campaigns missing from the list are removed.","title":"Campaignids"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Company name.","title":"Company"},"dismissIssues":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"description":"Attribute keys whose kept-aside values (`attributeIssues`) should be dropped.","title":"Dismississues"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email address.","title":"Email"},"externalId":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"description":"Your business id for this person.","title":"Externalid"},"leadSourceId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ID of a lead source, or empty to clear.","title":"Leadsourceid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Full name.","title":"Name"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Deprecated: adds one note (never replaces notes). Use `POST /leads/{leadId}/notes`.","title":"Notes"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Phone number, saved in E.164 form: `+919876543210`, `9876543210` and `098765 43210` all save as `+919876543210` (a number without a country code is taken as Indian). A value that is not a phone number returns 422 `invalid_phone_number`.","title":"Phone"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Free-text source label.","title":"Source"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pipeline status key.","title":"Status"},"tags":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"description":"Replaces the lead's tags.","title":"Tags"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"IANA time zone such as `Asia/Kolkata` for dial windows.","title":"Timezone"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Job title.","title":"Title"}},"title":"LeadUpdate","type":"object"},"Pagination":{"additionalProperties":true,"description":"Where this page sits in the full list.","properties":{"currentPage":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"This page's number, from 1.","title":"Currentpage"},"hasNextPage":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when another page follows.","title":"Hasnextpage"},"hasPreviousPage":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when this is not the first page.","title":"Haspreviouspage"},"itemsPerPage":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Page size used for this response.","title":"Itemsperpage"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` to get the next page, when the list supports cursors.","title":"Nextcursor"},"totalCapped":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when more than 10,000 items match and `totalItems` is only a lower bound.","title":"Totalcapped"},"totalItems":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Matching items. Counted up to 10,000; when `totalCapped` is true there are more.","title":"Totalitems"},"totalPages":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Number of pages, from `totalItems`.","title":"Totalpages"}},"title":"Pagination","type":"object"},"PhoneNumber":{"additionalProperties":true,"description":"A number in your workspace that agents call from or answer on.","properties":{"assignedAgentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Agent using the number: assigned, inbound, or through a campaign (empty when free).","title":"Assignedagentid"},"assignedAgentName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"That agent's name.","title":"Assignedagentname"},"e164":{"description":"The number in E.164 format.","title":"E164","type":"string"},"id":{"description":"Phone number ID. Use it as `fromNumberId` on `POST /calls`.","title":"Id","type":"string"},"inboundAgentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Agent that answers incoming calls (empty when none).","title":"Inboundagentid"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your label for the number.","title":"Label"},"lastSyncedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last change (ISO 8601).","title":"Lastsyncedat"},"maxConcurrentCalls":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Most calls this number carries at the same time.","title":"Maxconcurrentcalls"},"metadata":{"additionalProperties":true,"description":"Carrier settings without credentials.","title":"Metadata","type":"object"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Label, or the number when there is no label.","title":"Name"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Same as `e164`.","title":"Number"},"plivoAuthTokenSet":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when a Plivo Auth Token is saved.","title":"Plivoauthtokenset"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Carrier: `twilio`, `plivo`, `vobiz_sip`, `sip_trunk` or another SIP provider.","title":"Provider"},"providerResourceId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Carrier account or resource ID (Plivo Auth ID).","title":"Providerresourceid"},"sipDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SIP domain.","title":"Sipdomain"},"sipOutboundProxy":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SIP outbound proxy (`host:port`).","title":"Sipoutboundproxy"},"sipPasswordSet":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when a SIP password is saved.","title":"Sippasswordset"},"sipUsername":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SIP username.","title":"Sipusername"},"twilioAccountSid":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Twilio Account SID saved on the number.","title":"Twilioaccountsid"},"twilioAuthTokenSet":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when a Twilio Auth Token is saved.","title":"Twilioauthtokenset"},"vobizAuthTokenSet":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when a Vobiz Auth Token is saved.","title":"Vobizauthtokenset"}},"required":["id","e164"],"title":"PhoneNumber","type":"object"},"PhoneNumberEnvelope":{"additionalProperties":true,"description":"One phone number.","properties":{"phoneNumber":{"$ref":"#/components/schemas/PhoneNumber","description":"The number."},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["phoneNumber"],"title":"PhoneNumberEnvelope","type":"object"},"PhoneNumberList":{"additionalProperties":true,"description":"Every phone number in the workspace, newest first.","properties":{"phoneNumbers":{"description":"Numbers, newest first.","items":{"$ref":"#/components/schemas/PhoneNumber"},"title":"Phonenumbers","type":"array"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["phoneNumbers"],"title":"PhoneNumberList","type":"object"},"PlacedCall":{"additionalProperties":true,"description":"A call was handed to the carrier. Progress arrives on `GET /calls/{callId}` and webhooks.","properties":{"call":{"$ref":"#/components/schemas/PlacedCallDetails","description":"The call that was placed."},"sipResponse":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"The carrier's answer to the dial request; fields vary by carrier.","title":"Sipresponse"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["call"],"title":"PlacedCall","type":"object"},"PlacedCallDetails":{"additionalProperties":true,"description":"The call that was just placed.","properties":{"campaignId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Campaign whose agent and settings the call uses.","title":"Campaignid"},"campaignName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Campaign's name.","title":"Campaignname"},"id":{"description":"Call ID. Follow it with `GET /calls/{callId}`.","title":"Id","type":"string"},"leadId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead being called.","title":"Leadid"},"leadName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lead's name.","title":"Leadname"},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The number being dialed.","title":"Phonenumber"},"phoneNumberId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your phone number the call is placed from.","title":"Phonenumberid"},"providerCallId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The carrier's call ID.","title":"Providercallid"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Carrier status at dial time, usually `initiated` or `queued`.","title":"Status"}},"required":["id"],"title":"PlacedCallDetails","type":"object"},"PostCallWebhookInput":{"description":"Where to send each call's summary for this agent.","properties":{"secret":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"description":"Signing secret. Omit to keep the current one.","title":"Secret"},"trigger":{"default":"every","description":"Which calls are sent: every call, completed calls only, or voicemails only.","enum":["every","completed","voicemail"],"title":"Trigger","type":"string"},"url":{"default":"","description":"HTTPS URL. Empty removes the webhook.","maxLength":2000,"title":"Url","type":"string"}},"title":"PostCallWebhookInput","type":"object"},"PostCallWebhookSettings":{"additionalProperties":true,"description":"The agent's post-call webhook (the secret itself is never returned).","properties":{"hasSecret":{"default":false,"description":"A signing secret is stored.","title":"Hassecret","type":"boolean"},"trigger":{"default":"every","description":"Which calls are sent.","title":"Trigger","type":"string"},"url":{"default":"","description":"Endpoint that receives the call summary; empty when off.","title":"Url","type":"string"}},"title":"PostCallWebhookSettings","type":"object"},"ScheduledCallbackItem":{"additionalProperties":true,"description":"A callback or reminder call booked for a lead.","properties":{"agentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Agent that places the call.","title":"Agentid"},"attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Calls placed for this booking so far.","title":"Attempts"},"callId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Latest call placed for this booking.","title":"Callid"},"campaignId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Campaign whose agent and caller ID place the call.","title":"Campaignid"},"campaignName":{"default":"","description":"Campaign's name.","title":"Campaignname","type":"string"},"channel":{"default":"phone","description":"How the lead is reached, usually `phone`.","title":"Channel","type":"string"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was booked (ISO 8601).","title":"Createdat"},"dialAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time the call will be placed; later than `dueAt` when moved into the dial window.","title":"Dialat"},"dialAtLocal":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`dialAt` in `timezone`, for display.","title":"Dialatlocal"},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time the lead asked for (ISO 8601, UTC).","title":"Dueat"},"id":{"description":"Callback ID.","title":"Id","type":"string"},"kind":{"description":"`callback` (the lead asked to be called) or `reminder` (from a reminder rule).","title":"Kind","type":"string"},"lastOutcome":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Outcome of the latest attempt.","title":"Lastoutcome"},"leadId":{"description":"Lead to call back.","title":"Leadid","type":"string"},"leadName":{"default":"","description":"Lead's name.","title":"Leadname","type":"string"},"leadPhone":{"default":"","description":"Lead's phone number.","title":"Leadphone","type":"string"},"maxAttempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Calls allowed before it is marked `failed`.","title":"Maxattempts"},"note":{"default":"","description":"Note shown to the agent on the call.","title":"Note","type":"string"},"originCallId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Call during which the callback was booked.","title":"Origincallid"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the call is booked.","title":"Purpose"},"shifted":{"default":false,"description":"True when `dialAt` was moved into the dial window.","title":"Shifted","type":"boolean"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What booked it: the agent during a call, a person, or a rule.","title":"Source"},"status":{"description":"`pending`, `queued`, `dialing`, `done`, `failed`, `cancelled` or `expired`.","title":"Status","type":"string"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"IANA time zone used for the booking.","title":"Timezone"}},"required":["id","leadId","kind","status"],"title":"ScheduledCallbackItem","type":"object"},"ScheduledCallbackList":{"additionalProperties":true,"description":"One page of callbacks, soonest first.","properties":{"callbacks":{"description":"Callbacks on this page, by `dialAt`.","items":{"$ref":"#/components/schemas/ScheduledCallbackItem"},"title":"Callbacks","type":"array"},"total":{"description":"Callbacks matching the filters.","title":"Total","type":"integer"}},"required":["callbacks","total"],"title":"ScheduledCallbackList","type":"object"},"SipGateway":{"additionalProperties":true,"description":"Where your provider sends calls and which address to allow.","properties":{"allowIp":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Address to add to your provider's allow-list.","title":"Allowip"},"enabled":{"description":"False while SIP trunks are not switched on for your workspace's server.","title":"Enabled","type":"boolean"},"host":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gateway hostname your provider sends calls to.","title":"Host"},"inboundUri":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SIP URI pattern for incoming calls.","title":"Inbounduri"},"port":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Gateway SIP port.","title":"Port"}},"required":["enabled"],"title":"SipGateway","type":"object"},"SipTrunk":{"additionalProperties":true,"description":"Your own SIP provider connected to the calling gateway. The password is never returned.","properties":{"authMode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`digest` (username and password) or `ip` (IP allow-list).","title":"Authmode"},"authRealm":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Digest realm, if the provider needs one.","title":"Authrealm"},"codecs":{"description":"Audio codecs offered, in order.","items":{"type":"string"},"title":"Codecs","type":"array"},"dtmfMode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`rfc4733`, `inband`, `info` or `auto`.","title":"Dtmfmode"},"fromDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Domain of the From header.","title":"Fromdomain"},"fromUser":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User part of the From header.","title":"Fromuser"},"hasPassword":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when a password is saved.","title":"Haspassword"},"host":{"description":"Provider SIP server (hostname or IP).","title":"Host","type":"string"},"id":{"description":"SIP trunk ID.","title":"Id","type":"string"},"inboundIps":{"description":"Provider addresses allowed to send calls.","items":{"type":"string"},"title":"Inboundips","type":"array"},"isActive":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"False when the trunk is switched off.","title":"Isactive"},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last sync error (empty when none).","title":"Lasterror"},"maxConcurrentCalls":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Most calls the trunk carries at the same time.","title":"Maxconcurrentcalls"},"name":{"description":"Trunk name.","title":"Name","type":"string"},"numberFormat":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"How numbers are sent: `e164`, `e164_no_plus`, `national_zero` or `national`.","title":"Numberformat"},"numbers":{"description":"Numbers on this trunk.","items":{"$ref":"#/components/schemas/SipTrunkNumber"},"title":"Numbers","type":"array"},"outboundProxy":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Outbound proxy host.","title":"Outboundproxy"},"port":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"SIP port.","title":"Port"},"register":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True when the gateway registers with the provider.","title":"Register"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gateway sync status: `pending`, `active` or `error` (see `lastError`).","title":"Status"},"syncedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last gateway sync (ISO 8601).","title":"Syncedat"},"techPrefix":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Digits put before every dialed number.","title":"Techprefix"},"transport":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`udp` or `tcp`.","title":"Transport"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SIP username.","title":"Username"}},"required":["id","name","host"],"title":"SipTrunk","type":"object"},"SipTrunkEnvelope":{"additionalProperties":true,"description":"One SIP trunk.","properties":{"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"trunk":{"$ref":"#/components/schemas/SipTrunk","description":"The trunk."}},"required":["trunk"],"title":"SipTrunkEnvelope","type":"object"},"SipTrunkList":{"additionalProperties":true,"description":"Your SIP trunks and the gateway details to give your provider.","properties":{"gateway":{"$ref":"#/components/schemas/SipGateway","description":"Gateway details for your provider."},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"trunks":{"description":"Trunks, oldest first.","items":{"$ref":"#/components/schemas/SipTrunk"},"title":"Trunks","type":"array"}},"required":["trunks","gateway"],"title":"SipTrunkList","type":"object"},"SipTrunkNumber":{"additionalProperties":true,"description":"A number routed over a SIP trunk.","properties":{"e164":{"description":"The number in E.164 format.","title":"E164","type":"string"},"id":{"description":"Phone number ID.","title":"Id","type":"string"},"inboundAgentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Agent that answers incoming calls, or null.","title":"Inboundagentid"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your label for the number.","title":"Label"}},"required":["id","e164"],"title":"SipTrunkNumber","type":"object"},"TicketActivityBody":{"description":"A private team note, never sent to the customer; a note may be just attachments.","properties":{"attachmentIds":{"description":"Files already uploaded to the ticket (console only).","items":{"type":"string"},"maxItems":5,"title":"Attachmentids","type":"array"},"note":{"default":"","description":"Note text, visible to your team only.","maxLength":8000,"title":"Note","type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Also move the ticket to this status: `open`, `in_progress`, `waiting_on_customer`, `resolved` or `closed`.","title":"Status"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"The `version` you last read; if the ticket changed since, the request fails with 409. Leave out to skip.","title":"Version"}},"title":"TicketActivityBody","type":"object"},"TicketActivityEntry":{"additionalProperties":true,"properties":{"activityType":{"description":"What happened, e.g. `created`, `comment` (a note), `reply`, `status_change`, `assignment`.","title":"Activitytype","type":"string"},"actorName":{"description":"Their name.","title":"Actorname","type":"string"},"actorUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who did it; null for the customer or the system.","title":"Actoruserid"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it happened.","title":"Createdat"},"id":{"description":"Activity id.","title":"Id","type":"string"},"payload":{"additionalProperties":true,"description":"Details of the activity; a note's text is in `note`.","title":"Payload","type":"object"},"ticketId":{"description":"The ticket.","title":"Ticketid","type":"string"}},"required":["id","ticketId","actorUserId","actorName","activityType","payload","createdAt"],"title":"TicketActivityEntry","type":"object"},"TicketActivityPage":{"additionalProperties":true,"properties":{"activities":{"description":"Activities older than `before`, oldest first.","items":{"$ref":"#/components/schemas/TicketActivityEntry"},"title":"Activities","type":"array"},"activitiesCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `before` for the next older page.","title":"Activitiescursor"},"hasOlderActivities":{"description":"More older activities exist.","title":"Hasolderactivities","type":"boolean"},"success":{"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["success","activities","hasOlderActivities","activitiesCursor"],"title":"TicketActivityPage","type":"object"},"TicketAssigneeRef":{"additionalProperties":true,"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their email.","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Their name.","title":"Name"},"userId":{"description":"Id of the assigned team member.","title":"Userid","type":"string"}},"required":["userId"],"title":"TicketAssigneeRef","type":"object"},"TicketCategoryItem":{"additionalProperties":true,"properties":{"defaultPriority":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Priority a new ticket in this category gets when none is sent.","title":"Defaultpriority"},"defaultTeamId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team a new ticket in this category is routed to.","title":"Defaultteamid"},"id":{"description":"Category id; send it as `categoryId`.","title":"Id","type":"string"},"isActive":{"title":"Isactive","type":"boolean"},"name":{"title":"Name","type":"string"},"sortOrder":{"title":"Sortorder","type":"integer"}},"required":["id","name","defaultPriority","isActive","sortOrder","defaultTeamId"],"title":"TicketCategoryItem","type":"object"},"TicketCategoryList":{"additionalProperties":true,"properties":{"categories":{"items":{"$ref":"#/components/schemas/TicketCategoryItem"},"title":"Categories","type":"array"},"success":{"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["success","categories"],"title":"TicketCategoryList","type":"object"},"TicketCreateBody":{"properties":{"assignedToUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Assign one team member (user id).","title":"Assignedtouserid"},"assignedUserIds":{"anyOf":[{"items":{"type":"string"},"maxItems":50,"type":"array"},{"type":"null"}],"description":"Assign several team members; wins over `assignedToUserId`.","title":"Assigneduserids"},"categoryId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Category id from `GET /tickets/categories`.","title":"Categoryid"},"description":{"default":"","description":"Details.","maxLength":20000,"title":"Description","type":"string"},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Resolution due time (ISO 8601).","title":"Dueat"},"leadId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The lead (customer) the ticket is about.","title":"Leadid"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`low`, `normal`, `high` or `urgent`. Default: the category's priority, else `normal`.","title":"Priority"},"sourceCallId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The call this ticket came from.","title":"Sourcecallid"},"subject":{"description":"One-line summary.","maxLength":512,"minLength":1,"title":"Subject","type":"string"},"tags":{"anyOf":[{"items":{"type":"string"},"maxItems":20,"type":"array"},{"type":"null"}],"description":"Up to 20 tags.","title":"Tags"},"type":{"default":"support","description":"`support` or `sales_followup`.","title":"Type","type":"string"},"waConversationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Open it from a WhatsApp conversation instead; its contact's lead is used.","title":"Waconversationid"}},"required":["subject"],"title":"TicketCreateBody","type":"object"},"TicketDetail":{"additionalProperties":true,"properties":{"activities":{"description":"Latest activities, oldest first.","items":{"$ref":"#/components/schemas/TicketActivityEntry"},"title":"Activities","type":"array"},"activitiesCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `before` to read older activities.","title":"Activitiescursor"},"assignedToUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First assignee's user id, or null when unassigned.","title":"Assignedtouserid"},"assignees":{"description":"Everyone assigned, in assignment order.","items":{"$ref":"#/components/schemas/TicketAssigneeRef"},"title":"Assignees","type":"array"},"canEdit":{"description":"Whether the key's user may change this ticket.","title":"Canedit","type":"boolean"},"canManageAssignees":{"description":"Whether the key's user may change who is assigned.","title":"Canmanageassignees","type":"boolean"},"canReopenClosed":{"description":"Whether the key's user may reopen it once closed.","title":"Canreopenclosed","type":"boolean"},"categoryId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Category id (see `GET /tickets/categories`).","title":"Categoryid"},"categoryName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Category name.","title":"Categoryname"},"closedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was closed.","title":"Closedat"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was created.","title":"Createdat"},"description":{"description":"Details.","title":"Description","type":"string"},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Resolution due time (ISO 8601).","title":"Dueat"},"hasOlderActivities":{"description":"More activities exist; page with `GET /tickets/{ticket_id}/activities`.","title":"Hasolderactivities","type":"boolean"},"id":{"description":"Ticket id.","title":"Id","type":"string"},"leadId":{"description":"The lead (customer) the ticket is about.","title":"Leadid","type":"string"},"leadName":{"description":"The lead's name.","title":"Leadname","type":"string"},"leadPhone":{"description":"The lead's phone number.","title":"Leadphone","type":"string"},"mergedIntoId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set when this ticket was merged into another (then read-only).","title":"Mergedintoid"},"overdue":{"description":"True when past `dueAt` and not resolved.","title":"Overdue","type":"boolean"},"priority":{"description":"`low`, `normal`, `high` or `urgent`.","title":"Priority","type":"string"},"ref":{"description":"Short reference shown to people, e.g. `T-1A2B3C4D`.","title":"Ref","type":"string"},"resolvedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was resolved.","title":"Resolvedat"},"sla":{"additionalProperties":true,"description":"Service-level targets: `firstResponse`, `resolution` and `paused`.","title":"Sla","type":"object"},"source":{"description":"How it was opened: `manual`, `inbound_call`, `outbound_call`, `import` or `whatsapp_conversation`.","title":"Source","type":"string"},"sourceCallId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The call that opened the ticket, if any.","title":"Sourcecallid"},"status":{"description":"`open`, `in_progress`, `waiting_on_customer`, `resolved` or `closed`.","title":"Status","type":"string"},"subject":{"description":"One-line summary.","title":"Subject","type":"string"},"tags":{"description":"Tags.","items":{"type":"string"},"title":"Tags","type":"array"},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team id (see `GET /tickets/teams`).","title":"Teamid"},"teamName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team name.","title":"Teamname"},"type":{"description":"`support` or `sales_followup`.","title":"Type","type":"string"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it last changed.","title":"Updatedat"},"version":{"description":"Increases on every change; send it back as `version` to avoid overwriting.","title":"Version","type":"integer"},"waConversationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The WhatsApp conversation it came from, if any.","title":"Waconversationid"}},"required":["id","ref","leadId","leadName","leadPhone","subject","description","type","status","priority","source","assignedToUserId","assignees","categoryId","categoryName","teamId","teamName","tags","sourceCallId","waConversationId","mergedIntoId","dueAt","overdue","sla","resolvedAt","closedAt","createdAt","updatedAt","version","canEdit","canManageAssignees","canReopenClosed","activities","hasOlderActivities","activitiesCursor"],"title":"TicketDetail","type":"object"},"TicketList":{"additionalProperties":true,"properties":{"pagination":{"$ref":"#/components/schemas/TicketListPagination"},"sort":{"$ref":"#/components/schemas/TicketListSort"},"success":{"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"tickets":{"items":{"$ref":"#/components/schemas/TicketSummary"},"title":"Tickets","type":"array"}},"required":["success","tickets","sort","pagination"],"title":"TicketList","type":"object"},"TicketListPagination":{"additionalProperties":true,"properties":{"currentPage":{"title":"Currentpage","type":"integer"},"hasNextPage":{"title":"Hasnextpage","type":"boolean"},"hasPreviousPage":{"title":"Haspreviouspage","type":"boolean"},"itemsPerPage":{"title":"Itemsperpage","type":"integer"},"totalCapped":{"description":"True when `totalItems` stopped counting at the cap.","title":"Totalcapped","type":"boolean"},"totalItems":{"title":"Totalitems","type":"integer"},"totalPages":{"title":"Totalpages","type":"integer"}},"required":["currentPage","totalPages","totalItems","totalCapped","itemsPerPage","hasNextPage","hasPreviousPage"],"title":"TicketListPagination","type":"object"},"TicketListSort":{"additionalProperties":true,"properties":{"dir":{"description":"`asc` or `desc`.","title":"Dir","type":"string"},"key":{"description":"Sort key used.","title":"Key","type":"string"}},"required":["key","dir"],"title":"TicketListSort","type":"object"},"TicketMutation":{"additionalProperties":true,"properties":{"activities":{"description":"Only the activities this request added.","items":{"$ref":"#/components/schemas/TicketActivityEntry"},"title":"Activities","type":"array"},"changed":{"description":"Fields that changed (`activities` when a note or reply was added).","items":{"type":"string"},"title":"Changed","type":"array"},"success":{"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"ticket":{"$ref":"#/components/schemas/TicketView","description":"The ticket after the change."}},"required":["success","ticket","changed","activities"],"title":"TicketMutation","type":"object"},"TicketReplyBody":{"properties":{"attachmentIds":{"description":"Files already uploaded to the ticket (console only).","items":{"type":"string"},"maxItems":5,"title":"Attachmentids","type":"array"},"clientId":{"description":"Your unique id for this reply (8-64 chars); a retry with it never sends twice.","maxLength":64,"minLength":8,"title":"Clientid","type":"string"},"templateEvent":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}],"description":"Ticket event (e.g. `waiting_on_customer`) whose approved template to send instead of text.","title":"Templateevent"},"text":{"default":"","description":"Reply text (inside the 24-hour window).","maxLength":4096,"title":"Text","type":"string"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"The ticket `version` you last read (optional).","title":"Version"}},"required":["clientId"],"title":"TicketReplyBody","type":"object"},"TicketResponse":{"additionalProperties":true,"properties":{"success":{"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"ticket":{"$ref":"#/components/schemas/TicketDetail"}},"required":["success","ticket"],"title":"TicketResponse","type":"object"},"TicketSummary":{"additionalProperties":true,"properties":{"assignedToUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First assignee's user id, or null when unassigned.","title":"Assignedtouserid"},"assignees":{"description":"Everyone assigned, in assignment order.","items":{"$ref":"#/components/schemas/TicketAssigneeRef"},"title":"Assignees","type":"array"},"categoryId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Category id (see `GET /tickets/categories`).","title":"Categoryid"},"categoryName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Category name.","title":"Categoryname"},"closedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was closed.","title":"Closedat"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was created.","title":"Createdat"},"description":{"description":"Details.","title":"Description","type":"string"},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Resolution due time (ISO 8601).","title":"Dueat"},"id":{"description":"Ticket id.","title":"Id","type":"string"},"leadId":{"description":"The lead (customer) the ticket is about.","title":"Leadid","type":"string"},"leadName":{"description":"The lead's name.","title":"Leadname","type":"string"},"leadPhone":{"description":"The lead's phone number.","title":"Leadphone","type":"string"},"mergedIntoId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set when this ticket was merged into another (then read-only).","title":"Mergedintoid"},"overdue":{"description":"True when past `dueAt` and not resolved.","title":"Overdue","type":"boolean"},"priority":{"description":"`low`, `normal`, `high` or `urgent`.","title":"Priority","type":"string"},"ref":{"description":"Short reference shown to people, e.g. `T-1A2B3C4D`.","title":"Ref","type":"string"},"resolvedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was resolved.","title":"Resolvedat"},"sla":{"additionalProperties":true,"description":"Service-level targets: `firstResponse`, `resolution` and `paused`.","title":"Sla","type":"object"},"source":{"description":"How it was opened: `manual`, `inbound_call`, `outbound_call`, `import` or `whatsapp_conversation`.","title":"Source","type":"string"},"sourceCallId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The call that opened the ticket, if any.","title":"Sourcecallid"},"status":{"description":"`open`, `in_progress`, `waiting_on_customer`, `resolved` or `closed`.","title":"Status","type":"string"},"subject":{"description":"One-line summary.","title":"Subject","type":"string"},"tags":{"description":"Tags.","items":{"type":"string"},"title":"Tags","type":"array"},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team id (see `GET /tickets/teams`).","title":"Teamid"},"teamName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team name.","title":"Teamname"},"type":{"description":"`support` or `sales_followup`.","title":"Type","type":"string"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it last changed.","title":"Updatedat"},"version":{"description":"Increases on every change; send it back as `version` to avoid overwriting.","title":"Version","type":"integer"},"waConversationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The WhatsApp conversation it came from, if any.","title":"Waconversationid"}},"required":["id","ref","leadId","leadName","leadPhone","subject","description","type","status","priority","source","assignedToUserId","assignees","categoryId","categoryName","teamId","teamName","tags","sourceCallId","waConversationId","mergedIntoId","dueAt","overdue","sla","resolvedAt","closedAt","createdAt","updatedAt","version"],"title":"TicketSummary","type":"object"},"TicketTeamItem":{"additionalProperties":true,"properties":{"assignmentMode":{"description":"`manual`, `round_robin` or `least_busy`: how new tickets in the team are assigned.","title":"Assignmentmode","type":"string"},"id":{"description":"Team id; send it as `teamId`.","title":"Id","type":"string"},"isDefault":{"description":"New tickets land here when neither their category nor their source picks a team.","title":"Isdefault","type":"boolean"},"members":{"description":"Team members.","items":{},"title":"Members","type":"array"},"name":{"title":"Name","type":"string"}},"required":["id","name","assignmentMode","isDefault","members"],"title":"TicketTeamItem","type":"object"},"TicketTeamList":{"additionalProperties":true,"properties":{"success":{"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"teams":{"items":{"$ref":"#/components/schemas/TicketTeamItem"},"title":"Teams","type":"array"}},"required":["success","teams"],"title":"TicketTeamList","type":"object"},"TicketUpdateBody":{"properties":{"categoryId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Category id; `null` clears it.","title":"Categoryid"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Details.","title":"Description"},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Resolution due time (ISO 8601).","title":"Dueat"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`low`, `normal`, `high` or `urgent`.","title":"Priority"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`open`, `in_progress`, `waiting_on_customer`, `resolved` or `closed`. Reopening a closed ticket needs a manager.","title":"Status"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"One-line summary.","title":"Subject"},"tags":{"anyOf":[{"items":{"type":"string"},"maxItems":20,"type":"array"},{"type":"null"}],"description":"Replaces the tags (up to 20).","title":"Tags"},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team id; `null` takes the ticket out of its team.","title":"Teamid"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`support` or `sales_followup`.","title":"Type"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"The `version` you last read; if the ticket changed since, the request fails with 409. Leave out to skip.","title":"Version"}},"title":"TicketUpdateBody","type":"object"},"TicketView":{"additionalProperties":true,"properties":{"assignedToUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First assignee's user id, or null when unassigned.","title":"Assignedtouserid"},"assignees":{"description":"Everyone assigned, in assignment order.","items":{"$ref":"#/components/schemas/TicketAssigneeRef"},"title":"Assignees","type":"array"},"canEdit":{"description":"Whether the key's user may change this ticket.","title":"Canedit","type":"boolean"},"canManageAssignees":{"description":"Whether the key's user may change who is assigned.","title":"Canmanageassignees","type":"boolean"},"canReopenClosed":{"description":"Whether the key's user may reopen it once closed.","title":"Canreopenclosed","type":"boolean"},"categoryId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Category id (see `GET /tickets/categories`).","title":"Categoryid"},"categoryName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Category name.","title":"Categoryname"},"closedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was closed.","title":"Closedat"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was created.","title":"Createdat"},"description":{"description":"Details.","title":"Description","type":"string"},"dueAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Resolution due time (ISO 8601).","title":"Dueat"},"id":{"description":"Ticket id.","title":"Id","type":"string"},"leadId":{"description":"The lead (customer) the ticket is about.","title":"Leadid","type":"string"},"leadName":{"description":"The lead's name.","title":"Leadname","type":"string"},"leadPhone":{"description":"The lead's phone number.","title":"Leadphone","type":"string"},"mergedIntoId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set when this ticket was merged into another (then read-only).","title":"Mergedintoid"},"overdue":{"description":"True when past `dueAt` and not resolved.","title":"Overdue","type":"boolean"},"priority":{"description":"`low`, `normal`, `high` or `urgent`.","title":"Priority","type":"string"},"ref":{"description":"Short reference shown to people, e.g. `T-1A2B3C4D`.","title":"Ref","type":"string"},"resolvedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it was resolved.","title":"Resolvedat"},"sla":{"additionalProperties":true,"description":"Service-level targets: `firstResponse`, `resolution` and `paused`.","title":"Sla","type":"object"},"source":{"description":"How it was opened: `manual`, `inbound_call`, `outbound_call`, `import` or `whatsapp_conversation`.","title":"Source","type":"string"},"sourceCallId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The call that opened the ticket, if any.","title":"Sourcecallid"},"status":{"description":"`open`, `in_progress`, `waiting_on_customer`, `resolved` or `closed`.","title":"Status","type":"string"},"subject":{"description":"One-line summary.","title":"Subject","type":"string"},"tags":{"description":"Tags.","items":{"type":"string"},"title":"Tags","type":"array"},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team id (see `GET /tickets/teams`).","title":"Teamid"},"teamName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Team name.","title":"Teamname"},"type":{"description":"`support` or `sales_followup`.","title":"Type","type":"string"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it last changed.","title":"Updatedat"},"version":{"description":"Increases on every change; send it back as `version` to avoid overwriting.","title":"Version","type":"integer"},"waConversationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The WhatsApp conversation it came from, if any.","title":"Waconversationid"}},"required":["id","ref","leadId","leadName","leadPhone","subject","description","type","status","priority","source","assignedToUserId","assignees","categoryId","categoryName","teamId","teamName","tags","sourceCallId","waConversationId","mergedIntoId","dueAt","overdue","sla","resolvedAt","closedAt","createdAt","updatedAt","version","canEdit","canManageAssignees","canReopenClosed"],"title":"TicketView","type":"object"},"TimelineItem":{"additionalProperties":true,"description":"One event on a lead's timeline.","properties":{"at":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it happened.","format":"date-time","title":"At"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Detail text: call summary, message text, note body.","title":"Body"},"href":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Path of the matching console page, when there is one.","title":"Href"},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ID of the call, message, note or other source row.","title":"Id"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Source-specific fields, such as call status.","title":"Meta"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"One-line summary, for example `Outbound call · 2m 05s`.","title":"Title"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Source: `call`, `whatsapp`, `order`, `ticket`, `note`, `change` or `callback`.","title":"Type"}},"title":"TimelineItem","type":"object"},"Tool":{"additionalProperties":true,"description":"An action an agent can take during a call.","properties":{"auth":{"additionalProperties":true,"description":"Auth settings without credential values.","title":"Auth","type":"object"},"authSecretSet":{"default":false,"description":"A credential is stored (never returned).","title":"Authsecretset","type":"boolean"},"bodyTemplate":{"additionalProperties":true,"description":"Request body template.","title":"Bodytemplate","type":"object"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 creation time.","title":"Createdat"},"description":{"default":"","description":"When the agent should use the tool.","title":"Description","type":"string"},"headers":{"additionalProperties":true,"description":"Extra request headers.","title":"Headers","type":"object"},"id":{"description":"Tool id. Attach it to an agent with an entry in the agent config `tools` list whose `config.tool_id` is this id, or from the console.","title":"Id","type":"string"},"isActive":{"default":true,"description":"Inactive tools are not offered on calls.","title":"Isactive","type":"boolean"},"kind":{"description":"`api_request`, `function`, `end_call` or `mcp`.","title":"Kind","type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"HTTP method for `api_request`.","title":"Method"},"name":{"description":"Name the language model sees.","title":"Name","type":"string"},"parametersSchema":{"additionalProperties":true,"description":"JSON Schema of the arguments.","title":"Parametersschema","type":"object"},"timeoutMs":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Request timeout in milliseconds.","title":"Timeoutms"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 last update time.","title":"Updatedat"},"url":{"default":"","description":"Endpoint for `api_request`.","title":"Url","type":"string"}},"required":["id","name","kind"],"title":"Tool","type":"object"},"ToolListResponse":{"additionalProperties":true,"description":"Tools in the workspace, newest first.","properties":{"success":{"default":true,"description":"Always true on success.","title":"Success","type":"boolean"},"tools":{"items":{"$ref":"#/components/schemas/Tool"},"title":"Tools","type":"array"}},"required":["tools"],"title":"ToolListResponse","type":"object"},"ToolResponse":{"additionalProperties":true,"description":"One tool.","properties":{"success":{"default":true,"description":"Always true on success.","title":"Success","type":"boolean"},"tool":{"$ref":"#/components/schemas/Tool"}},"required":["tool"],"title":"ToolResponse","type":"object"},"TranscriptTurn":{"additionalProperties":true,"description":"One turn of the conversation.","properties":{"role":{"description":"`user` (the other party) or `assistant` (your agent).","title":"Role","type":"string"},"text":{"description":"What was said.","title":"Text","type":"string"}},"required":["role","text"],"title":"TranscriptTurn","type":"object"},"UsageBalance":{"additionalProperties":true,"properties":{"balanceInrPaise":{"description":"Wallet balance, in paise.","title":"Balanceinrpaise","type":"integer"},"minutesAtCurrentRate":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Minutes the balance pays for; null without a rate.","title":"Minutesatcurrentrate"},"ratePerMinuteInrPaise":{"description":"Price of a minute paid from the wallet, in paise.","title":"Rateperminuteinrpaise","type":"integer"}},"required":["balanceInrPaise","ratePerMinuteInrPaise"],"title":"UsageBalance","type":"object"},"UsageCalls":{"additionalProperties":true,"properties":{"billedMinutes":{"description":"Minutes charged for this workspace's calls in the period.","title":"Billedminutes","type":"integer"},"completed":{"description":"Calls that connected and ended normally.","title":"Completed","type":"integer"},"durationSeconds":{"description":"Talk time of completed calls, in seconds.","title":"Durationseconds","type":"number"},"total":{"description":"Calls created in the period, every status, test calls included.","title":"Total","type":"integer"},"walletChargedInrPaise":{"description":"Money taken from the wallet for calls in the period, in paise (1 INR = 100 paise).","title":"Walletchargedinrpaise","type":"integer"}},"required":["total","completed","durationSeconds","billedMinutes","walletChargedInrPaise"],"title":"UsageCalls","type":"object"},"UsagePeriod":{"additionalProperties":true,"properties":{"basis":{"description":"`custom` when you sent `from`/`to`; otherwise the current billing period, or the last 30 days when the workspace has none.","enum":["billing_period","last_30_days","custom"],"title":"Basis","type":"string"},"end":{"description":"End of the period (exclusive).","format":"date-time","title":"End","type":"string"},"start":{"description":"Start of the period (inclusive).","format":"date-time","title":"Start","type":"string"}},"required":["start","end","basis"],"title":"UsagePeriod","type":"object"},"UsagePlan":{"additionalProperties":true,"properties":{"minutesIncluded":{"default":0,"description":"Minutes the plan includes this period.","title":"Minutesincluded","type":"integer"},"minutesRemaining":{"default":0,"description":"Included minutes left this period.","title":"Minutesremaining","type":"integer"},"minutesUsed":{"default":0,"description":"Minutes used this period.","title":"Minutesused","type":"integer"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Plan name.","title":"Name"},"overageAmountInrPaise":{"default":0,"description":"Charge for those extra minutes, in paise.","title":"Overageamountinrpaise","type":"integer"},"overageMinutes":{"default":0,"description":"Minutes used beyond the included minutes.","title":"Overageminutes","type":"integer"},"periodEnd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End of the current billing period.","title":"Periodend"},"periodStart":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start of the current billing period.","title":"Periodstart"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Plan identifier.","title":"Slug"}},"title":"UsagePlan","type":"object"},"VoiceCatalogResponse":{"additionalProperties":true,"description":"Active voices, providers and languages.","properties":{"languages":{"items":{"$ref":"#/components/schemas/CatalogLanguage"},"title":"Languages","type":"array"},"providers":{"items":{"$ref":"#/components/schemas/CatalogVoiceProvider"},"title":"Providers","type":"array"},"success":{"default":true,"description":"Always true on success.","title":"Success","type":"boolean"},"voices":{"items":{"$ref":"#/components/schemas/CatalogVoice"},"title":"Voices","type":"array"}},"required":["providers","voices","languages"],"title":"VoiceCatalogResponse","type":"object"},"WebhookDelivery":{"additionalProperties":true,"properties":{"attempts":{"description":"Attempts made so far (up to 12).","title":"Attempts","type":"integer"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the delivery was queued.","title":"Createdat"},"deliveredAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When your endpoint accepted the event.","title":"Deliveredat"},"endpointId":{"description":"Endpoint the event is sent to.","title":"Endpointid","type":"string"},"eventId":{"description":"Event id (`evt_...`), also sent as the `webhook-id` header.","title":"Eventid","type":"string"},"eventType":{"description":"Event type, such as `call.completed`.","title":"Eventtype","type":"string"},"id":{"description":"Delivery id. A redelivery is a new delivery of the same event.","title":"Id","type":"string"},"lastAttemptAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time of the last attempt.","title":"Lastattemptat"},"lastError":{"description":"Why the last attempt failed, such as `HTTP 500` or `timeout`; empty on success.","title":"Lasterror","type":"string"},"lastStatusCode":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"HTTP status your endpoint returned on the last attempt.","title":"Laststatuscode"},"latencyMs":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Duration of the last attempt in milliseconds.","title":"Latencyms"},"nextAttemptAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the next attempt is due, while pending.","title":"Nextattemptat"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"The event envelope sent as the body. Returned for a single delivery, not in lists.","title":"Payload"},"responseSnippet":{"description":"First 1 KB of your endpoint's last response body.","title":"Responsesnippet","type":"string"},"status":{"description":"`pending` waits for its next attempt; `delivered` and `failed` are final.","enum":["pending","processing","delivered","failed"],"title":"Status","type":"string"}},"required":["id","eventId","eventType","endpointId","status","attempts","lastError","responseSnippet"],"title":"WebhookDelivery","type":"object"},"WebhookDeliveryList":{"additionalProperties":true,"properties":{"hasMore":{"description":"True when another page exists.","title":"Hasmore","type":"boolean"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` to get the next page; null on the last page.","title":"Nextcursor"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"webhookDeliveries":{"items":{"$ref":"#/components/schemas/WebhookDelivery"},"title":"Webhookdeliveries","type":"array"}},"required":["webhookDeliveries","hasMore"],"title":"WebhookDeliveryList","type":"object"},"WebhookDeliveryResponse":{"additionalProperties":true,"properties":{"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"webhookDelivery":{"$ref":"#/components/schemas/WebhookDelivery"}},"required":["webhookDelivery"],"title":"WebhookDeliveryResponse","type":"object"},"WebhookEndpoint":{"additionalProperties":true,"properties":{"consecutiveFailures":{"description":"Failed deliveries in a row since the last success.","title":"Consecutivefailures","type":"integer"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Creation time (ISO 8601).","title":"Createdat"},"description":{"description":"Label shown in the console.","title":"Description","type":"string"},"disabledAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the endpoint was disabled automatically (ISO 8601).","title":"Disabledat"},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why deliveries stopped, when they were disabled automatically.","title":"Disabledreason"},"enabled":{"description":"False when paused by you or disabled after repeated failures.","title":"Enabled","type":"boolean"},"events":{"description":"Subscribed event types; empty means every event type.","items":{"type":"string"},"title":"Events","type":"array"},"id":{"description":"Endpoint id.","title":"Id","type":"string"},"lastFailureAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time of the most recent failed delivery.","title":"Lastfailureat"},"lastStatus":{"description":"Result of the most recent attempt, such as `HTTP 200` or `timeout`.","title":"Laststatus","type":"string"},"lastSuccessAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time of the most recent successful delivery.","title":"Lastsuccessat"},"previousSecretExpiresAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"After a rotation, deliveries are also signed with the old secret until this time.","title":"Previoussecretexpiresat"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last change (ISO 8601).","title":"Updatedat"},"url":{"description":"Where events are sent.","title":"Url","type":"string"}},"required":["id","url","description","events","enabled","consecutiveFailures","lastStatus"],"title":"WebhookEndpoint","type":"object"},"WebhookEndpointCreate":{"properties":{"description":{"default":"","description":"Label shown in the console.","maxLength":500,"title":"Description","type":"string"},"enabled":{"default":true,"description":"Set false to create the endpoint without sending to it yet.","title":"Enabled","type":"boolean"},"events":{"description":"Event types to receive (see `GET /webhook-event-types`). Empty means every event type.","items":{"type":"string"},"maxItems":50,"title":"Events","type":"array"},"url":{"description":"Public `https://` URL that receives events.","maxLength":2048,"minLength":1,"title":"Url","type":"string"}},"required":["url"],"title":"WebhookEndpointCreate","type":"object"},"WebhookEndpointDeleted":{"additionalProperties":true,"properties":{"deleted":{"default":true,"description":"Always true.","title":"Deleted","type":"boolean"},"id":{"description":"The deleted endpoint's id.","title":"Id","type":"string"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["id"],"title":"WebhookEndpointDeleted","type":"object"},"WebhookEndpointList":{"additionalProperties":true,"properties":{"hasMore":{"default":false,"description":"Always false.","title":"Hasmore","type":"boolean"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Always null: every endpoint is returned in one page.","title":"Nextcursor"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"webhookEndpoints":{"items":{"$ref":"#/components/schemas/WebhookEndpoint"},"title":"Webhookendpoints","type":"array"}},"required":["webhookEndpoints"],"title":"WebhookEndpointList","type":"object"},"WebhookEndpointResponse":{"additionalProperties":true,"properties":{"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"webhookEndpoint":{"$ref":"#/components/schemas/WebhookEndpoint"}},"required":["webhookEndpoint"],"title":"WebhookEndpointResponse","type":"object"},"WebhookEndpointSecretResponse":{"additionalProperties":true,"properties":{"secret":{"description":"Signing secret (`whsec_...`). Shown only in this response; store it securely.","title":"Secret","type":"string"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"},"webhookEndpoint":{"$ref":"#/components/schemas/WebhookEndpoint"}},"required":["webhookEndpoint","secret"],"title":"WebhookEndpointSecretResponse","type":"object"},"WebhookEndpointUpdate":{"properties":{"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"description":"New label.","title":"Description"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Enable or pause deliveries. Enabling clears the failure count and disabled reason.","title":"Enabled"},"events":{"anyOf":[{"items":{"type":"string"},"maxItems":50,"type":"array"},{"type":"null"}],"description":"Replaces the event filter. Empty means every event type.","title":"Events"},"url":{"anyOf":[{"maxLength":2048,"minLength":1,"type":"string"},{"type":"null"}],"description":"New endpoint URL.","title":"Url"}},"title":"WebhookEndpointUpdate","type":"object"},"WebhookEventType":{"additionalProperties":true,"properties":{"description":{"description":"When the event is sent.","title":"Description","type":"string"},"type":{"description":"Event type name used in `events` filters and the envelope `type`.","title":"Type","type":"string"}},"required":["type","description"],"title":"WebhookEventType","type":"object"},"WebhookEventTypeList":{"additionalProperties":true,"properties":{"eventTypes":{"items":{"$ref":"#/components/schemas/WebhookEventType"},"title":"Eventtypes","type":"array"},"success":{"default":true,"description":"Always true on a 2xx response.","title":"Success","type":"boolean"}},"required":["eventTypes"],"title":"WebhookEventTypeList","type":"object"},"WhatsAppMediaRef":{"properties":{"caption":{"default":"","description":"Caption shown under an image, video or document.","maxLength":1024,"title":"Caption","type":"string"},"filename":{"default":"","description":"File name shown for a document.","maxLength":240,"title":"Filename","type":"string"},"id":{"default":"","description":"WhatsApp media id of a file you already uploaded.","maxLength":128,"title":"Id","type":"string"},"link":{"default":"","description":"Public https URL of the file.","maxLength":2000,"title":"Link","type":"string"}},"title":"WhatsAppMediaRef","type":"object"},"WhatsAppMessage":{"additionalProperties":true,"properties":{"conversationId":{"description":"The WhatsApp conversation the message belongs to.","title":"Conversationid","type":"string"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the message was created (ISO 8601).","title":"Createdat"},"error":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppMessageError"},{"type":"null"}],"description":"Why WhatsApp refused the message, when `status` is `failed`."},"id":{"description":"Message id. Use it with `GET /whatsapp/messages/{messageId}`.","title":"Id","type":"string"},"status":{"description":"`queued` → `accepted` → `sent` → `delivered` → `read`; `failed` is final. `unknown` means WhatsApp did not answer clearly; a later status update settles it.","title":"Status","type":"string"},"wamid":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"WhatsApp's message id once WhatsApp accepted the message.","title":"Wamid"}},"required":["id","wamid","status","conversationId","error","createdAt"],"title":"WhatsAppMessage","type":"object"},"WhatsAppMessageError":{"additionalProperties":true,"properties":{"code":{"anyOf":[{"type":"integer"},{"type":"string"},{"type":"null"}],"description":"WhatsApp error code.","title":"Code"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"WhatsApp error title.","title":"Message"}},"title":"WhatsAppMessageError","type":"object"},"WhatsAppMessageSend":{"properties":{"contactId":{"default":"","description":"Id of an existing WhatsApp contact, instead of `to`.","title":"Contactid","type":"string"},"content":{"description":"For `interactive`, `location` or `contacts`: the object the WhatsApp Cloud API takes under that key.","title":"Content"},"media":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppMediaRef"},{"type":"null"}],"description":"Required for media types: `link` or `id`."},"optIn":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppOptIn"},{"type":"null"}],"description":"Record the recipient's opt-in with this send (needed before marketing templates)."},"phoneId":{"default":"","description":"Your sending WhatsApp number's id. Leave out to use your default number.","title":"Phoneid","type":"string"},"template":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppTemplateRef"},{"type":"null"}],"description":"Required for `type=template`."},"text":{"default":"","description":"Message text for `type=text`.","maxLength":4096,"title":"Text","type":"string"},"to":{"default":"","description":"Recipient in international format, e.g. `+919812345678`. Or send `contactId`.","maxLength":32,"title":"To","type":"string"},"type":{"default":"template","description":"`template`, `text`, `image`, `video`, `audio`, `document`, `sticker`, `interactive`, `location` or `contacts`. Everything except `template` needs an open 24-hour window.","title":"Type","type":"string"}},"title":"WhatsAppMessageSend","type":"object"},"WhatsAppOptIn":{"properties":{"source":{"description":"Where consent was collected, e.g. `checkout`.","maxLength":64,"minLength":1,"title":"Source","type":"string"},"text":{"default":"","description":"The consent wording the customer agreed to.","maxLength":2000,"title":"Text","type":"string"}},"required":["source"],"title":"WhatsAppOptIn","type":"object"},"WhatsAppTemplate":{"additionalProperties":true,"properties":{"category":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`MARKETING`, `UTILITY` or `AUTHENTICATION`.","title":"Category"},"components":{"description":"Header, body, footer and buttons as WhatsApp stores them.","items":{"additionalProperties":true,"type":"object"},"title":"Components","type":"array"},"id":{"description":"Template id.","title":"Id","type":"string"},"language":{"description":"Language code; send it in `template.language`.","title":"Language","type":"string"},"name":{"description":"Template name; send it in `template.name`.","title":"Name","type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Review status; only `APPROVED` templates can be sent.","title":"Status"}},"required":["id","name","language","category","status","components"],"title":"WhatsAppTemplate","type":"object"},"WhatsAppTemplateList":{"additionalProperties":true,"properties":{"templates":{"description":"Templates, sorted by name and language (up to 500).","items":{"$ref":"#/components/schemas/WhatsAppTemplate"},"title":"Templates","type":"array"}},"required":["templates"],"title":"WhatsAppTemplateList","type":"object"},"WhatsAppTemplateRef":{"properties":{"components":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"description":"Advanced: WhatsApp Cloud API `components` sent as-is instead of `values`.","title":"Components"},"language":{"description":"Template language code, e.g. `en` or `en_US`.","maxLength":16,"minLength":2,"title":"Language","type":"string"},"name":{"description":"Template name exactly as approved.","maxLength":512,"minLength":1,"title":"Name","type":"string"},"values":{"additionalProperties":true,"description":"Values for the template's variables: `body` as a list in order (or `{\"1\": ...}`), plus `header` and `buttons` when the template has them.","title":"Values","type":"object"}},"required":["name","language"],"title":"WhatsAppTemplateRef","type":"object"},"WorkspaceApiKey":{"additionalProperties":true,"properties":{"expiresAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"When the key stops working; null if never.","title":"Expiresat"},"id":{"description":"Key id.","title":"Id","type":"string"},"name":{"default":"","description":"Name given to the key when it was created.","title":"Name","type":"string"},"prefix":{"description":"First characters of the key, as shown in the console.","title":"Prefix","type":"string"},"scopes":{"$ref":"#/components/schemas/WorkspaceKeyScopes"}},"required":["id","prefix","scopes"],"title":"WorkspaceApiKey","type":"object"},"WorkspaceIdentity":{"additionalProperties":true,"properties":{"apiKey":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceApiKey"},{"type":"null"}],"description":"The key that authenticated the request."},"rateLimit":{"$ref":"#/components/schemas/WorkspaceRateLimit"},"success":{"default":true,"title":"Success","type":"boolean"},"workspace":{"anyOf":[{"$ref":"#/components/schemas/WorkspaceSummary"},{"type":"null"}],"description":"Workspace the request runs in."}},"required":["workspace","apiKey","rateLimit"],"title":"WorkspaceIdentity","type":"object"},"WorkspaceKeyScopes":{"additionalProperties":true,"properties":{"access":{"description":"`full` or `read` (read-only keys may only send GET).","title":"Access","type":"string"},"resources":{"description":"Resource groups the key may reach. Empty means all of them.","items":{"type":"string"},"title":"Resources","type":"array"}},"required":["access","resources"],"title":"WorkspaceKeyScopes","type":"object"},"WorkspaceRateLimit":{"additionalProperties":true,"properties":{"limit":{"description":"Requests per minute allowed for this key. 0 means no limit.","title":"Limit","type":"integer"},"windowSeconds":{"default":60,"description":"Length of the rate-limit window.","title":"Windowseconds","type":"integer"}},"required":["limit"],"title":"WorkspaceRateLimit","type":"object"},"WorkspaceSummary":{"additionalProperties":true,"properties":{"id":{"description":"Workspace id.","title":"Id","type":"string"},"name":{"description":"Workspace name.","title":"Name","type":"string"},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Agency workspace this client workspace belongs to, if any.","title":"Parentid"}},"required":["id","name"],"title":"WorkspaceSummary","type":"object"},"WorkspaceUsage":{"additionalProperties":true,"properties":{"balance":{"anyOf":[{"$ref":"#/components/schemas/UsageBalance"},{"type":"null"}],"description":"Wallet balance; null when billing is not enabled on this deployment."},"billingEnabled":{"description":"Whether plan limits and wallet charges apply on this deployment.","title":"Billingenabled","type":"boolean"},"calls":{"$ref":"#/components/schemas/UsageCalls"},"period":{"$ref":"#/components/schemas/UsagePeriod"},"plan":{"anyOf":[{"$ref":"#/components/schemas/UsagePlan"},{"type":"null"}],"description":"Current billing period of the plan this workspace uses (an agency's shared plan for a client workspace it pays for); null without a plan."},"success":{"default":true,"title":"Success","type":"boolean"}},"required":["period","calls","plan","balance","billingEnabled"],"title":"WorkspaceUsage","type":"object"}},"securitySchemes":{"ApiKeyAuth":{"description":"Create in the console: Settings → API & webhooks.","in":"header","name":"X-API-Key","type":"apiKey"},"BearerAuth":{"description":"The same API key as `Authorization: Bearer vk_live_…`.","scheme":"bearer","type":"http"},"LeadWebhookKey":{"description":"The key of a lead integration.","in":"header","name":"X-Lead-Webhook-Key","type":"apiKey"},"LeadWebhookKeyQuery":{"in":"query","name":"key","type":"apiKey"}}},"info":{"description":"Manage leads, campaigns and AI agents, place calls, and receive call results from your own systems.\n\n## Base URL\n\nAll endpoints live under `https://api.callmitra.ai/api/v1`. Requests and responses are JSON over HTTPS.\n\n## Authentication\n\n1. In the console, open **Settings → API & webhooks** and create an API key (managers only).\n   The secret is shown once; store it on your server.\n2. Send it on every request in the `X-API-Key` header (or as `Authorization: Bearer <key>`).\n\n```bash\ncurl https://api.callmitra.ai/api/v1/leads/?limit=5 \\\n  -H \"X-API-Key: $API_KEY\"\n```\n\nA key acts as the user who created it: it sees that workspace's data and has that user's\npermissions. Revoke a key from the same page at any time. Never put a key in a browser or\nmobile app.\n\nWhen you create a key you can limit it:\n\n- **Read only**: the key can call `GET` endpoints but nothing that changes data (`403`).\n- **Can access**: choose resources (Leads, Campaigns, Calls, Agents, Numbers, WhatsApp,\n  Tickets, Webhooks). Any other endpoint answers `403`. A limited key can never create API\n  keys or change billing.\n- **Expiry**: 30 days, 90 days, 1 year or never. An expired key answers `401`.\n\nGive each integration its own key with the smallest access it needs.\n\n## Rate limits\n\n300 requests per minute per API key (each key has its own budget, separate from the\nconsole). Every response carries `RateLimit-Limit`, `RateLimit-Remaining` and\n`RateLimit-Reset` (seconds until the window resets). Over the limit you get\n`429 rate_limit_exceeded` with `Retry-After`; wait that long and retry with backoff. Use the bulk endpoints for large jobs.\n\n## Errors\n\nErrors use HTTP status codes with a JSON body:\n\n```json\n{\n  \"detail\": \"Campaign not found\",\n  \"error\": {\n    \"type\": \"not_found_error\",\n    \"code\": \"resource_not_found\",\n    \"message\": \"Campaign not found\",\n    \"param\": null,\n    \"docUrl\": null,\n    \"requestId\": \"req_5f1c2e9b7a3d4c0e8b6a1f2d3c4b5a69\"\n  }\n}\n```\n\nBranch on `error.code`: it is stable, and every operation lists the codes it can return\nunder its responses. `error.message` is for people and may change. `detail` keeps the\nearlier format (a message, an object, or for `422` the list of field errors). Quote\n`requestId` (also the `X-Request-ID` response header) when you contact support.\n\n| Status | Meaning |\n|---|---|\n| 400 | The request is not valid for the current state (for example, campaign not active). |\n| 401 | Missing or invalid API key. |\n| 402 | Your plan does not allow this action. |\n| 403 | The key's user does not have permission. |\n| 404 | Not found, or not in your workspace. |\n| 409 | Conflict, for example a call is already in progress. |\n| 422 | Invalid or missing fields. |\n| 429 | Rate limit or daily call limit reached. |\n\n## Conventions\n\n- Use paths exactly as listed. Collection paths end with a slash (`/api/v1/leads/`); without it\n  you get a `307` redirect to the slashed URL.\n- IDs are UUID strings. Timestamps are ISO 8601 in UTC.\n- Keys inside an agent's `config` / `draftConfig` are snake_case (`tts_volume`, `system_prompt`)\n  while the agent object around them is camelCase: the config is stored and imported in that\n  shape. Unknown agent config keys are dropped without an error.\n- Phone numbers: send E.164 (`+91…`). Lead endpoints store them as sent and do not check for\n  duplicates; search first (`GET /api/v1/leads/?search=`) or push leads through the\n  [lead intake webhook](#tag/Lead-intake-webhook), which drops repeats.\n- List endpoints take `page` (from 1) and `limit` (up to 200) and return `pagination`.\n- Within v1, changes are additive: new fields and endpoints may appear, existing ones are not\n  removed or renamed. Ignore fields you do not use.\n\n## A typical integration\n\n1. `GET /api/v1/agents/` and `GET /api/v1/phone-numbers/` to pick the agent and caller ID.\n2. `POST /api/v1/campaigns/create-with-leads` with your leads.\n3. `POST /api/v1/campaigns/{campaign_id}/start`. Calls are placed inside the campaign's dial window.\n4. Receive a `call.completed` [webhook](#tag/Webhooks) after each call, or poll\n   `GET /api/v1/calls/?campaignId=`.","title":"CallMitra API","version":"v1"},"openapi":"3.1.0","paths":{"/api/v1/agency/clients":{"get":{"description":"For an agency: every client workspace it manages, oldest first. Send a client's `id` as `X-Workspace-Id` on any other request to run it inside that workspace. Every key of the agency can call this, whatever its resources; the key's user must be a manager. The workspace needs the agency add-on; without it, or from a client workspace, the call gets `permission_denied`.","operationId":"listAgencyClients","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"agency":{"id":"7b1c2f0e-1d2a-4c3b-9a8e-5f6d7c8b9a01","name":"Acme Agency"},"clients":[{"createdAt":"2026-03-02T09:15:00+00:00","id":"3f2e1d0c-9b8a-4765-8432-1f0e9d8c7b6a","name":"Sunrise Dental","status":"active"}],"success":true},"schema":{"$ref":"#/components/schemas/AgencyClientList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List client workspaces","tags":["Workspace"],"x-api-key-resource":"any","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]}},"/api/v1/agents/":{"get":{"description":"Every agent in the workspace, newest first, with its published `config` and working `draftConfig`.","operationId":"listAgents","parameters":[{"description":"Include archived agents (default true).","in":"query","name":"includeArchived","required":false,"schema":{"default":true,"title":"Includearchived","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"agents":[{"config":{"language":"hi-IN","llm_model":"gpt-4o-mini","tts":"sarvam","voice":"priya"},"id":"3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10","language":"hi-IN","name":"Priya","rosterState":"in_training","status":"draft","takingCalls":false,"unpublishedChanges":false}],"success":true},"schema":{"$ref":"#/components/schemas/AgentListResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List agents","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]},"post":{"description":"Creates an agent from a `config` (see the AgentConfig schema). It starts as a `draft`; publish it with publishAgent, or send `status: published`. Values outside the documented range or list, and a language, voice or model that is not available, are refused with `parameter_invalid` naming the field (for example `config.voice`).","operationId":"createAgent","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"config":{"language":"hi-IN","llm_model":"gpt-4o-mini","stt":"sarvam","template_payload":{"greeting_message":"Namaste, main Acme Realty se Priya bol rahi hoon.","system_prompt":"You are Priya from Acme Realty. Qualify the lead's budget and preferred area."},"tts":"sarvam","voice":"priya"},"name":"Priya"},"schema":{"$ref":"#/components/schemas/AgentCreateInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"agent":{"config":{"language":"hi-IN","llm_model":"gpt-4o-mini","tts":"sarvam","voice":"priya"},"id":"3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10","language":"hi-IN","name":"Priya","rosterState":"in_training","status":"draft","takingCalls":false,"unpublishedChanges":false},"success":true},"schema":{"$ref":"#/components/schemas/AgentResponse"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"413":{"content":{"application/json":{"examples":{"payload_too_large":{"$ref":"#/components/examples/payload_too_large"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payload too large: `payload_too_large`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Create an agent","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","resource_not_found","idempotency_key_reused","idempotency_request_in_progress","payload_too_large","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/agents/import":{"post":{"description":"Creates a **draft** agent from JSON exported from another platform. Review it,\nthen publish with publishAgent. Fields that have no equivalent, and values that had to be\napproximated, are listed in `warnings` instead of failing the import.\n\n| Our field | Vapi | Retell | Bland |\n| --- | --- | --- | --- |\n| name | `name` | `agent_name` | `name` |\n| system prompt | system entries of `model.messages` | `llm.general_prompt` | `task` (or `prompt`) |\n| greeting | `firstMessage` | `llm.begin_message` | `first_sentence` |\n| language model | `model.model` | `llm.model` | `model` (Bland tiers map to the default) |\n| temperature | `model.temperature` | `llm.model_temperature` | `temperature` |\n| voice | `voice.provider` + `voice.voiceId` | `voice_id` | `voice` |\n| transcriber | `transcriber.provider` | - | - |\n| language | `transcriber.language` | `language` | `language` |\n| speaking speed | `voice.speed` | `voice_speed` | - |\n| call time limit | `maxDurationSeconds` | `max_call_duration_ms` | `max_duration` (minutes) |\n| background sound | `backgroundSound` | `ambient_sound` | `background_track` |\n| recording | `recordingEnabled` | - | `record` |\n\nA voice or language that is not available here is replaced: first by a voice with the same id\nor name, then by the language's default voice, with a warning. Tools, knowledge bases, webhooks\nand multi-state flows are not imported. `callmitra` copies another workspace's agent config\n(signing secrets are not copied).","operationId":"importAgent","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"config":{"firstMessage":"Hi, this is Riley from Acme Realty. Is now a good time?","model":{"messages":[{"content":"You qualify home-buyer leads.","role":"system"}],"model":"gpt-4o","provider":"openai"},"name":"Riley","transcriber":{"language":"en","provider":"deepgram"},"voice":{"provider":"11labs","voiceId":"burt"}},"source":"vapi"},"schema":{"$ref":"#/components/schemas/AgentImportInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"agent":{"id":"3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10","name":"Riley","status":"draft"},"success":true,"warnings":[{"field":"language","message":"Language 'en' is not available; using en-IN."},{"field":"voice","message":"Voice '11labs/burt' is not available; using sarvam voice 'shubh'."}]},"schema":{"$ref":"#/components/schemas/AgentImportResponse"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"413":{"content":{"application/json":{"examples":{"payload_too_large":{"$ref":"#/components/examples/payload_too_large"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payload too large: `payload_too_large`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Import an agent from another platform","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","idempotency_key_reused","idempotency_request_in_progress","payload_too_large","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/agents/{agent_id}":{"delete":{"description":"Deletes the agent permanently. Past calls keep their records. To keep the agent but stop it, use pauseAgent.","operationId":"deleteAgent","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"title":"Agent Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"message":"Agent deleted","success":true},"schema":{"$ref":"#/components/schemas/AgentDeleteResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"agent_not_found":{"$ref":"#/components/examples/agent_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `agent_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Delete an agent","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","agent_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"get":{"description":"The agent with its published `config`, working `draftConfig`, status and phone numbers.","operationId":"getAgent","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"title":"Agent Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"agent":{"config":{"language":"hi-IN","llm_model":"gpt-4o-mini","tts":"sarvam","voice":"priya"},"id":"3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10","language":"hi-IN","name":"Priya","rosterState":"in_training","status":"draft","takingCalls":false,"unpublishedChanges":false},"success":true},"schema":{"$ref":"#/components/schemas/AgentResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"agent_not_found":{"$ref":"#/components/examples/agent_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `agent_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get an agent","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","agent_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"patch":{"description":"Saves the change as the agent's draft; calls keep using the published version until you call publishAgent. Only the `config` keys you send change; a nested object you send (for example `script`) replaces the stored one. Bad values are refused with `parameter_invalid` naming the field.","operationId":"updateAgent","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"title":"Agent Id","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"config":{"tts_speed":1.1,"voice":"anushka"}},"schema":{"$ref":"#/components/schemas/AgentUpdateInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"agent":{"config":{"language":"hi-IN","llm_model":"gpt-4o-mini","tts":"sarvam","voice":"priya"},"id":"3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10","language":"hi-IN","name":"Priya","rosterState":"in_training","status":"draft","takingCalls":false,"unpublishedChanges":true},"success":true},"schema":{"$ref":"#/components/schemas/AgentResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"agent_not_found":{"$ref":"#/components/examples/agent_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `agent_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"413":{"content":{"application/json":{"examples":{"payload_too_large":{"$ref":"#/components/examples/payload_too_large"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payload too large: `payload_too_large`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"agent_state_blocked":{"$ref":"#/components/examples/agent_state_blocked"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `agent_state_blocked`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Update an agent","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","agent_not_found","payload_too_large","agent_state_blocked","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/agents/{agent_id}/go-live":{"post":{"description":"Switches the agent on (`takingCalls: true`, `rosterState: live`). It needs a phone number assigned to the agent. A waiting draft (or a never-published agent) is published first, with the same checks as publishAgent. When a rule fails (no phone number, archived agent, draft breaks a publish rule) the call is refused with `agent_state_blocked` and a message naming what is missing.","operationId":"startAgent","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"title":"Agent Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"agent":{"id":"3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10","name":"Priya","rosterState":"live","status":"published","takingCalls":true,"unpublishedChanges":false},"success":true},"schema":{"$ref":"#/components/schemas/AgentResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"agent_not_found":{"$ref":"#/components/examples/agent_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `agent_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"agent_state_blocked":{"$ref":"#/components/examples/agent_state_blocked"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `agent_state_blocked`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Start taking calls","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","agent_not_found","agent_state_blocked","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/agents/{agent_id}/pause":{"post":{"description":"Switches the agent off (`takingCalls: false`). Its configuration is kept; start it again with startAgent.","operationId":"pauseAgent","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"title":"Agent Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"agent":{"id":"3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10","name":"Priya","rosterState":"paused","status":"published","takingCalls":false,"unpublishedChanges":false},"success":true},"schema":{"$ref":"#/components/schemas/AgentResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"agent_not_found":{"$ref":"#/components/examples/agent_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `agent_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Stop taking calls","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","agent_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/agents/{agent_id}/post-call-webhook":{"put":{"description":"After each of this agent's calls, a summary is POSTed to `url` (used when the campaign has no webhook of its own). `trigger` picks which calls are sent: `every`, `completed` or `voicemail`. Send an empty `url` to turn it off. Omit `secret` to keep the stored one; the secret is never returned (`hasSecret` says whether one is set). The change applies to the live agent at once. A URL that does not point at a public internet address is refused with `agent_state_blocked`.","operationId":"setAgentPostCallWebhook","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"title":"Agent Id","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"secret":"whsec_example","trigger":"completed","url":"https://example.com/hooks/calls"},"schema":{"$ref":"#/components/schemas/PostCallWebhookInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"agent":{"id":"3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10","name":"Priya","status":"published"},"success":true,"webhook":{"hasSecret":true,"trigger":"completed","url":"https://example.com/hooks/calls"}},"schema":{"$ref":"#/components/schemas/AgentPostCallWebhookResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"agent_not_found":{"$ref":"#/components/examples/agent_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `agent_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"agent_state_blocked":{"$ref":"#/components/examples/agent_state_blocked"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `agent_state_blocked`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Set an agent's post-call webhook","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","agent_not_found","agent_state_blocked","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/agents/{agent_id}/publish":{"post":{"description":"Makes the saved draft the version used on calls and clears `unpublishedChanges`. Refused with `agent_state_blocked` when the draft breaks a rule (script too long, voice not available for the language, no usable language-model key, archived agent).","operationId":"publishAgent","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"title":"Agent Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"agent":{"id":"3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10","name":"Priya","rosterState":"paused","status":"published","takingCalls":false,"unpublishedChanges":false},"success":true},"schema":{"$ref":"#/components/schemas/AgentResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"agent_not_found":{"$ref":"#/components/examples/agent_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `agent_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"agent_state_blocked":{"$ref":"#/components/examples/agent_state_blocked"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `agent_state_blocked`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Publish the agent's draft","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","agent_not_found","agent_state_blocked","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/agents/{agent_id}/test-call":{"post":{"description":"Calls `destination` from one of your numbers so you can hear the agent. Not a campaign call and not billed; free plans have a test-call allowance.","operationId":"testCallAgent","parameters":[{"in":"path","name":"agent_id","required":true,"schema":{"title":"Agent Id","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"destination":"+919812345678","phoneNumberId":"8a1d4c2e-0b7f-4e9a-9c3d-5f6e7a8b9c0d"},"schema":{"$ref":"#/components/schemas/AgentTestCallIn"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"callId":"c2b7e0d4-1f3a-4b5c-8d9e-0a1b2c3d4e5f","message":"Test call initiated","phoneNumber":"+919812345678","success":true},"schema":{"$ref":"#/components/schemas/AgentTestCallResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"agent_test_call_failed":{"$ref":"#/components/examples/agent_test_call_failed"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `agent_test_call_failed`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"agent_not_found":{"$ref":"#/components/examples/agent_not_found"},"phone_number_not_found":{"$ref":"#/components/examples/phone_number_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `agent_not_found`, `phone_number_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Place a test call","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["agent_test_call_failed","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","agent_not_found","phone_number_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/callbacks":{"get":{"description":"Callbacks your agents booked during calls and reminder calls from your rules, soonest first. Use `leadId` to see what is booked for one lead.","operationId":"listCallbacks","parameters":[{"description":"Comma-separated statuses, or `all`. Default `pending,queued,dialing` (still to happen).","in":"query","name":"status","required":false,"schema":{"example":"pending,queued","type":"string"}},{"description":"`callback` or `reminder`.","in":"query","name":"kind","required":false,"schema":{"enum":["callback","reminder"],"type":"string"}},{"description":"Only this lead's callbacks.","in":"query","name":"leadId","required":false,"schema":{"format":"uuid","type":"string"}},{"description":"Only this campaign's callbacks.","in":"query","name":"campaignId","required":false,"schema":{"format":"uuid","type":"string"}},{"description":"Only this agent's callbacks.","in":"query","name":"agentId","required":false,"schema":{"format":"uuid","type":"string"}},{"description":"`dialAt` at or after this ISO 8601 time.","in":"query","name":"dateFrom","required":false,"schema":{"type":"string"}},{"description":"`dialAt` at or before this ISO 8601 time.","in":"query","name":"dateTo","required":false,"schema":{"type":"string"}},{"description":"Page size, 1 to 200.","in":"query","name":"limit","required":false,"schema":{"default":50,"type":"integer"}},{"description":"Callbacks to skip.","in":"query","name":"offset","required":false,"schema":{"default":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledCallbackList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"workspace_required":{"$ref":"#/components/examples/workspace_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `workspace_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List scheduled callbacks","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["workspace_required","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/calls/":{"get":{"description":"Newest first. For deep lists pass `cursor` (empty for the first page, then the `nextCursor` you got back): cursor pages skip the total count and stay fast. Without `cursor` the list pages by `page` and counts matches up to 10,000.","operationId":"listCalls","parameters":[{"description":"Page number, from 1. Ignored when `cursor` is sent.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"title":"Page","type":"integer"}},{"description":"Items per page, up to 200.","in":"query","name":"limit","required":false,"schema":{"default":25,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"description":"Empty for the first page, then the previous response's `nextCursor`.","in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Cursor"}},{"description":"Matches the phone number, customer name or phone, summary, or call name.","in":"query","name":"search","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"description":"Only calls of this agent.","in":"query","name":"agentId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agentid"}},{"description":"Only calls to this lead.","in":"query","name":"leadId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Leadid"}},{"description":"Only calls of this campaign.","in":"query","name":"campaignId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaignid"}},{"description":"Only calls with this outcome.","in":"query","name":"outcome","required":false,"schema":{"description":"Outcome of the lead's or call's latest result.","enum":["qualified","interested","callback","not_interested","no_response","no_answer","busy","call_failed","voicemail",""],"type":"string"}},{"description":"Only calls with this sentiment.","in":"query","name":"sentiment","required":false,"schema":{"enum":["positive","neutral","negative"],"type":"string"}},{"description":"`instant`, `bulk`, `inbound`, or `browser` (test calls).","in":"query","name":"channel","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"}},{"description":"Only calls with (`true`) or without (`false`) a recording.","in":"query","name":"hasRecording","required":false,"schema":{"enum":["true","false"],"type":"string"}},{"description":"`today` = started since 00:00 UTC today; `week` / `month` = started in the last 7 / 30 days (rolling); `all` or omitted = no date filter.","in":"query","name":"dateFilter","required":false,"schema":{"enum":["today","week","month","all"],"type":"string"}},{"description":"Include browser test calls.","in":"query","name":"includeTests","required":false,"schema":{"default":true,"title":"Includetests","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"calls":[{"agentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","agentName":"Priya","billableMinutes":2,"billedInr":9,"callType":"manual","campaignId":"e3f4a5b6-c7d8-4e9f-a0b1-c2d3e4f5a6b7","campaignName":"Priya instant calls","channel":"instant","createdAt":"2026-11-14T10:02:09Z","duration":94,"endTime":"2026-11-14T10:03:45Z","endedReason":"customer-ended-call","extractedFields":{"delivery_slot":"morning"},"fromNumber":"+918045671234","hasRecording":true,"id":"8c1e5b7a-2d4f-4e9a-b6c3-1f0a9d8e7b65","isEscalated":false,"leadId":"b2a7c9d1-6e3f-4a8b-9c0d-1e2f3a4b5c6d","leadName":"Asha Verma","merchantOutcome":"interested","metadata":{"crmId":"0065g00000XyZ"},"outcome":"successful","outcomeCategory":"interested","phoneNumber":"+919812345678","phoneNumberId":"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d","sentiment":"positive","startTime":"2026-11-14T10:02:11Z","status":"completed","summary":"Customer confirmed Friday delivery and asked for a morning slot.","transcript":"Assistant: Hi Asha, this is Priya from Acme about order A-1042.\nUser: Yes, go ahead.","updatedAt":"2026-11-14T10:03:52Z"}],"hasMore":false,"pagination":{"currentPage":1,"hasNextPage":false,"hasPreviousPage":false,"itemsPerPage":25,"totalCapped":false,"totalItems":1,"totalPages":1},"success":true},"schema":{"$ref":"#/components/schemas/CallList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List calls","tags":["Calls"],"x-api-key-resource":"calls","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]},"post":{"description":"Calls `to` now with the agent, outside any campaign schedule. The number is saved as a lead (or matched to an existing one) and dialed through the agent's instant campaign, one call at a time per agent. Numbers on your do-not-call list are never dialed. The response means the carrier accepted the dial; follow the call with `GET /calls/{callId}` or call webhooks. Send an `Idempotency-Key` header so a retried request does not call twice.\n\nEach request dials once. A call that is not answered, is busy or times out is not redialed, and a refused dial is not queued for later: place another call if you want a second attempt. The one exception is a callback the callee asks for and the agent books during the call; that scheduled callback is placed at the agreed time.\n\nToll-fraud limits: `to` must be in your workspace's home country (from your billing address; India when none is set) unless support enabled more countries, and each workspace may place a fixed number of calls per UTC day through this endpoint (`daily_call_limit_reached` with `Retry-After` until 00:00 UTC). Calling hours (TRAI / local quiet hours) are not enforced on direct calls: checking the time of day at the callee is your responsibility. Campaigns apply their own calling windows.","operationId":"createCall","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"agentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","metadata":{"crmId":"0065g00000XyZ"},"name":"Asha Verma","to":"+919812345678","variables":{"delivery_date":"Friday","order_id":"A-1042"}},"schema":{"$ref":"#/components/schemas/CreateCallRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"call":{"campaignId":"e3f4a5b6-c7d8-4e9f-a0b1-c2d3e4f5a6b7","campaignName":"Delivery desk Instant","id":"8c1e5b7a-2d4f-4e9a-b6c3-1f0a9d8e7b65","leadId":"b2a7c9d1-6e3f-4a8b-9c0d-1e2f3a4b5c6d","leadName":"Asha Verma","phoneNumber":"+919812345678","phoneNumberId":"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","providerCallId":"CA5f1e0d9c8b7a6f5e4d3c2b1a0f9e8d7c","status":"queued"},"success":true},"schema":{"$ref":"#/components/schemas/PlacedCall"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"},"campaign_has_no_agent":{"$ref":"#/components/examples/campaign_has_no_agent"},"dial_rejected":{"$ref":"#/components/examples/dial_rejected"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`, `campaign_has_no_agent`, `dial_rejected`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"agent_not_found":{"$ref":"#/components/examples/agent_not_found"},"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"},"lead_not_found":{"$ref":"#/components/examples/lead_not_found"},"lead_not_on_campaign":{"$ref":"#/components/examples/lead_not_on_campaign"},"phone_number_not_found":{"$ref":"#/components/examples/phone_number_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `agent_not_found`, `campaign_not_found`, `lead_not_found`, `lead_not_on_campaign`, `phone_number_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"campaign_call_limit_reached":{"$ref":"#/components/examples/campaign_call_limit_reached"},"campaign_dial_busy":{"$ref":"#/components/examples/campaign_dial_busy"},"campaign_no_eligible_leads":{"$ref":"#/components/examples/campaign_no_eligible_leads"},"campaign_not_running":{"$ref":"#/components/examples/campaign_not_running"},"carrier_capacity_reached":{"$ref":"#/components/examples/carrier_capacity_reached"},"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"},"lead_call_in_progress":{"$ref":"#/components/examples/lead_call_in_progress"},"number_on_dnc":{"$ref":"#/components/examples/number_on_dnc"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `campaign_call_limit_reached`, `campaign_dial_busy`, `campaign_no_eligible_leads`, `campaign_not_running`, `carrier_capacity_reached`, `idempotency_key_reused`, `idempotency_request_in_progress`, `lead_call_in_progress`, `number_on_dnc`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"agent_state_blocked":{"$ref":"#/components/examples/agent_state_blocked"},"destination_not_allowed":{"$ref":"#/components/examples/destination_not_allowed"},"invalid_phone_number":{"$ref":"#/components/examples/invalid_phone_number"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"},"phone_number_not_dialable":{"$ref":"#/components/examples/phone_number_not_dialable"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `agent_state_blocked`, `destination_not_allowed`, `invalid_phone_number`, `parameter_invalid`, `phone_number_not_dialable`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"campaign_daily_cap_reached":{"$ref":"#/components/examples/campaign_daily_cap_reached"},"concurrent_call_limit_reached":{"$ref":"#/components/examples/concurrent_call_limit_reached"},"daily_call_limit_reached":{"$ref":"#/components/examples/daily_call_limit_reached"},"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `campaign_daily_cap_reached`, `concurrent_call_limit_reached`, `daily_call_limit_reached`, `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"502":{"content":{"application/json":{"examples":{"dial_failed":{"$ref":"#/components/examples/dial_failed"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error: `dial_failed`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"503":{"content":{"application/json":{"examples":{"service_unavailable":{"$ref":"#/components/examples/service_unavailable"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service unavailable: `service_unavailable`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Place a call","tags":["Calls"],"x-api-key-resource":"calls","x-error-codes":["bad_request","campaign_has_no_agent","dial_rejected","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","agent_not_found","campaign_not_found","lead_not_found","lead_not_on_campaign","phone_number_not_found","campaign_call_limit_reached","campaign_dial_busy","campaign_no_eligible_leads","campaign_not_running","carrier_capacity_reached","idempotency_key_reused","idempotency_request_in_progress","lead_call_in_progress","number_on_dnc","agent_state_blocked","destination_not_allowed","invalid_phone_number","parameter_invalid","phone_number_not_dialable","campaign_daily_cap_reached","concurrent_call_limit_reached","daily_call_limit_reached","rate_limit_exceeded","internal_error","dial_failed","service_unavailable"]}},"/api/v1/calls/daily-counts":{"get":{"description":"Calls per calendar day for the last `days` days (India Standard Time): total, completed, failed, not answered and average length, plus totals. Days without calls are zeros.","operationId":"getCallDailyCounts","parameters":[{"description":"Days to cover, ending today: 1 to 90. Default 30.","in":"query","name":"days","required":false,"schema":{"default":30,"title":"Days","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"daily":[{"avgDurationSeconds":80,"completed":4,"date":"2026-11-14","failed":0,"noAnswer":1,"total":5},{"avgDurationSeconds":69.6,"completed":5,"date":"2026-11-15","failed":1,"noAnswer":1,"total":7}],"days":2,"success":true,"timezone":"Asia/Kolkata","totals":{"avgDurationSeconds":74.2,"completed":9,"failed":1,"noAnswer":2,"total":12}},"schema":{"$ref":"#/components/schemas/CallDailyCounts"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Calls per day","tags":["Calls"],"x-api-key-resource":"calls","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/calls/performance":{"get":{"description":"Totals, connect rate, conversion, outcome and channel split, calls per hour and an agent leaderboard for the last 7, 30 or 90 days, with the range before it for comparison.","operationId":"getCallPerformance","parameters":[{"description":"Days to cover, ending today: 7, 30 or 90 (any other value means 30).","in":"query","name":"rangeDays","required":false,"schema":{"default":30,"enum":[7,30,90],"type":"integer"}},{"description":"Only calls of this agent.","in":"query","name":"agentId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agentid"}},{"description":"Only calls of this channel.","in":"query","name":"channel","required":false,"schema":{"enum":["instant","bulk","inbound","browser"],"type":"string"}},{"description":"Also count test calls placed from the console. Default false.","in":"query","name":"includeTests","required":false,"schema":{"default":false,"title":"Includetests","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"byChannel":{"bulk":230,"inbound":50,"instant":140},"byHour":{"10":64,"11":88,"12":71,"15":90,"16":107},"byOutcome":{"busy":22,"call_failed":40,"callback":22,"interested":41,"no_answer":160,"not_interested":95,"qualified":40},"funnel":{"calls":420,"connected":260,"qualified":81},"includeTests":false,"kpis":{"avgLengthSeconds":83.5,"calls":420,"connectRate":0.62,"conversion":0.31,"leads":388,"minutesUsed":512,"successRate":0.58},"leaderboard":[{"agentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","calls":300,"connected":190,"minutes":380,"name":"Priya","qualified":62},{"agentId":"7c2e9a10-3b4d-4e5f-8a6b-9c0d1e2f3a4b","calls":120,"connected":70,"minutes":132,"name":"Arjun","qualified":19}],"prior":{"calls":365,"connectRate":0.59,"conversion":0.27},"rangeDays":30,"recent":{"last24h":26,"lastHour":3,"today":18},"success":true},"schema":{"$ref":"#/components/schemas/CallPerformance"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Call performance","tags":["Calls"],"x-api-key-resource":"calls","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/calls/{call_id}":{"get":{"description":"Status, transcript, summary, outcome, cost and the details the agent collected.","operationId":"getCall","parameters":[{"in":"path","name":"call_id","required":true,"schema":{"title":"Call Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"call":{"agentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","agentName":"Priya","billableMinutes":2,"billedInr":9,"callType":"manual","campaignId":"e3f4a5b6-c7d8-4e9f-a0b1-c2d3e4f5a6b7","campaignName":"Priya instant calls","channel":"instant","createdAt":"2026-11-14T10:02:09Z","duration":94,"endTime":"2026-11-14T10:03:45Z","endedReason":"customer-ended-call","extractedFields":{"delivery_slot":"morning"},"fromNumber":"+918045671234","hasRecording":true,"id":"8c1e5b7a-2d4f-4e9a-b6c3-1f0a9d8e7b65","isEscalated":false,"leadId":"b2a7c9d1-6e3f-4a8b-9c0d-1e2f3a4b5c6d","leadName":"Asha Verma","merchantOutcome":"interested","metadata":{"crmId":"0065g00000XyZ"},"outcome":"successful","outcomeCategory":"interested","phoneNumber":"+919812345678","phoneNumberId":"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d","sentiment":"positive","startTime":"2026-11-14T10:02:11Z","status":"completed","summary":"Customer confirmed Friday delivery and asked for a morning slot.","transcript":"Assistant: Hi Asha, this is Priya from Acme about order A-1042.\nUser: Yes, go ahead.","updatedAt":"2026-11-14T10:03:52Z","whatsappSent":[{"createdAt":"2026-11-14T10:03:10Z","error":"","id":"0d9c8b7a-6f5e-4d3c-2b1a-0f9e8d7c6b5a","kind":"template","status":"delivered","statusAt":"2026-11-14T10:03:14Z","template":"order_confirmation"}]},"success":true},"schema":{"$ref":"#/components/schemas/CallEnvelope"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"call_not_found":{"$ref":"#/components/examples/call_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `call_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a call","tags":["Calls"],"x-api-key-resource":"calls","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","call_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/calls/{call_id}/recording":{"get":{"description":"The call's audio (MP3, or WAV for a call that is still being converted). Check `hasRecording` on the call first.","operationId":"getCallRecording","parameters":[{"in":"path","name":"call_id","required":true,"schema":{"title":"Call Id","type":"string"}}],"responses":{"200":{"content":{"audio/wav":{"schema":{"format":"binary","type":"string"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"call_not_found":{"$ref":"#/components/examples/call_not_found"},"call_recording_not_found":{"$ref":"#/components/examples/call_recording_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `call_not_found`, `call_recording_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"410":{"content":{"application/json":{"examples":{"call_recording_deleted":{"$ref":"#/components/examples/call_recording_deleted"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error: `call_recording_deleted`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Download a call recording","tags":["Calls"],"x-api-key-resource":"calls","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","call_not_found","call_recording_not_found","call_recording_deleted","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/calls/{call_id}/transcript":{"get":{"description":"The conversation as text and as ordered turns, plus the tools the agent called. Empty while nothing has been said; final once the call has ended.","operationId":"getCallTranscript","parameters":[{"in":"path","name":"call_id","required":true,"schema":{"title":"Call Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"callId":"8c1e5b7a-2d4f-4e9a-b6c3-1f0a9d8e7b65","status":"completed","success":true,"toolInvocations":[],"transcript":"Assistant: Hi, this is Asha from Acme.\nUser: Hi, yes.","turns":[{"role":"assistant","text":"Hi, this is Asha from Acme."},{"role":"user","text":"Hi, yes."}]},"schema":{"$ref":"#/components/schemas/CallTranscript"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"call_not_found":{"$ref":"#/components/examples/call_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `call_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a call transcript","tags":["Calls"],"x-api-key-resource":"calls","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","call_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/campaigns/":{"get":{"description":"Campaigns you can see, page by page. Running campaigns include `dialHealth`.","operationId":"listCampaigns","parameters":[{"description":"Page number, from 1.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"title":"Page","type":"integer"}},{"description":"Items per page, 1 to 200.","in":"query","name":"limit","required":false,"schema":{"default":25,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"description":"Only campaigns of this agent.","in":"query","name":"agentId","required":false,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"campaigns":[{"agentId":"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d","autoDialEnabled":false,"createdAt":"2026-11-15T10:00:00Z","direction":"outbound","id":"3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d","isActive":false,"name":"December renewals","phoneNumberId":"1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e","settings":{"dialWindowEnd":"18:00","dialWindowStart":"10:00","maxCallsPerDay":200,"maxConcurrentCalls":2,"pacingSeconds":5},"stats":{"calledLeads":0,"connectRate":0,"totalLeads":0},"status":"draft"}],"hasMore":false,"pagination":{"currentPage":1,"hasNextPage":false,"hasPreviousPage":false,"itemsPerPage":25,"totalCapped":false,"totalItems":1,"totalPages":1},"success":true},"schema":{"$ref":"#/components/schemas/CampaignList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List campaigns","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]},"post":{"description":"Add leads later with `PUT /campaigns/{campaign_id}/leads`. Without `phoneNumberId` the agent's assigned number is used.","operationId":"createCampaign","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"agentId":"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d","name":"December renewals","settings":{"maxCallsPerDay":200,"maxConcurrentCalls":2}},"schema":{"$ref":"#/components/schemas/CampaignInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"campaign":{"agentId":"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d","autoDialEnabled":false,"createdAt":"2026-11-15T10:00:00Z","direction":"outbound","id":"3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d","isActive":false,"name":"December renewals","phoneNumberId":"1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e","settings":{"dialWindowEnd":"18:00","dialWindowStart":"10:00","maxCallsPerDay":200,"maxConcurrentCalls":2,"pacingSeconds":5},"stats":{"calledLeads":0,"connectRate":0,"totalLeads":0},"status":"draft"},"success":true},"schema":{"$ref":"#/components/schemas/CampaignResult"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"campaign_default_inbound_exists":{"$ref":"#/components/examples/campaign_default_inbound_exists"},"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `campaign_default_inbound_exists`, `idempotency_key_reused`, `idempotency_request_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Create an empty campaign","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","resource_not_found","campaign_default_inbound_exists","idempotency_key_reused","idempotency_request_in_progress","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/campaigns/create-with-leads":{"post":{"description":"The usual way to start: one request creates the campaign and adds or creates its leads. Start it with `POST /campaigns/{campaign_id}/start`, or send `campaignData.isActive: true` to start it right away (the same checks as start apply).","operationId":"createCampaignWithLeads","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"campaignData":{"agentId":"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d","name":"December renewals","settings":{"maxCallsPerDay":200}},"leadSourceType":"bulk_upload","uploadedLeads":[{"attributes":{"city":"Pune"},"name":"Asha Rao","phone":"+919876543210"}]},"schema":{"$ref":"#/components/schemas/CampaignWithLeadsInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"campaignId":"3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d","message":"Campaign created","processedLeads":1,"success":true},"schema":{"$ref":"#/components/schemas/CampaignCreatedWithLeads"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"},"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`, `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"campaign_default_inbound_exists":{"$ref":"#/components/examples/campaign_default_inbound_exists"},"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `campaign_default_inbound_exists`, `idempotency_key_reused`, `idempotency_request_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"campaign_not_ready":{"$ref":"#/components/examples/campaign_not_ready"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `campaign_not_ready`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Create a campaign with its leads","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","campaign_not_found","resource_not_found","campaign_default_inbound_exists","idempotency_key_reused","idempotency_request_in_progress","campaign_not_ready","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/campaigns/{campaign_id}":{"delete":{"description":"Cancels its scheduled dialing. Its calls are kept and no longer point at the campaign.","operationId":"deleteCampaign","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"message":"Campaign deleted","success":true},"schema":{"$ref":"#/components/schemas/CampaignDeleted"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Delete a campaign","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","campaign_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"get":{"operationId":"getCampaign","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"campaign":{"agentId":"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d","autoDialEnabled":false,"createdAt":"2026-11-15T10:00:00Z","direction":"outbound","id":"3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d","isActive":false,"name":"December renewals","phoneNumberId":"1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e","settings":{"dialWindowEnd":"18:00","dialWindowStart":"10:00","maxCallsPerDay":200,"maxConcurrentCalls":2,"pacingSeconds":5},"stats":{"calledLeads":0,"connectRate":0,"totalLeads":0},"status":"draft"},"success":true},"schema":{"$ref":"#/components/schemas/CampaignResult"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a campaign","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","campaign_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"put":{"description":"Send only the fields to change. `settings` is merged into the current settings. Changing dialing rules on a running campaign re-plans its next dial round.","operationId":"updateCampaign","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"settings":{"dialWindowEnd":"19:00","pacingSeconds":10}},"schema":{"$ref":"#/components/schemas/CampaignInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"campaign":{"agentId":"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d","autoDialEnabled":false,"createdAt":"2026-11-15T10:00:00Z","direction":"outbound","id":"3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d","isActive":false,"name":"December renewals","phoneNumberId":"1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e","settings":{"dialWindowEnd":"18:00","dialWindowStart":"10:00","maxCallsPerDay":200,"maxConcurrentCalls":2,"pacingSeconds":5},"stats":{"calledLeads":0,"connectRate":0,"totalLeads":0},"status":"draft"},"success":true},"schema":{"$ref":"#/components/schemas/CampaignResult"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"},"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`, `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"campaign_default_inbound_exists":{"$ref":"#/components/examples/campaign_default_inbound_exists"},"campaign_not_running":{"$ref":"#/components/examples/campaign_not_running"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `campaign_default_inbound_exists`, `campaign_not_running`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"campaign_not_ready":{"$ref":"#/components/examples/campaign_not_ready"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `campaign_not_ready`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Update a campaign","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","campaign_not_found","resource_not_found","campaign_default_inbound_exists","campaign_not_running","campaign_not_ready","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/campaigns/{campaign_id}/dial-status":{"get":{"description":"Whether the campaign is placing calls right now and, if not, why and when it will.","operationId":"getCampaignDialStatus","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"activeCallCount":0,"activeCalls":[],"autoDialEnabled":true,"callsToday":48,"dialState":"waiting","dialTimezone":"Asia/Kolkata","dialWindowEnd":"18:00","dialWindowStart":"10:00","dialingAllowed":false,"inDialWindow":false,"isActive":true,"maxCallsPerDay":200,"nextWindowOpenAt":"2026-11-16T04:30:00Z","skipReason":"outside_window","success":true},"schema":{"$ref":"#/components/schemas/CampaignDialStatus"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Dialing status","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","campaign_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/campaigns/{campaign_id}/leads":{"get":{"description":"Active leads of the campaign, newest first, with their per-campaign dialing state. Send `page` to get one page of `limit` leads; without `page` every matching lead is returned in one response, so always send it for large campaigns.","operationId":"listCampaignLeads","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"Page number, from 1. Omit to get every matching lead.","in":"query","name":"page","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"}},{"description":"Leads per page when `page` is sent, 1 to 200.","in":"query","name":"limit","required":false,"schema":{"default":50,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"description":"Matches part of the lead's name, phone, email or your ID for the lead.","in":"query","name":"search","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"description":"Dialing state in this campaign, for example `not_called`, `calling`, `completed`, `failed`, `no_answer` or `busy`.","in":"query","name":"memberStatus","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memberstatus"}},{"description":"Sentiment of the lead's last call in this campaign, for example `positive`, `neutral` or `negative`.","in":"query","name":"sentiment","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"}},{"description":"Filter on lead fields, as a JSON object (URL-encoded).","in":"query","name":"rules","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rules"}},{"description":"Outcome of the lead's latest call, for example `interested` or `callback`.","in":"query","name":"merchantOutcome","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchantoutcome"}}],"responses":{"200":{"content":{"application/json":{"example":{"hasMore":false,"leads":[{"callSummary":"","id":"5a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c4d","lastCallId":"","lastSentiment":"positive","name":"Asha Rao","phone":"+919876543210"}],"pagination":{"currentPage":1,"hasNextPage":false,"hasPreviousPage":false,"itemsPerPage":50,"totalItems":1},"success":true},"schema":{"$ref":"#/components/schemas/CampaignLeadList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List a campaign's leads","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","campaign_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"put":{"description":"New leads are dialed automatically if the campaign is running. Removed leads keep their call history. A lead already on the campaign, or a number already on it, is skipped.","operationId":"updateCampaignLeads","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"added":["5a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c4d"],"removed":[]},"schema":{"$ref":"#/components/schemas/CampaignLeadsChange"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"added":1,"campaign":{"id":"3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d"},"dialScheduled":true,"message":"Updated","reactivated":0,"removed":0,"success":true},"schema":{"$ref":"#/components/schemas/CampaignLeadsUpdated"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"},"lead_not_found":{"$ref":"#/components/examples/lead_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`, `lead_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"campaign_leads_need_confirmation":{"$ref":"#/components/examples/campaign_leads_need_confirmation"},"lead_call_in_progress":{"$ref":"#/components/examples/lead_call_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `campaign_leads_need_confirmation`, `lead_call_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Add or remove leads","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","campaign_not_found","lead_not_found","campaign_leads_need_confirmation","lead_call_in_progress","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/campaigns/{campaign_id}/pause-dialing":{"post":{"description":"The campaign stays active; resume to continue where it left off. Calls in progress finish.","operationId":"pauseCampaignDialing","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"cancelledJobs":1,"message":"Auto-dialing paused","success":true},"schema":{"$ref":"#/components/schemas/CampaignDialingChanged"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Pause automatic dialing","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","campaign_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/campaigns/{campaign_id}/resume-dialing":{"post":{"description":"Only for a running campaign whose dialing was paused; a stopped campaign needs `POST /campaigns/{campaign_id}/start`.","operationId":"resumeCampaignDialing","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"message":"Auto-dialing resumed","success":true},"schema":{"$ref":"#/components/schemas/CampaignDialingChanged"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"campaign_not_running":{"$ref":"#/components/examples/campaign_not_running"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `campaign_not_running`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Resume automatic dialing","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","campaign_not_found","campaign_not_running","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/campaigns/{campaign_id}/start":{"post":{"description":"Starts dialing. Calls are placed only inside the dial window and up to the daily limit. The campaign must have an agent whose prompt the leads can fill and a number that can place calls; otherwise nothing changes and the error says what to fix.","operationId":"startCampaign","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"leadCount":120,"message":"Campaign started — dialing will proceed automatically on schedule","processedCount":120,"success":true,"warnings":[]},"schema":{"$ref":"#/components/schemas/CampaignStarted"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"campaign_not_ready":{"$ref":"#/components/examples/campaign_not_ready"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `campaign_not_ready`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Start a campaign","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","campaign_not_found","campaign_not_ready","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/campaigns/{campaign_id}/stop":{"post":{"description":"Stops the campaign and cancels calls waiting to be placed. A call in progress finishes. Stopping a stopped campaign is allowed and changes nothing.","operationId":"stopCampaign","parameters":[{"description":"Campaign ID.","in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"campaign":{"id":"3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d","isActive":false},"cancelledJobs":1,"message":"Campaign stopped","success":true},"schema":{"$ref":"#/components/schemas/CampaignStopped"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Stop a campaign","tags":["Campaigns"],"x-api-key-resource":"campaigns","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","campaign_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/instant/call-now":{"post":{"description":"Places the call immediately, outside the dial schedule, with the campaign's agent and numbers. Numbers on do-not-call are never dialed. To call any number without a campaign, use `POST /calls`.","operationId":"callNow","parameters":[],"requestBody":{"content":{"application/json":{"example":{"campaignId":"e3f4a5b6-c7d8-4e9f-a0b1-c2d3e4f5a6b7","leadId":"b2a7c9d1-6e3f-4a8b-9c0d-1e2f3a4b5c6d"},"schema":{"$ref":"#/components/schemas/CallNowIn"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"call":{"campaignId":"e3f4a5b6-c7d8-4e9f-a0b1-c2d3e4f5a6b7","campaignName":"November renewals","id":"8c1e5b7a-2d4f-4e9a-b6c3-1f0a9d8e7b65","leadId":"b2a7c9d1-6e3f-4a8b-9c0d-1e2f3a4b5c6d","leadName":"Asha Verma","phoneNumber":"+919812345678","phoneNumberId":"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d","providerCallId":"a1b2c3d4-e5f6-7a8b-9c0d-e1f2a3b4c5d6","status":"initiated"},"success":true},"schema":{"$ref":"#/components/schemas/PlacedCall"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"},"campaign_has_no_agent":{"$ref":"#/components/examples/campaign_has_no_agent"},"dial_rejected":{"$ref":"#/components/examples/dial_rejected"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`, `campaign_has_no_agent`, `dial_rejected`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"},"lead_not_found":{"$ref":"#/components/examples/lead_not_found"},"lead_not_on_campaign":{"$ref":"#/components/examples/lead_not_on_campaign"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`, `lead_not_found`, `lead_not_on_campaign`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"campaign_call_limit_reached":{"$ref":"#/components/examples/campaign_call_limit_reached"},"campaign_dial_busy":{"$ref":"#/components/examples/campaign_dial_busy"},"campaign_no_eligible_leads":{"$ref":"#/components/examples/campaign_no_eligible_leads"},"campaign_not_running":{"$ref":"#/components/examples/campaign_not_running"},"carrier_capacity_reached":{"$ref":"#/components/examples/carrier_capacity_reached"},"lead_call_in_progress":{"$ref":"#/components/examples/lead_call_in_progress"},"number_on_dnc":{"$ref":"#/components/examples/number_on_dnc"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `campaign_call_limit_reached`, `campaign_dial_busy`, `campaign_no_eligible_leads`, `campaign_not_running`, `carrier_capacity_reached`, `lead_call_in_progress`, `number_on_dnc`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"campaign_daily_cap_reached":{"$ref":"#/components/examples/campaign_daily_cap_reached"},"concurrent_call_limit_reached":{"$ref":"#/components/examples/concurrent_call_limit_reached"},"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `campaign_daily_cap_reached`, `concurrent_call_limit_reached`, `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"502":{"content":{"application/json":{"examples":{"dial_failed":{"$ref":"#/components/examples/dial_failed"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error: `dial_failed`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Call a lead in a campaign now","tags":["Calls"],"x-api-key-resource":"campaigns","x-error-codes":["bad_request","campaign_has_no_agent","dial_rejected","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","campaign_not_found","lead_not_found","lead_not_on_campaign","campaign_call_limit_reached","campaign_dial_busy","campaign_no_eligible_leads","campaign_not_running","carrier_capacity_reached","lead_call_in_progress","number_on_dnc","parameter_invalid","campaign_daily_cap_reached","concurrent_call_limit_reached","rate_limit_exceeded","internal_error","dial_failed"]}},"/api/v1/lead-fields/catalog":{"get":{"description":"Every custom field defined in the workspace. Send values for these keys in a lead's `attributes` object on createLead and updateLead; pushLead takes them as top-level fields. `valueType` says how they are stored and compared in audience rules.","operationId":"listLeadFields","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"fields":[{"id":"6f1c2a9e-3b7d-4e21-9c55-0d8a7b3e4f10","key":"city","label":"City","valueType":"text"}]},"schema":{"$ref":"#/components/schemas/LeadFieldDefinitionList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List custom lead fields","tags":["Leads"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]}},"/api/v1/leads/":{"get":{"description":"Newest first by default. Page with `page` and `limit`, or for deep lists pass `cursor` (empty first, then `nextCursor`): cursor pages skip the count and stay fast. Without `cursor` matches are counted up to 10,000 unless `includeTotal=true`.","operationId":"listLeads","parameters":[{"description":"Page number, from 1. Ignored when `cursor` is sent.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"title":"Page","type":"integer"}},{"description":"Items per page, up to 200.","in":"query","name":"limit","required":false,"schema":{"default":25,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"description":"Matches part of the name, phone, email, company, title or external id.","in":"query","name":"search","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"description":"Only leads with this pipeline status key (your workspace's statuses).","in":"query","name":"status","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"description":"Only leads from this lead source.","in":"query","name":"leadSourceId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Leadsourceid"}},{"description":"Only leads in this campaign.","in":"query","name":"campaignId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaignid"}},{"description":"Created since 00:00 UTC today (`today`), or since 00:00 UTC 7 days ago (`week`) or 30 days ago (`month`). `all` (or no value) applies no date filter.","in":"query","name":"dateFilter","required":false,"schema":{"enum":["today","week","month","all"],"type":"string"}},{"in":"query","name":"sortBy","required":false,"schema":{"default":"createdAt","enum":["createdAt","name","status","lastContact","company","callStatus"],"type":"string"}},{"in":"query","name":"sortOrder","required":false,"schema":{"default":"desc","enum":["asc","desc"],"type":"string"}},{"description":"Add `stats` (total, byStatus, recentlyAdded, notCalled) for the filter.","in":"query","name":"includeStats","required":false,"schema":{"default":false,"title":"Includestats","type":"boolean"}},{"description":"Count every match exactly. By default the count stops at 10,000 (`pagination.totalCapped` says when there are more).","in":"query","name":"includeTotal","required":false,"schema":{"default":false,"title":"Includetotal","type":"boolean"}},{"description":"Empty for the first page, then the previous response's `nextCursor`. Only with the default sort (newest first); skips the count.","in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Cursor"}},{"description":"`me`, `unassigned`, or a team member's user ID.","in":"query","name":"assignedTo","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignedto"}},{"description":"Only leads with this tag.","in":"query","name":"tag","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}}],"responses":{"200":{"content":{"application/json":{"example":{"hasMore":false,"leads":[{"attributes":{"city":"Pune"},"callAttempts":0,"callStatus":"not_called","campaignIds":[],"campaignNames":[],"company":"Rao Traders","createdAt":"2026-11-15T10:00:00+00:00","dncOptOut":false,"email":"asha@example.com","id":"6f1c2a9e-3b7d-4c55-9a0e-1d2f3a4b5c6d","name":"Asha Rao","phone":"+919876543210","source":"website","status":"new","tags":[],"title":"Owner","updatedAt":"2026-11-15T10:00:00+00:00"}],"pagination":{"currentPage":1,"hasNextPage":false,"hasPreviousPage":false,"itemsPerPage":25,"totalCapped":false,"totalItems":1,"totalPages":1},"success":true},"schema":{"$ref":"#/components/schemas/LeadList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List leads","tags":["Leads"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]},"post":{"description":"Creates one lead and optionally adds it to campaigns. The phone is stored in E.164 form (a 10-digit number gets `+91`, as in a CSV upload); a number that cannot be read is refused with `invalid_phone_number`. The number is not checked for duplicates. Values that could not be saved as sent (an unknown status, a mistyped field) come back in `warnings`.","operationId":"createLead","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"attributes":{"city":"Pune"},"company":"Rao Traders","email":"asha@example.com","name":"Asha Rao","phone":"9876543210"},"schema":{"$ref":"#/components/schemas/LeadCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"lead":{"attributes":{"city":"Pune"},"callAttempts":0,"callStatus":"not_called","campaignIds":[],"campaignNames":[],"company":"Rao Traders","createdAt":"2026-11-15T10:00:00+00:00","dncOptOut":false,"email":"asha@example.com","id":"6f1c2a9e-3b7d-4c55-9a0e-1d2f3a4b5c6d","name":"Asha Rao","phone":"+919876543210","source":"website","status":"new","tags":[],"title":"Owner","updatedAt":"2026-11-15T10:00:00+00:00"},"success":true,"warnings":[]},"schema":{"$ref":"#/components/schemas/LeadResult"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"invalid_phone_number":{"$ref":"#/components/examples/invalid_phone_number"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `invalid_phone_number`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Create a lead","tags":["Leads"],"x-api-key-resource":"leads","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","campaign_not_found","idempotency_key_reused","idempotency_request_in_progress","invalid_phone_number","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/leads/bulk":{"post":{"description":"Change status, assignee, tags or do-not-call for up to 500 leads, or delete them. IDs outside your workspace are skipped, not reported. `updated` counts the leads that changed.","operationId":"bulkLeadAction","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"action":"tag","ids":["6f1c2a9e-3b7d-4c55-9a0e-1d2f3a4b5c6d"],"value":"vip"},"schema":{"$ref":"#/components/schemas/LeadBulkAction"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"success":true,"updated":1},"schema":{"$ref":"#/components/schemas/LeadBulkResult"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Act on many leads","tags":["Leads"],"x-api-key-resource":"leads","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","idempotency_key_reused","idempotency_request_in_progress","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/leads/dnc":{"get":{"description":"The 500 most recently changed leads marked do-not-call, newest first. The list stops at 500 entries; `hasMore` is true when older entries were left out. The dialer never calls these numbers.","operationId":"listDoNotCall","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"entries":[{"createdAt":"2026-11-01T09:30:00Z","dncOptOut":true,"dncReason":"Asked not to be called","dncUpdatedAt":"2026-11-15T10:00:00Z","id":"5d2f8a1e-3b4c-4d6e-9f0a-1b2c3d4e5f60","name":"Asha Rao","phone":"+919876543210","status":"new"}],"hasMore":false,"success":true,"total":1},"schema":{"$ref":"#/components/schemas/DoNotCallList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List do-not-call numbers","tags":["Do-not-call"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]},"post":{"description":"Marks existing leads with these numbers as do-not-call and creates entries for new numbers. Numbers that are not Indian mobiles are skipped; if none is valid the request fails with `dnc_no_valid_numbers`.","operationId":"addDoNotCall","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"phones":"9876543210\n+919812345678","reason":"Asked not to be called"},"schema":{"$ref":"#/components/schemas/DncAdd"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"added":1,"entries":[{"createdAt":"2026-11-01T09:30:00Z","dncOptOut":true,"dncReason":"Asked not to be called","dncUpdatedAt":"2026-11-15T10:00:00Z","id":"5d2f8a1e-3b4c-4d6e-9f0a-1b2c3d4e5f60","name":"Asha Rao","phone":"+919876543210","status":"new"},{"createdAt":"2026-11-01T09:30:00Z","dncOptOut":true,"dncReason":"Asked not to be called","dncUpdatedAt":"2026-11-15T10:00:00Z","id":"6e3a9b2f-4c5d-4e7f-8a1b-2c3d4e5f6a71","name":"","phone":"+919812345678","status":"new"}],"success":true,"updated":1},"schema":{"$ref":"#/components/schemas/DoNotCallAdded"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"dnc_no_valid_numbers":{"$ref":"#/components/examples/dnc_no_valid_numbers"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `dnc_no_valid_numbers`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Add numbers to do-not-call","tags":["Do-not-call"],"x-api-key-resource":"leads","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","idempotency_key_reused","idempotency_request_in_progress","dnc_no_valid_numbers","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/leads/dnc/{lead_id}":{"delete":{"description":"Clears the do-not-call flag on the lead so campaigns may call it again.","operationId":"removeDoNotCall","parameters":[{"description":"ID of the lead (entry) to clear.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"lead":{"createdAt":"2026-11-01T09:30:00Z","dncOptOut":false,"dncUpdatedAt":"2026-11-15T10:00:00Z","id":"5d2f8a1e-3b4c-4d6e-9f0a-1b2c3d4e5f60","name":"Asha Rao","phone":"+919876543210","status":"new"},"success":true},"schema":{"$ref":"#/components/schemas/LeadResult"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Remove a number from do-not-call","tags":["Do-not-call"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/leads/{lead_id}":{"delete":{"description":"Permanently deletes the lead. Past calls stay in call history.","operationId":"deleteLead","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"message":"Lead deleted","success":true},"schema":{"$ref":"#/components/schemas/LeadDeleted"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Delete a lead","tags":["Leads"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"get":{"description":"One lead with its campaigns, owner and the text of its latest notes.","operationId":"getLead","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"lead":{"attributes":{"city":"Pune"},"callAttempts":0,"callStatus":"not_called","campaignIds":[],"campaignNames":[],"company":"Rao Traders","createdAt":"2026-11-15T10:00:00+00:00","dncOptOut":false,"email":"asha@example.com","id":"6f1c2a9e-3b7d-4c55-9a0e-1d2f3a4b5c6d","name":"Asha Rao","phone":"+919876543210","source":"website","status":"new","tags":[],"title":"Owner","updatedAt":"2026-11-15T10:00:00+00:00"},"success":true},"schema":{"$ref":"#/components/schemas/LeadResult"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a lead","tags":["Leads"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"put":{"description":"Changes only the fields you send. Send `If-Match` with the lead's `updatedAt` to refuse the write (`lead_changed`) when someone changed the lead after you read it. A new `phone` is stored in E.164 form like on create. Campaign IDs you cannot access are skipped.","operationId":"updateLead","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}},{"in":"header","name":"If-Match","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"content":{"application/json":{"example":{"attributes":{"city":"Mumbai"},"status":"qualified","tags":["vip"]},"schema":{"$ref":"#/components/schemas/LeadUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadResult"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"lead_changed":{"$ref":"#/components/examples/lead_changed"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `lead_changed`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"invalid_phone_number":{"$ref":"#/components/examples/invalid_phone_number"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `invalid_phone_number`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Update a lead","tags":["Leads"],"x-api-key-resource":"leads","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","lead_changed","invalid_phone_number","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/leads/{lead_id}/call-now":{"post":{"description":"Calls the lead right away through the first running campaign it belongs to, using that campaign's agent and caller ID. The lead's do-not-call flag, the campaign's daily cap and your concurrent call limit still apply; each refusal has its own error code.","operationId":"callLeadNow","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"call":{"campaignId":"3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d","campaignName":"December renewals","id":"c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f","leadId":"5d2f8a1e-3b4c-4d6e-9f0a-1b2c3d4e5f60","leadName":"Asha Rao","phoneNumber":"+919876543210","phoneNumberId":"1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e","status":"initiated"},"success":true},"schema":{"$ref":"#/components/schemas/PlacedCall"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"},"campaign_has_no_agent":{"$ref":"#/components/examples/campaign_has_no_agent"},"dial_rejected":{"$ref":"#/components/examples/dial_rejected"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`, `campaign_has_no_agent`, `dial_rejected`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"402":{"content":{"application/json":{"examples":{"payment_required":{"$ref":"#/components/examples/payment_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Payment required: `payment_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"campaign_not_found":{"$ref":"#/components/examples/campaign_not_found"},"lead_not_found":{"$ref":"#/components/examples/lead_not_found"},"lead_not_on_campaign":{"$ref":"#/components/examples/lead_not_on_campaign"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `campaign_not_found`, `lead_not_found`, `lead_not_on_campaign`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"campaign_call_limit_reached":{"$ref":"#/components/examples/campaign_call_limit_reached"},"campaign_dial_busy":{"$ref":"#/components/examples/campaign_dial_busy"},"campaign_no_eligible_leads":{"$ref":"#/components/examples/campaign_no_eligible_leads"},"campaign_not_running":{"$ref":"#/components/examples/campaign_not_running"},"carrier_capacity_reached":{"$ref":"#/components/examples/carrier_capacity_reached"},"lead_call_in_progress":{"$ref":"#/components/examples/lead_call_in_progress"},"number_on_dnc":{"$ref":"#/components/examples/number_on_dnc"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `campaign_call_limit_reached`, `campaign_dial_busy`, `campaign_no_eligible_leads`, `campaign_not_running`, `carrier_capacity_reached`, `lead_call_in_progress`, `number_on_dnc`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"lead_has_no_campaign":{"$ref":"#/components/examples/lead_has_no_campaign"},"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `lead_has_no_campaign`, `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"campaign_daily_cap_reached":{"$ref":"#/components/examples/campaign_daily_cap_reached"},"concurrent_call_limit_reached":{"$ref":"#/components/examples/concurrent_call_limit_reached"},"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `campaign_daily_cap_reached`, `concurrent_call_limit_reached`, `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"502":{"content":{"application/json":{"examples":{"dial_failed":{"$ref":"#/components/examples/dial_failed"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error: `dial_failed`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Call a lead now","tags":["Calls"],"x-api-key-resource":"leads","x-error-codes":["bad_request","campaign_has_no_agent","dial_rejected","api_key_expired","invalid_api_key","unauthenticated","payment_required","api_key_scope_denied","permission_denied","campaign_not_found","lead_not_found","lead_not_on_campaign","campaign_call_limit_reached","campaign_dial_busy","campaign_no_eligible_leads","campaign_not_running","carrier_capacity_reached","lead_call_in_progress","number_on_dnc","lead_has_no_campaign","parameter_invalid","campaign_daily_cap_reached","concurrent_call_limit_reached","rate_limit_exceeded","internal_error","dial_failed"]}},"/api/v1/leads/{lead_id}/notes":{"get":{"description":"The first page carries the lead's summary note (`brief`) and pinned notes; `items` are the other notes, newest first. Follow `nextCursor` for older notes. Replaces the deprecated `notes` text field.","operationId":"listLeadNotes","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}},{"description":"`all`, `mine` (notes you wrote), `ai` (AI-written) or `imported`.","in":"query","name":"view","required":false,"schema":{"default":"all","enum":["all","mine","ai","imported"],"type":"string"}},{"description":"`nextCursor` from the previous page.","in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"description":"Items per page, 1 to 50 (default 30).","in":"query","name":"limit","required":false,"schema":{"default":30,"maximum":50,"minimum":1,"title":"Limit","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"hasMore":false,"items":[{"authorKind":"api","body":"Asked for a call back after 6pm.","createdAt":"2026-05-04T10:15:00Z","id":"8a1f3c2e-5b7d-4e0a-9c61-2d4b8e7f0a13","kind":"note","leadId":"3f2c9d6e-1a4b-4c8d-9e0f-7a6b5c4d3e21","pinned":false,"updatedAt":"2026-05-04T10:15:00Z","version":1}],"notesCount":2,"pinned":[{"authorKind":"api","body":"Asked for a call back after 6pm.","createdAt":"2026-05-04T10:15:00Z","id":"8a1f3c2e-5b7d-4e0a-9c61-2d4b8e7f0a13","kind":"note","leadId":"3f2c9d6e-1a4b-4c8d-9e0f-7a6b5c4d3e21","pinned":true,"pinnedAt":"2026-05-04T11:05:00Z","updatedAt":"2026-05-04T10:15:00Z","version":2}]},"schema":{"$ref":"#/components/schemas/LeadNoteList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List a lead's notes","tags":["Lead notes"],"x-api-key-resource":"leads","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"post":{"description":"A note added with an API key is authored `api` and is kept like a note a person wrote.","operationId":"createLeadNote","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}},{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"body":"Asked for a call back after 6pm.","kind":"note"},"schema":{"$ref":"#/components/schemas/LeadNoteCreate"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"note":{"authorKind":"api","body":"Asked for a call back after 6pm.","createdAt":"2026-05-04T10:15:00Z","id":"8a1f3c2e-5b7d-4e0a-9c61-2d4b8e7f0a13","kind":"note","leadId":"3f2c9d6e-1a4b-4c8d-9e0f-7a6b5c4d3e21","pinned":false,"updatedAt":"2026-05-04T10:15:00Z","version":1},"notesCount":4,"success":true},"schema":{"$ref":"#/components/schemas/LeadNoteResult"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Add a note","tags":["Lead notes"],"x-api-key-resource":"leads","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","idempotency_key_reused","idempotency_request_in_progress","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/leads/{lead_id}/notes/{note_id}":{"delete":{"description":"Only the author or a workspace manager can delete a person's note.","operationId":"deleteLeadNote","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}},{"description":"Note ID, from `GET /leads/{leadId}/notes`.","in":"path","name":"note_id","required":true,"schema":{"title":"Note Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"notesCount":3,"success":true},"schema":{"$ref":"#/components/schemas/LeadNoteDeleted"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"},"lead_note_not_found":{"$ref":"#/components/examples/lead_note_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`, `lead_note_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Delete a note","tags":["Lead notes"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","lead_note_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"patch":{"description":"Send the `version` you read. If someone changed the note since, you get 409 `lead_note_changed` with the current note in `detail.note`. Only the author or a workspace manager can edit a person's note.","operationId":"updateLeadNote","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}},{"description":"Note ID, from `GET /leads/{leadId}/notes`.","in":"path","name":"note_id","required":true,"schema":{"title":"Note Id","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"body":"Call back after 6pm on weekdays.","version":1},"schema":{"$ref":"#/components/schemas/LeadNoteEdit"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"note":{"authorKind":"api","body":"Call back after 6pm on weekdays.","createdAt":"2026-05-04T10:15:00Z","editedAt":"2026-05-04T11:00:00Z","id":"8a1f3c2e-5b7d-4e0a-9c61-2d4b8e7f0a13","kind":"note","leadId":"3f2c9d6e-1a4b-4c8d-9e0f-7a6b5c4d3e21","pinned":false,"updatedAt":"2026-05-04T11:00:00Z","version":2},"success":true},"schema":{"$ref":"#/components/schemas/LeadNoteResult"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"},"lead_note_not_found":{"$ref":"#/components/examples/lead_note_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`, `lead_note_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"lead_note_changed":{"$ref":"#/components/examples/lead_note_changed"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `lead_note_changed`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Edit a note","tags":["Lead notes"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","lead_note_not_found","lead_note_changed","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/leads/{lead_id}/notes/{note_id}/pin":{"delete":{"operationId":"unpinLeadNote","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}},{"description":"Note ID, from `GET /leads/{leadId}/notes`.","in":"path","name":"note_id","required":true,"schema":{"title":"Note Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"note":{"authorKind":"api","body":"Asked for a call back after 6pm.","createdAt":"2026-05-04T10:15:00Z","id":"8a1f3c2e-5b7d-4e0a-9c61-2d4b8e7f0a13","kind":"note","leadId":"3f2c9d6e-1a4b-4c8d-9e0f-7a6b5c4d3e21","pinned":false,"updatedAt":"2026-05-04T10:15:00Z","version":3},"success":true},"schema":{"$ref":"#/components/schemas/LeadNoteResult"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"},"lead_note_not_found":{"$ref":"#/components/examples/lead_note_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`, `lead_note_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Unpin a note","tags":["Lead notes"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","lead_note_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"post":{"description":"At most three notes per lead can be pinned; a fourth returns 409 `lead_note_pin_limit`.","operationId":"pinLeadNote","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}},{"description":"Note ID, from `GET /leads/{leadId}/notes`.","in":"path","name":"note_id","required":true,"schema":{"title":"Note Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"note":{"authorKind":"api","body":"Asked for a call back after 6pm.","createdAt":"2026-05-04T10:15:00Z","id":"8a1f3c2e-5b7d-4e0a-9c61-2d4b8e7f0a13","kind":"note","leadId":"3f2c9d6e-1a4b-4c8d-9e0f-7a6b5c4d3e21","pinned":true,"pinnedAt":"2026-05-04T11:05:00Z","updatedAt":"2026-05-04T10:15:00Z","version":2},"success":true},"schema":{"$ref":"#/components/schemas/LeadNoteResult"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"},"lead_note_not_found":{"$ref":"#/components/examples/lead_note_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`, `lead_note_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"lead_note_pin_limit":{"$ref":"#/components/examples/lead_note_pin_limit"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `lead_note_pin_limit`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Pin a note","tags":["Lead notes"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","lead_note_not_found","lead_note_pin_limit","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/leads/{lead_id}/timeline":{"get":{"description":"Calls, WhatsApp messages and orders, tickets, notes, lead changes and callbacks for one lead, newest first. Page with `cursor`; the first page also lists open callbacks.","operationId":"getLeadTimeline","parameters":[{"description":"Lead ID.","in":"path","name":"lead_id","required":true,"schema":{"title":"Lead Id","type":"string"}},{"description":"`nextCursor` from the previous page.","in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"description":"Items per page, 1 to 100 (default 30).","in":"query","name":"limit","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}},{"description":"Comma list of `call`, `whatsapp`, `ticket`, `note`, `change`, `callback`.","in":"query","name":"types","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma list of call,whatsapp,ticket,note,change,callback","title":"Types"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadTimeline"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"lead_not_found":{"$ref":"#/components/examples/lead_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `lead_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Lead timeline","tags":["Leads"],"x-api-key-resource":"leads","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","lead_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/phone-numbers/":{"get":{"description":"Every number in your workspace with its carrier, call capacity and the agent using it. Credentials are never returned, only whether each one is saved.","operationId":"listPhoneNumbers","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"phoneNumbers":[{"assignedAgentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","assignedAgentName":"Priya - Sales","e164":"+918065522999","id":"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","inboundAgentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","label":"Main line","lastSyncedAt":"2026-01-15T09:30:00+00:00","maxConcurrentCalls":50,"metadata":{},"name":"Main line","number":"+918065522999","plivoAuthTokenSet":true,"provider":"plivo","providerResourceId":"MAXXXXXXXXXXXXXXXXXX","sipDomain":"","sipOutboundProxy":"","sipPasswordSet":false,"sipUsername":"","twilioAccountSid":"","twilioAuthTokenSet":false,"vobizAuthTokenSet":false}],"success":true},"schema":{"$ref":"#/components/schemas/PhoneNumberList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List phone numbers","tags":["Phone numbers"],"x-api-key-resource":"numbers","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]}},"/api/v1/phone-numbers/{phone_id}":{"get":{"description":"One number with its carrier, call capacity and the agent using it.","operationId":"getPhoneNumber","parameters":[{"description":"The number's `id` from `GET /phone-numbers`.","in":"path","name":"phone_id","required":true,"schema":{"title":"Phone Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"phoneNumber":{"assignedAgentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","assignedAgentName":"Priya - Sales","e164":"+918065522999","id":"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d","inboundAgentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","label":"Main line","lastSyncedAt":"2026-01-15T09:30:00+00:00","maxConcurrentCalls":50,"metadata":{},"name":"Main line","number":"+918065522999","plivoAuthTokenSet":true,"provider":"plivo","providerResourceId":"MAXXXXXXXXXXXXXXXXXX","sipDomain":"","sipOutboundProxy":"","sipPasswordSet":false,"sipUsername":"","twilioAccountSid":"","twilioAuthTokenSet":false,"vobizAuthTokenSet":false},"success":true},"schema":{"$ref":"#/components/schemas/PhoneNumberEnvelope"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"phone_number_not_found":{"$ref":"#/components/examples/phone_number_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `phone_number_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a phone number","tags":["Phone numbers"],"x-api-key-resource":"numbers","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","phone_number_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/sip-trunks":{"get":{"description":"Your own SIP providers connected to the calling gateway, the numbers on each, and the gateway address to give your provider. Passwords are never returned.","operationId":"listSipTrunks","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"gateway":{"allowIp":"sip.callmitra.example","enabled":true,"host":"sip.callmitra.example","inboundUri":"sip:<number>@sip.callmitra.example:5060","port":5060},"success":true,"trunks":[{"authMode":"digest","authRealm":"","codecs":["ulaw","alaw"],"dtmfMode":"rfc4733","fromDomain":"","fromUser":"","hasPassword":true,"host":"sip.provider.example","id":"5b0c2d4e-8f1a-4b3c-9d2e-7f6a5b4c3d21","inboundIps":["203.0.113.10"],"isActive":true,"lastError":"","maxConcurrentCalls":10,"name":"Acme SIP","numberFormat":"e164","numbers":[{"e164":"+918045671234","id":"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d","inboundAgentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","label":"Support line"}],"outboundProxy":"","port":5060,"register":true,"status":"active","syncedAt":"2026-11-12T09:30:00Z","techPrefix":"","transport":"udp","username":"acme01"}]},"schema":{"$ref":"#/components/schemas/SipTrunkList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"workspace_required":{"$ref":"#/components/examples/workspace_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `workspace_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List SIP trunks","tags":["Phone numbers"],"x-api-key-resource":"numbers","x-error-codes":["workspace_required","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]}},"/api/v1/sip-trunks/{trunk_id}":{"get":{"description":"One SIP trunk with its settings, sync status and numbers. The password is never returned.","operationId":"getSipTrunk","parameters":[{"description":"The trunk's `id` from `GET /sip-trunks`.","in":"path","name":"trunk_id","required":true,"schema":{"title":"Trunk Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"trunk":{"authMode":"digest","authRealm":"","codecs":["ulaw","alaw"],"dtmfMode":"rfc4733","fromDomain":"","fromUser":"","hasPassword":true,"host":"sip.provider.example","id":"5b0c2d4e-8f1a-4b3c-9d2e-7f6a5b4c3d21","inboundIps":["203.0.113.10"],"isActive":true,"lastError":"","maxConcurrentCalls":10,"name":"Acme SIP","numberFormat":"e164","numbers":[{"e164":"+918045671234","id":"9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d","inboundAgentId":"4f6d2c1a-9b7e-4c3d-8a21-5e0f7b9c1d23","label":"Support line"}],"outboundProxy":"","port":5060,"register":true,"status":"active","syncedAt":"2026-11-12T09:30:00Z","techPrefix":"","transport":"udp","username":"acme01"}},"schema":{"$ref":"#/components/schemas/SipTrunkEnvelope"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"workspace_required":{"$ref":"#/components/examples/workspace_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `workspace_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"sip_trunk_not_found":{"$ref":"#/components/examples/sip_trunk_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `sip_trunk_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a SIP trunk","tags":["Phone numbers"],"x-api-key-resource":"numbers","x-error-codes":["workspace_required","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","sip_trunk_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/tickets/":{"get":{"description":"Newest change first by default. Filter by status, type, priority, lead, category, team or tag.","operationId":"listTickets","parameters":[{"description":"Page number, from 1.","in":"query","name":"page","required":false,"schema":{"default":1,"maximum":100000,"minimum":1,"title":"Page","type":"integer"}},{"description":"Tickets per page (1-200).","in":"query","name":"limit","required":false,"schema":{"default":25,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"description":"Ticket ref, words in the subject or description, or the lead's name or phone.","in":"query","name":"search","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"description":"`open`, `in_progress`, `waiting_on_customer`, `resolved` or `closed`; `open` also matches `in_progress` and `waiting_on_customer`.","in":"query","name":"status","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"description":"`support` or `sales_followup`.","in":"query","name":"type","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"description":"Only this lead's tickets.","in":"query","name":"leadId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Leadid"}},{"description":"Only tickets opened from this call.","in":"query","name":"sourceCallId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourcecallid"}},{"description":"Only tickets nobody is assigned to.","in":"query","name":"unassigned","required":false,"schema":{"default":false,"title":"Unassigned","type":"boolean"}},{"description":"`low`, `normal`, `high` or `urgent`.","in":"query","name":"priority","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"}},{"description":"Only tickets with this tag.","in":"query","name":"tag","required":false,"schema":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"title":"Tag"}},{"description":"Category id, or `none` for tickets without one.","in":"query","name":"categoryId","required":false,"schema":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"title":"Categoryid"}},{"description":"Team id, or `none` for tickets without one.","in":"query","name":"teamId","required":false,"schema":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"title":"Teamid"}},{"description":"`updated` (default), `created`, `due`, `priority` or `status`.","in":"query","name":"sort","required":false,"schema":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"title":"Sort"}},{"description":"`asc` or `desc`.","in":"query","name":"dir","required":false,"schema":{"anyOf":[{"maxLength":4,"type":"string"},{"type":"null"}],"title":"Dir"}}],"responses":{"200":{"content":{"application/json":{"example":{"pagination":{"currentPage":1,"hasNextPage":false,"hasPreviousPage":false,"itemsPerPage":25,"totalCapped":false,"totalItems":1,"totalPages":1},"sort":{"dir":"desc","key":"updated"},"success":true,"tickets":[{"activityCount":1,"assignedToUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","assigneeEmail":"priya@example.com","assigneeName":"Priya Nair","assigneeNames":["Priya Nair"],"assignees":[{"assignedAt":"2026-01-15T09:30:02+00:00","email":"priya@example.com","name":"Priya Nair","userId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f"}],"categoryId":"3b9f1d7e-6c2a-4e85-a0d4-7f1e2c3b4a56","categoryName":"Delivery","createdAt":"2026-01-15T09:30:00+00:00","createdByUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","description":"Customer says the parcel was marked delivered but never arrived.","dueAt":"2026-01-16T09:30:00+00:00","id":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90","leadId":"a41e7c2d-8f35-4b09-b6d2-93c0e5f1a7b8","leadName":"Asha Verma","leadPhone":"+919812345678","merchantId":"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a","overdue":false,"priority":"normal","ref":"T-5F0C9A3E","sla":{"firstResponse":{"dueAt":"2026-01-15T13:30:00+00:00","state":"ok","warnAt":"2026-01-15T12:30:00+00:00"},"paused":false,"resolution":{"dueAt":"2026-01-16T09:30:00+00:00","state":"ok","warnAt":"2026-01-16T05:30:00+00:00"}},"source":"manual","status":"open","subject":"Order #1042 not delivered","tags":["order-1042"],"teamId":"e7a1c3d5-9b2f-4d68-8a0c-2e4f6a8b0c1d","teamName":"Customer care","type":"support","updatedAt":"2026-01-15T09:30:00+00:00","version":1}]},"schema":{"$ref":"#/components/schemas/TicketList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List tickets","tags":["Tickets"],"x-api-key-resource":"tickets","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]},"post":{"description":"Opens a ticket for `leadId` (or the lead behind `waConversationId`). Category and source decide its team; the team's rules may assign it automatically.","operationId":"createTicket","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"categoryId":"3b9f1d7e-6c2a-4e85-a0d4-7f1e2c3b4a56","description":"Customer says the parcel was marked delivered but never arrived.","leadId":"a41e7c2d-8f35-4b09-b6d2-93c0e5f1a7b8","subject":"Order #1042 not delivered","tags":["order-1042"]},"schema":{"$ref":"#/components/schemas/TicketCreateBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"success":true,"ticket":{"activities":[{"activityType":"created","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T09:30:00+00:00","id":"0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d","payload":{"category":"Delivery","priority":"normal","subject":"Order #1042 not delivered","team":"Customer care","type":"support"},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"}],"activityCount":1,"assignedToUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","assigneeEmail":"priya@example.com","assigneeName":"Priya Nair","assigneeNames":["Priya Nair"],"assignees":[{"assignedAt":"2026-01-15T09:30:02+00:00","email":"priya@example.com","name":"Priya Nair","userId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f"}],"canEdit":true,"canManageAssignees":true,"canReopenClosed":false,"categoryId":"3b9f1d7e-6c2a-4e85-a0d4-7f1e2c3b4a56","categoryName":"Delivery","createdAt":"2026-01-15T09:30:00+00:00","createdByUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","description":"Customer says the parcel was marked delivered but never arrived.","dueAt":"2026-01-16T09:30:00+00:00","hasOlderActivities":false,"id":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90","leadId":"a41e7c2d-8f35-4b09-b6d2-93c0e5f1a7b8","leadName":"Asha Verma","leadPhone":"+919812345678","merchantId":"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a","overdue":false,"priority":"normal","ref":"T-5F0C9A3E","sla":{"firstResponse":{"dueAt":"2026-01-15T13:30:00+00:00","state":"ok","warnAt":"2026-01-15T12:30:00+00:00"},"paused":false,"resolution":{"dueAt":"2026-01-16T09:30:00+00:00","state":"ok","warnAt":"2026-01-16T05:30:00+00:00"}},"source":"manual","status":"open","subject":"Order #1042 not delivered","tags":["order-1042"],"teamId":"e7a1c3d5-9b2f-4d68-8a0c-2e4f6a8b0c1d","teamName":"Customer care","type":"support","updatedAt":"2026-01-15T09:30:00+00:00","version":1}},"schema":{"$ref":"#/components/schemas/TicketResponse"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Create a ticket","tags":["Tickets"],"x-api-key-resource":"tickets","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","resource_not_found","idempotency_key_reused","idempotency_request_in_progress","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/tickets/categories":{"get":{"description":"Categories to file tickets under (`categoryId`), in display order.","operationId":"listTicketCategories","parameters":[{"description":"Include categories that are switched off (default true).","in":"query","name":"includeInactive","required":false,"schema":{"default":true,"title":"Includeinactive","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"categories":[{"defaultPriority":"normal","defaultTeamId":"e7a1c3d5-9b2f-4d68-8a0c-2e4f6a8b0c1d","id":"3b9f1d7e-6c2a-4e85-a0d4-7f1e2c3b4a56","isActive":true,"name":"Delivery","sortOrder":0},{"defaultPriority":"high","id":"8b9c0d1e-2f3a-4b4c-9d5e-6f7a8b9c0d1e","isActive":true,"name":"Refunds","sortOrder":1}],"success":true},"schema":{"$ref":"#/components/schemas/TicketCategoryList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List ticket categories","tags":["Tickets"],"x-api-key-resource":"tickets","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/tickets/teams":{"get":{"description":"Teams tickets are routed to (`teamId`), sorted by name.","operationId":"listTicketTeams","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"teams":[{"assignmentMode":"round_robin","id":"e7a1c3d5-9b2f-4d68-8a0c-2e4f6a8b0c1d","isDefault":true,"members":[{"available":true,"email":"priya@example.com","isLead":true,"name":"Priya Nair","userId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f"}],"name":"Customer care"}]},"schema":{"$ref":"#/components/schemas/TicketTeamList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List ticket teams","tags":["Tickets"],"x-api-key-resource":"tickets","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]}},"/api/v1/tickets/{ticket_id}":{"get":{"description":"The ticket with its latest activities (notes, replies and changes).","operationId":"getTicket","parameters":[{"description":"Ticket id.","in":"path","name":"ticket_id","required":true,"schema":{"title":"Ticket Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"ticket":{"activities":[{"activityType":"priority_change","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T10:05:00+00:00","id":"2c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f","payload":{"from":"normal","to":"high"},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"},{"activityType":"status_change","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T10:05:00+00:00","id":"1b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e","payload":{"from":"open","source":"console","to":"in_progress"},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"},{"activityType":"status_change","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T11:20:00+00:00","id":"5f6a7b8c-9d0e-4f1a-9b2c-4d5e6f7a8b9d","payload":{"from":"in_progress","source":"console","to":"waiting_on_customer"},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"},{"activityType":"comment","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T11:20:00+00:00","id":"3d4e5f6a-7b8c-4d9e-9f0a-2b3c4d5e6f7a","payload":{"note":"Courier confirmed the parcel is at the local hub; asked them to redeliver tomorrow."},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"}],"activitiesCursor":"2026-01-15T10:05:00+00:00|2c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f","activityCount":5,"assignedToUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","assigneeEmail":"priya@example.com","assigneeName":"Priya Nair","assigneeNames":["Priya Nair"],"assignees":[{"assignedAt":"2026-01-15T09:30:02+00:00","email":"priya@example.com","name":"Priya Nair","userId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f"}],"canEdit":true,"canManageAssignees":true,"canReopenClosed":false,"categoryId":"3b9f1d7e-6c2a-4e85-a0d4-7f1e2c3b4a56","categoryName":"Delivery","createdAt":"2026-01-15T09:30:00+00:00","createdByUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","description":"Customer says the parcel was marked delivered but never arrived.","dueAt":"2026-01-16T09:30:00+00:00","hasOlderActivities":true,"id":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90","leadId":"a41e7c2d-8f35-4b09-b6d2-93c0e5f1a7b8","leadName":"Asha Verma","leadPhone":"+919812345678","merchantId":"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a","overdue":false,"priority":"high","ref":"T-5F0C9A3E","sla":{"firstResponse":{"dueAt":"2026-01-15T13:30:00+00:00","state":"ok","warnAt":"2026-01-15T12:30:00+00:00"},"paused":false,"resolution":{"dueAt":"2026-01-16T09:30:00+00:00","state":"ok","warnAt":"2026-01-16T05:30:00+00:00"}},"source":"manual","status":"waiting_on_customer","subject":"Order #1042 not delivered","tags":["order-1042"],"teamId":"e7a1c3d5-9b2f-4d68-8a0c-2e4f6a8b0c1d","teamName":"Customer care","type":"support","updatedAt":"2026-01-15T11:20:00+00:00","version":3}},"schema":{"$ref":"#/components/schemas/TicketResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a ticket","tags":["Tickets"],"x-api-key-resource":"tickets","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","resource_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"patch":{"description":"Changes only the fields you send. Send `version` to make sure you do not overwrite someone's change.","operationId":"updateTicket","parameters":[{"description":"Ticket id.","in":"path","name":"ticket_id","required":true,"schema":{"title":"Ticket Id","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"priority":"high","status":"in_progress","version":1},"schema":{"$ref":"#/components/schemas/TicketUpdateBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"activities":[{"activityType":"priority_change","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T10:05:00+00:00","id":"2c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f","payload":{"from":"normal","to":"high"},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"},{"activityType":"status_change","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T10:05:00+00:00","id":"1b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e","payload":{"from":"open","source":"console","to":"in_progress"},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"}],"changed":["priority","status"],"success":true,"ticket":{"activityCount":3,"assignedToUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","assigneeEmail":"priya@example.com","assigneeName":"Priya Nair","assigneeNames":["Priya Nair"],"assignees":[{"assignedAt":"2026-01-15T09:30:02+00:00","email":"priya@example.com","name":"Priya Nair","userId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f"}],"canEdit":true,"canManageAssignees":true,"canReopenClosed":false,"categoryId":"3b9f1d7e-6c2a-4e85-a0d4-7f1e2c3b4a56","categoryName":"Delivery","createdAt":"2026-01-15T09:30:00+00:00","createdByUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","description":"Customer says the parcel was marked delivered but never arrived.","dueAt":"2026-01-16T09:30:00+00:00","id":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90","leadId":"a41e7c2d-8f35-4b09-b6d2-93c0e5f1a7b8","leadName":"Asha Verma","leadPhone":"+919812345678","merchantId":"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a","overdue":false,"priority":"high","ref":"T-5F0C9A3E","sla":{"firstResponse":{"dueAt":"2026-01-15T13:30:00+00:00","state":"ok","warnAt":"2026-01-15T12:30:00+00:00"},"paused":false,"resolution":{"dueAt":"2026-01-16T09:30:00+00:00","state":"ok","warnAt":"2026-01-16T05:30:00+00:00"}},"source":"manual","status":"in_progress","subject":"Order #1042 not delivered","tags":["order-1042"],"teamId":"e7a1c3d5-9b2f-4d68-8a0c-2e4f6a8b0c1d","teamName":"Customer care","type":"support","updatedAt":"2026-01-15T10:05:00+00:00","version":2}},"schema":{"$ref":"#/components/schemas/TicketMutation"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"},"ticket_edit_forbidden":{"$ref":"#/components/examples/ticket_edit_forbidden"},"ticket_reopen_forbidden":{"$ref":"#/components/examples/ticket_reopen_forbidden"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`, `ticket_edit_forbidden`, `ticket_reopen_forbidden`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"ticket_merged":{"$ref":"#/components/examples/ticket_merged"},"ticket_version_conflict":{"$ref":"#/components/examples/ticket_version_conflict"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `ticket_merged`, `ticket_version_conflict`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Update a ticket","tags":["Tickets"],"x-api-key-resource":"tickets","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","ticket_edit_forbidden","ticket_reopen_forbidden","resource_not_found","ticket_merged","ticket_version_conflict","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/tickets/{ticket_id}/activities":{"get":{"description":"Older activities of a ticket, page by page: pass the previous page's `activitiesCursor` as `before`.","operationId":"listTicketActivities","parameters":[{"description":"Ticket id.","in":"path","name":"ticket_id","required":true,"schema":{"title":"Ticket Id","type":"string"}},{"description":"`activitiesCursor` from the ticket or the previous page.","in":"query","name":"before","required":false,"schema":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"title":"Before"}},{"description":"Activities per page.","in":"query","name":"limit","required":false,"schema":{"default":50,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"activities":[{"activityType":"created","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T09:30:00+00:00","id":"0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d","payload":{"category":"Delivery","priority":"normal","subject":"Order #1042 not delivered","team":"Customer care","type":"support"},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"}],"hasOlderActivities":false,"success":true},"schema":{"$ref":"#/components/schemas/TicketActivityPage"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List ticket activities","tags":["Tickets"],"x-api-key-resource":"tickets","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","resource_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"post":{"description":"A note your team sees on the ticket; the customer does not. Optionally moves the ticket's status.","operationId":"addTicketNote","parameters":[{"description":"Ticket id.","in":"path","name":"ticket_id","required":true,"schema":{"title":"Ticket Id","type":"string"}},{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"note":"Courier confirmed the parcel is at the local hub; asked them to redeliver tomorrow.","status":"waiting_on_customer","version":2},"schema":{"$ref":"#/components/schemas/TicketActivityBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"activities":[{"activityType":"status_change","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T11:20:00+00:00","id":"5f6a7b8c-9d0e-4f1a-9b2c-4d5e6f7a8b9d","payload":{"from":"in_progress","source":"console","to":"waiting_on_customer"},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"},{"activityType":"comment","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T11:20:00+00:00","id":"3d4e5f6a-7b8c-4d9e-9f0a-2b3c4d5e6f7a","payload":{"note":"Courier confirmed the parcel is at the local hub; asked them to redeliver tomorrow."},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"}],"changed":["status","activities"],"success":true,"ticket":{"activityCount":5,"assignedToUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","assigneeEmail":"priya@example.com","assigneeName":"Priya Nair","assigneeNames":["Priya Nair"],"assignees":[{"assignedAt":"2026-01-15T09:30:02+00:00","email":"priya@example.com","name":"Priya Nair","userId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f"}],"canEdit":true,"canManageAssignees":true,"canReopenClosed":false,"categoryId":"3b9f1d7e-6c2a-4e85-a0d4-7f1e2c3b4a56","categoryName":"Delivery","createdAt":"2026-01-15T09:30:00+00:00","createdByUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","description":"Customer says the parcel was marked delivered but never arrived.","dueAt":"2026-01-16T09:30:00+00:00","id":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90","leadId":"a41e7c2d-8f35-4b09-b6d2-93c0e5f1a7b8","leadName":"Asha Verma","leadPhone":"+919812345678","merchantId":"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a","overdue":false,"priority":"high","ref":"T-5F0C9A3E","sla":{"firstResponse":{"dueAt":"2026-01-15T13:30:00+00:00","state":"ok","warnAt":"2026-01-15T12:30:00+00:00"},"paused":false,"resolution":{"dueAt":"2026-01-16T09:30:00+00:00","state":"ok","warnAt":"2026-01-16T05:30:00+00:00"}},"source":"manual","status":"waiting_on_customer","subject":"Order #1042 not delivered","tags":["order-1042"],"teamId":"e7a1c3d5-9b2f-4d68-8a0c-2e4f6a8b0c1d","teamName":"Customer care","type":"support","updatedAt":"2026-01-15T11:20:00+00:00","version":3}},"schema":{"$ref":"#/components/schemas/TicketMutation"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"},"ticket_edit_forbidden":{"$ref":"#/components/examples/ticket_edit_forbidden"},"ticket_reopen_forbidden":{"$ref":"#/components/examples/ticket_reopen_forbidden"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`, `ticket_edit_forbidden`, `ticket_reopen_forbidden`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"},"ticket_attachment_unavailable":{"$ref":"#/components/examples/ticket_attachment_unavailable"},"ticket_merged":{"$ref":"#/components/examples/ticket_merged"},"ticket_version_conflict":{"$ref":"#/components/examples/ticket_version_conflict"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`, `ticket_attachment_unavailable`, `ticket_merged`, `ticket_version_conflict`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Add a note to a ticket","tags":["Tickets"],"x-api-key-resource":"tickets","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","ticket_edit_forbidden","ticket_reopen_forbidden","resource_not_found","idempotency_key_reused","idempotency_request_in_progress","ticket_attachment_unavailable","ticket_merged","ticket_version_conflict","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/tickets/{ticket_id}/replies":{"post":{"description":"Sends a reply to the ticket's customer on WhatsApp. Within 24 hours of the customer's last message send `text`; after that send `templateEvent` to use the approved template set up for that ticket event. The reply is queued and recorded on the ticket. Retrying with the same `clientId` returns the first reply (with `replayed: true`) instead of sending again.","operationId":"replyToTicket","parameters":[{"description":"Ticket id.","in":"path","name":"ticket_id","required":true,"schema":{"title":"Ticket Id","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"clientId":"crm-reply-88213","text":"Hi Asha, your parcel is at our local hub and will be redelivered tomorrow before 6 pm.","version":3},"schema":{"$ref":"#/components/schemas/TicketReplyBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"activities":[{"activityType":"reply","actorName":"Priya Nair","actorUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","createdAt":"2026-01-15T11:25:00+00:00","id":"4e5f6a7b-8c9d-4e0f-8a1b-3c4d5e6f7a8b","payload":{"clientId":"crm-reply-88213","jobIds":["7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d"],"mode":"text","note":"Hi Asha, your parcel is at our local hub and will be redelivered tomorrow before 6 pm.","phoneId":"6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c"},"ticketId":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90"}],"changed":["activities"],"success":true,"ticket":{"activityCount":6,"assignedToUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","assigneeEmail":"priya@example.com","assigneeName":"Priya Nair","assigneeNames":["Priya Nair"],"assignees":[{"assignedAt":"2026-01-15T09:30:02+00:00","email":"priya@example.com","name":"Priya Nair","userId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f"}],"canEdit":true,"canManageAssignees":true,"canReopenClosed":false,"categoryId":"3b9f1d7e-6c2a-4e85-a0d4-7f1e2c3b4a56","categoryName":"Delivery","createdAt":"2026-01-15T09:30:00+00:00","createdByUserId":"c2d4e6f8-1a3b-4c5d-8e7f-9a0b1c2d3e4f","description":"Customer says the parcel was marked delivered but never arrived.","dueAt":"2026-01-16T09:30:00+00:00","firstResponseAt":"2026-01-15T11:25:00+00:00","id":"5f0c9a3e-2b7d-4c61-9e84-1d6a7b3c2f90","leadId":"a41e7c2d-8f35-4b09-b6d2-93c0e5f1a7b8","leadName":"Asha Verma","leadPhone":"+919812345678","merchantId":"9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a","overdue":false,"priority":"high","ref":"T-5F0C9A3E","sla":{"firstResponse":{"dueAt":"2026-01-15T13:30:00+00:00","state":"ok","warnAt":"2026-01-15T12:30:00+00:00"},"paused":false,"resolution":{"dueAt":"2026-01-16T09:30:00+00:00","state":"ok","warnAt":"2026-01-16T05:30:00+00:00"}},"source":"manual","status":"waiting_on_customer","subject":"Order #1042 not delivered","tags":["order-1042"],"teamId":"e7a1c3d5-9b2f-4d68-8a0c-2e4f6a8b0c1d","teamName":"Customer care","type":"support","updatedAt":"2026-01-15T11:25:00+00:00","version":4}},"schema":{"$ref":"#/components/schemas/TicketMutation"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"},"ticket_edit_forbidden":{"$ref":"#/components/examples/ticket_edit_forbidden"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`, `ticket_edit_forbidden`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"ticket_attachment_unavailable":{"$ref":"#/components/examples/ticket_attachment_unavailable"},"ticket_merged":{"$ref":"#/components/examples/ticket_merged"},"ticket_reply_blocked":{"$ref":"#/components/examples/ticket_reply_blocked"},"ticket_version_conflict":{"$ref":"#/components/examples/ticket_version_conflict"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `ticket_attachment_unavailable`, `ticket_merged`, `ticket_reply_blocked`, `ticket_version_conflict`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Reply to the customer","tags":["Tickets"],"x-api-key-resource":"tickets","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","ticket_edit_forbidden","resource_not_found","ticket_attachment_unavailable","ticket_merged","ticket_reply_blocked","ticket_version_conflict","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/tools/":{"get":{"description":"Actions your agents can take on a call (HTTP requests, functions, tools from connected MCP servers), newest first. Credentials are never returned.","operationId":"listTools","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"tools":[{"authSecretSet":true,"description":"Book a site visit once the caller picks a date.","id":"5b6c7d8e-9f01-4a2b-8c3d-4e5f60718293","isActive":true,"kind":"api_request","method":"POST","name":"book_site_visit","url":"https://example.com/api/visits"}]},"schema":{"$ref":"#/components/schemas/ToolListResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List tools","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]}},"/api/v1/tools/{tool_id}":{"get":{"description":"One tool by id. Credentials are never returned (`authSecretSet` says whether one is stored).","operationId":"getTool","parameters":[{"in":"path","name":"tool_id","required":true,"schema":{"title":"Tool Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"tool":{"authSecretSet":true,"description":"Book a site visit once the caller picks a date.","id":"5b6c7d8e-9f01-4a2b-8c3d-4e5f60718293","isActive":true,"kind":"api_request","method":"POST","name":"book_site_visit","url":"https://example.com/api/visits"}},"schema":{"$ref":"#/components/schemas/ToolResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"tool_not_found":{"$ref":"#/components/examples/tool_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `tool_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a tool","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","tool_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/usage":{"get":{"description":"Calls, talk time, billed minutes and wallet charges for a period, plus the current plan period and wallet balance. Defaults to the current billing period (or the last 30 days). `balance` is null when billing is not enabled on the deployment.","operationId":"getUsage","parameters":[{"description":"Start of the period: ISO 8601 date or date-time (UTC if no offset).","in":"query","name":"from","required":false,"schema":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"title":"From"}},{"description":"End of the period (exclusive); a bare date includes that whole day. Default now.","in":"query","name":"to","required":false,"schema":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"content":{"application/json":{"example":{"balance":{"balanceInrPaise":150000,"minutesAtCurrentRate":250,"ratePerMinuteInrPaise":600},"billingEnabled":true,"calls":{"billedMinutes":402,"completed":288,"durationSeconds":21950,"total":412,"walletChargedInrPaise":0},"period":{"basis":"billing_period","end":"2026-11-15T12:00:00Z","start":"2026-11-01T00:00:00Z"},"plan":{"minutesIncluded":2000,"minutesRemaining":1598,"minutesUsed":402,"name":"Growth","overageAmountInrPaise":0,"overageMinutes":0,"periodEnd":"2026-12-01T00:00:00+00:00","periodStart":"2026-11-01T00:00:00+00:00","slug":"growth"},"success":true},"schema":{"$ref":"#/components/schemas/WorkspaceUsage"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get usage and balance","tags":["Workspace"],"x-api-key-resource":"any","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/voices/":{"get":{"description":"Voices you can put on an agent, with the providers and languages they belong to. Set `config.tts` to a voice's `provider` and `config.voice` to its `voiceId`. Filters narrow `voices` only; `providers` and `languages` always list the full catalog.","operationId":"listVoices","parameters":[{"description":"Only voices from this provider, for example `sarvam`.","in":"query","name":"provider","required":false,"schema":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Provider"}},{"description":"Only voices that speak this language code, for example `hi-IN`.","in":"query","name":"language","required":false,"schema":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}],"title":"Language"}}],"responses":{"200":{"content":{"application/json":{"example":{"languages":[{"id":"hi-IN","name":"Hindi"}],"providers":[{"count":12,"id":"sarvam","name":"Sarvam","previewSupported":true}],"success":true,"voices":[{"gender":"female","languageCodes":["hi-IN","en-IN"],"name":"Anushka","previewSupported":true,"provider":"sarvam","providerName":"Sarvam","sortOrder":1,"voiceId":"anushka"}]},"schema":{"$ref":"#/components/schemas/VoiceCatalogResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List voices","tags":["Agents"],"x-api-key-resource":"agents","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/webhook-deliveries/":{"get":{"description":"Newest first. Deliveries are kept for 30 days.","operationId":"listWebhookDeliveries","parameters":[{"description":"Only deliveries to this endpoint.","in":"query","name":"endpointId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpointid"}},{"description":"Only this event type, for example `call.completed`.","in":"query","name":"eventType","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eventtype"}},{"description":"`pending`, `processing`, `delivered` or `failed`.","in":"query","name":"status","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"description":"`nextCursor` from the previous page.","in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"description":"Deliveries per page (1-100).","in":"query","name":"limit","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"hasMore":true,"nextCursor":"MjAyNi0xMS0xNVQxMDo0MTo0Ny4xMDYwMDArMDA6MDB8YjJlN2QxYzQ","success":true,"webhookDeliveries":[{"attempts":1,"createdAt":"2026-11-15T10:41:47.106000+00:00","deliveredAt":"2026-11-15T10:42:07.512000+00:00","endpointId":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","eventId":"evt_6f1c9e2ab4d84f0e9c3a7b51d2e8f604","eventType":"call.completed","id":"b2e7d1c4-9f3a-4e58-8c06-1a7d5e2f9b43","lastAttemptAt":"2026-11-15T10:42:07.512000+00:00","lastError":"","lastStatusCode":200,"latencyMs":184,"responseSnippet":"ok","status":"delivered"}]},"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"webhook_endpoint_not_found":{"$ref":"#/components/examples/webhook_endpoint_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `webhook_endpoint_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List webhook deliveries","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","webhook_endpoint_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/webhook-deliveries/{delivery_id}":{"get":{"description":"Includes the exact event `payload` that was signed and sent.","operationId":"getWebhookDelivery","parameters":[{"description":"Webhook delivery id.","in":"path","name":"delivery_id","required":true,"schema":{"title":"Delivery Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"webhookDelivery":{"attempts":1,"createdAt":"2026-11-15T10:41:47.106000+00:00","deliveredAt":"2026-11-15T10:42:07.512000+00:00","endpointId":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","eventId":"evt_6f1c9e2ab4d84f0e9c3a7b51d2e8f604","eventType":"call.completed","id":"b2e7d1c4-9f3a-4e58-8c06-1a7d5e2f9b43","lastAttemptAt":"2026-11-15T10:42:07.512000+00:00","lastError":"","lastStatusCode":200,"latencyMs":184,"payload":{"apiVersion":"v1","createdAt":"2026-11-15T10:41:47.106000Z","data":{"agentId":"3a8f6d2c-1b7e-4c95-a0d4-5e9b2f7c1a68","callId":"9c1e5b7a-2d4f-4a86-b3e0-7f6a1c8d2e95","campaignId":"7d2b9f4e-5a1c-4e83-b6f0-3c8e2a9d1f57","direction":"outbound","duration":143,"endedReason":"customer-ended-call","leadId":"1f6e3a9c-8b2d-4d75-a4c1-9e7b5f2a3d86","outcome":"interested","phone":"+919876543210","sentiment":"positive","status":"completed","summary":"Customer agreed to a demo on Friday at 4 pm."},"id":"evt_6f1c9e2ab4d84f0e9c3a7b51d2e8f604","type":"call.completed"},"responseSnippet":"ok","status":"delivered"}},"schema":{"$ref":"#/components/schemas/WebhookDeliveryResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"webhook_delivery_not_found":{"$ref":"#/components/examples/webhook_delivery_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `webhook_delivery_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a webhook delivery","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","webhook_delivery_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/webhook-deliveries/{delivery_id}/redeliver":{"post":{"description":"Queues the same event (same `id` and `webhook-id`) to the same endpoint again, due now. Returns the new delivery. Tests and redeliveries share a cap of 10 per endpoint per minute (429 with `Retry-After`).","operationId":"redeliverWebhook","parameters":[{"description":"Webhook delivery id.","in":"path","name":"delivery_id","required":true,"schema":{"title":"Delivery Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"webhookDelivery":{"attempts":0,"createdAt":"2026-11-15T11:02:00+00:00","endpointId":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","eventId":"evt_6f1c9e2ab4d84f0e9c3a7b51d2e8f604","eventType":"call.completed","id":"e5a8c3f2-6d1b-4b97-9e40-2c7f8a1d6b35","lastError":"","nextAttemptAt":"2026-11-15T11:02:00+00:00","payload":{"apiVersion":"v1","createdAt":"2026-11-15T10:41:47.106000Z","data":{"agentId":"3a8f6d2c-1b7e-4c95-a0d4-5e9b2f7c1a68","callId":"9c1e5b7a-2d4f-4a86-b3e0-7f6a1c8d2e95","campaignId":"7d2b9f4e-5a1c-4e83-b6f0-3c8e2a9d1f57","direction":"outbound","duration":143,"endedReason":"customer-ended-call","leadId":"1f6e3a9c-8b2d-4d75-a4c1-9e7b5f2a3d86","outcome":"interested","phone":"+919876543210","sentiment":"positive","status":"completed","summary":"Customer agreed to a demo on Friday at 4 pm."},"id":"evt_6f1c9e2ab4d84f0e9c3a7b51d2e8f604","type":"call.completed"},"responseSnippet":"","status":"pending"}},"schema":{"$ref":"#/components/schemas/WebhookDeliveryResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"webhook_delivery_not_found":{"$ref":"#/components/examples/webhook_delivery_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `webhook_delivery_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"webhook_endpoint_disabled":{"$ref":"#/components/examples/webhook_endpoint_disabled"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `webhook_endpoint_disabled`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Redeliver an event","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","webhook_delivery_not_found","webhook_endpoint_disabled","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/webhook-endpoints/":{"get":{"operationId":"listWebhookEndpoints","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"hasMore":false,"success":true,"webhookEndpoints":[{"consecutiveFailures":0,"createdAt":"2026-11-01T08:15:00+00:00","description":"CRM sync","enabled":true,"events":["call.completed","call.escalated","lead.created"],"id":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","lastStatus":"HTTP 200","lastSuccessAt":"2026-11-15T10:42:07.512000+00:00","updatedAt":"2026-11-15T10:42:07.512000+00:00","url":"https://example.com/hooks/call-mitra"}]},"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List webhook endpoints","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]},"post":{"description":"Registers a URL that receives the event types in `events` (empty means all). The response carries the signing `secret` (`whsec_...`) once; store it to verify deliveries.","operationId":"createWebhookEndpoint","parameters":[{"description":"Any unique string up to 255 characters. A concurrent duplicate gets `409 idempotency_request_in_progress`. The success body holds a secret, so it is never stored: retrying a completed request with the same key returns `409 idempotency_key_reused` instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"description":"CRM sync","events":["call.completed","call.escalated","lead.created"],"url":"https://example.com/hooks/call-mitra"},"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"secret":"whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw","success":true,"webhookEndpoint":{"consecutiveFailures":0,"createdAt":"2026-11-01T08:15:00+00:00","description":"CRM sync","enabled":true,"events":["call.completed","call.escalated","lead.created"],"id":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","lastStatus":"HTTP 200","lastSuccessAt":"2026-11-15T10:42:07.512000+00:00","updatedAt":"2026-11-15T10:42:07.512000+00:00","url":"https://example.com/hooks/call-mitra"}},"schema":{"$ref":"#/components/schemas/WebhookEndpointSecretResponse"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"},"webhook_event_type_unknown":{"$ref":"#/components/examples/webhook_event_type_unknown"},"webhook_https_required":{"$ref":"#/components/examples/webhook_https_required"},"webhook_url_invalid":{"$ref":"#/components/examples/webhook_url_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`, `webhook_event_type_unknown`, `webhook_https_required`, `webhook_url_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"},"webhook_workspace_required":{"$ref":"#/components/examples/webhook_workspace_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`, `webhook_workspace_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"},"webhook_endpoint_limit_reached":{"$ref":"#/components/examples/webhook_endpoint_limit_reached"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`, `webhook_endpoint_limit_reached`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Create a webhook endpoint","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["bad_request","webhook_event_type_unknown","webhook_https_required","webhook_url_invalid","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","webhook_workspace_required","idempotency_key_reused","idempotency_request_in_progress","webhook_endpoint_limit_reached","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/webhook-endpoints/{endpoint_id}":{"delete":{"description":"Stops deliveries at once and deletes the endpoint's delivery history.","operationId":"deleteWebhookEndpoint","parameters":[{"description":"Webhook endpoint id.","in":"path","name":"endpoint_id","required":true,"schema":{"title":"Endpoint Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"deleted":true,"id":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","success":true},"schema":{"$ref":"#/components/schemas/WebhookEndpointDeleted"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"webhook_endpoint_not_found":{"$ref":"#/components/examples/webhook_endpoint_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `webhook_endpoint_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Delete a webhook endpoint","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","webhook_endpoint_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"get":{"operationId":"getWebhookEndpoint","parameters":[{"description":"Webhook endpoint id.","in":"path","name":"endpoint_id","required":true,"schema":{"title":"Endpoint Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"webhookEndpoint":{"consecutiveFailures":0,"createdAt":"2026-11-01T08:15:00+00:00","description":"CRM sync","enabled":true,"events":["call.completed","call.escalated","lead.created"],"id":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","lastStatus":"HTTP 200","lastSuccessAt":"2026-11-15T10:42:07.512000+00:00","updatedAt":"2026-11-15T10:42:07.512000+00:00","url":"https://example.com/hooks/call-mitra"}},"schema":{"$ref":"#/components/schemas/WebhookEndpointResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"webhook_endpoint_not_found":{"$ref":"#/components/examples/webhook_endpoint_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `webhook_endpoint_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a webhook endpoint","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","webhook_endpoint_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]},"patch":{"description":"Changes only the fields you send. Re-enabling a disabled endpoint clears its failure count.","operationId":"updateWebhookEndpoint","parameters":[{"description":"Webhook endpoint id.","in":"path","name":"endpoint_id","required":true,"schema":{"title":"Endpoint Id","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"enabled":true,"events":[]},"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"success":true,"webhookEndpoint":{"consecutiveFailures":0,"createdAt":"2026-11-01T08:15:00+00:00","description":"CRM sync","enabled":true,"events":[],"id":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","lastStatus":"HTTP 200","lastSuccessAt":"2026-11-15T10:42:07.512000+00:00","updatedAt":"2026-11-15T10:42:07.512000+00:00","url":"https://example.com/hooks/call-mitra"}},"schema":{"$ref":"#/components/schemas/WebhookEndpointResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"webhook_event_type_unknown":{"$ref":"#/components/examples/webhook_event_type_unknown"},"webhook_https_required":{"$ref":"#/components/examples/webhook_https_required"},"webhook_url_invalid":{"$ref":"#/components/examples/webhook_url_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `webhook_event_type_unknown`, `webhook_https_required`, `webhook_url_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"webhook_endpoint_not_found":{"$ref":"#/components/examples/webhook_endpoint_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `webhook_endpoint_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Update a webhook endpoint","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["webhook_event_type_unknown","webhook_https_required","webhook_url_invalid","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","webhook_endpoint_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/webhook-endpoints/{endpoint_id}/rotate-secret":{"post":{"description":"Returns a new `secret` once. For the next 24 hours deliveries carry signatures from both the new and the old secret in `webhook-signature`, so you can switch without dropping events.","operationId":"rotateWebhookEndpointSecret","parameters":[{"description":"Webhook endpoint id.","in":"path","name":"endpoint_id","required":true,"schema":{"title":"Endpoint Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"secret":"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD","success":true,"webhookEndpoint":{"consecutiveFailures":0,"createdAt":"2026-11-01T08:15:00+00:00","description":"CRM sync","enabled":true,"events":["call.completed","call.escalated","lead.created"],"id":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","lastStatus":"HTTP 200","lastSuccessAt":"2026-11-15T10:42:07.512000+00:00","previousSecretExpiresAt":"2026-11-16T10:50:00+00:00","updatedAt":"2026-11-15T10:42:07.512000+00:00","url":"https://example.com/hooks/call-mitra"}},"schema":{"$ref":"#/components/schemas/WebhookEndpointSecretResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"webhook_endpoint_not_found":{"$ref":"#/components/examples/webhook_endpoint_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `webhook_endpoint_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Rotate an endpoint's signing secret","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","webhook_endpoint_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/webhook-endpoints/{endpoint_id}/test":{"post":{"description":"Sends a signed `webhook.test` event to the endpoint now, whatever its event filter, and returns the delivery with the endpoint's answer. A failed test is retried like any other delivery. Tests and redeliveries share a cap of 10 per endpoint per minute (429 with `Retry-After`).","operationId":"sendTestWebhook","parameters":[{"description":"Webhook endpoint id.","in":"path","name":"endpoint_id","required":true,"schema":{"title":"Endpoint Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"webhookDelivery":{"attempts":1,"createdAt":"2026-11-15T10:41:47.106000+00:00","deliveredAt":"2026-11-15T10:42:07.512000+00:00","endpointId":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","eventId":"evt_0a7e3d91c5b24f6c8e1d2b9a4f7c6e53","eventType":"webhook.test","id":"0d9a4e61-3c7b-4f2a-b815-6e2c9d7f0a38","lastAttemptAt":"2026-11-15T10:42:07.512000+00:00","lastError":"","lastStatusCode":200,"latencyMs":184,"payload":{"apiVersion":"v1","createdAt":"2026-11-15T10:45:00.000000Z","data":{"endpointId":"4f0c2a8e-7b1d-4c39-9a51-2d6e8f3b1c07","message":"This is a test event from Call Mitra."},"id":"evt_0a7e3d91c5b24f6c8e1d2b9a4f7c6e53","type":"webhook.test"},"responseSnippet":"ok","status":"delivered"}},"schema":{"$ref":"#/components/schemas/WebhookDeliveryResponse"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"},"webhook_workspace_required":{"$ref":"#/components/examples/webhook_workspace_required"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`, `webhook_workspace_required`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"webhook_endpoint_not_found":{"$ref":"#/components/examples/webhook_endpoint_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `webhook_endpoint_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"webhook_endpoint_disabled":{"$ref":"#/components/examples/webhook_endpoint_disabled"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `webhook_endpoint_disabled`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Send a test event","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","webhook_workspace_required","webhook_endpoint_not_found","webhook_endpoint_disabled","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/webhook-event-types/":{"get":{"operationId":"listWebhookEventTypes","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"eventTypes":[{"description":"A call ended (any final status). Sent after post-call analysis.","type":"call.completed"},{"description":"A lead was created in the console, through the API or by a lead source.","type":"lead.created"}],"success":true},"schema":{"$ref":"#/components/schemas/WebhookEventTypeList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List event types","tags":["Webhooks"],"x-api-key-resource":"webhooks","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]}},"/api/v1/webhooks/leads/{webhook_token}":{"post":{"description":"Send the integration key in `X-Lead-Webhook-Key` (or as `?key=`). Limited to 300 requests per minute per IP. Errors return `{\"success\": false, \"error\": \"...\"}`.","operationId":"pushLead","parameters":[{"description":"The token in your integration's URL.","in":"path","name":"webhook_token","required":true,"schema":{"title":"Webhook Token","type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"city":"Pune","email":"asha@example.com","lead_id":"form-8812","name":"Asha Rao","phone":"9876543210"},"schema":{"$ref":"#/components/schemas/LeadIntake"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"campaignAttached":true,"externalLeadId":"form-8812","leadId":"5a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c4d","success":true},"schema":{"$ref":"#/components/schemas/LeadIntakeResult"}}},"description":"OK","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"example":{"error":"Lead must include phone or email","success":false},"schema":{"$ref":"#/components/schemas/LeadIntakeError"}}},"description":"The payload was rejected, for example no phone or email.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"example":{"error":"invalid webhook key","success":false},"schema":{"$ref":"#/components/schemas/LeadIntakeError"}}},"description":"The integration key is missing or wrong.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"example":{"error":"integration not found","success":false},"schema":{"$ref":"#/components/schemas/LeadIntakeError"}}},"description":"No active integration has this token.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"example":{"error":"rate limit","success":false},"schema":{"$ref":"#/components/schemas/LeadIntakeError"}}},"description":"More than the allowed requests per minute from this IP.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"example":{"error":"database unavailable","success":false},"schema":{"$ref":"#/components/schemas/LeadIntakeError"}}},"description":"The lead could not be saved; `error` says why. Retry: repeats are dropped.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"LeadWebhookKey":[]},{"LeadWebhookKeyQuery":[]}],"summary":"Push a lead","tags":["Lead intake webhook"]}},"/api/v1/whatsapp/message-templates":{"get":{"description":"Templates of your WhatsApp Business accounts, to pick `template.name` and `template.language`.","operationId":"listWhatsAppTemplates","parameters":[{"description":"Only templates usable from this sending number.","in":"query","name":"phoneId","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phoneid"}},{"description":"Filter by review status, e.g. `APPROVED`.","in":"query","name":"status","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"description":"`MARKETING`, `UTILITY` or `AUTHENTICATION`.","in":"query","name":"category","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"description":"Part of the template name.","in":"query","name":"q","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}}],"responses":{"200":{"content":{"application/json":{"example":{"templates":[{"category":"UTILITY","components":[{"text":"Hi {{1}}, your order {{2}} is on its way.","type":"BODY"},{"text":"Reply STOP to opt out","type":"FOOTER"}],"id":"2e8d4f6a-1b3c-4d5e-9f7a-8b9c0d1e2f3a","language":"en","lastSyncedAt":"2026-01-15T08:00:00+00:00","name":"order_update","parameterFormat":"POSITIONAL","qualityScore":"GREEN","status":"APPROVED"}]},"schema":{"$ref":"#/components/schemas/WhatsAppTemplateList"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"List WhatsApp templates","tags":["WhatsApp"],"x-api-key-resource":"whatsapp","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","resource_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/whatsapp/messages":{"post":{"description":"Sends a template, text, media, interactive, location or contacts message to `to` (or `contactId`) from `phoneId` or your default number. Templates can be sent any time; every other type needs the customer to have messaged you in the last 24 hours. A refusal by WhatsApp after the message was created returns 200 with `status: failed` and `error`; a temporary refusal returns 429 or 503 with `Retry-After`, and nothing was delivered.","operationId":"sendWhatsAppMessage","parameters":[{"description":"Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"example":{"template":{"language":"en","name":"order_update","values":{"body":["Asha","#1042"]}},"to":"+919812345678","type":"template"},"schema":{"$ref":"#/components/schemas/WhatsAppMessageSend"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"conversationId":"0b6f2a8e-4c1d-4f7a-8f53-6a1c9e2d7b44","createdAt":"2026-01-15T09:30:00+00:00","id":"7d3c1a52-9f0e-4b8e-9a59-2f4f3c6b1e10","status":"accepted","wamid":"wamid.HBgMOTE5ODEyMzQ1Njc4FQIAERgSQ0Y2"},"schema":{"$ref":"#/components/schemas/WhatsAppMessage"}}},"description":"OK","headers":{"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"content":{"application/json":{"examples":{"bad_request":{"$ref":"#/components/examples/bad_request"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Bad request: `bad_request`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"},"whatsapp_template_not_found":{"$ref":"#/components/examples/whatsapp_template_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`, `whatsapp_template_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"409":{"content":{"application/json":{"examples":{"idempotency_key_reused":{"$ref":"#/components/examples/idempotency_key_reused"},"idempotency_request_in_progress":{"$ref":"#/components/examples/idempotency_request_in_progress"},"whatsapp_client_message_id_reused":{"$ref":"#/components/examples/whatsapp_client_message_id_reused"},"whatsapp_marketing_opted_out":{"$ref":"#/components/examples/whatsapp_marketing_opted_out"},"whatsapp_number_not_connected":{"$ref":"#/components/examples/whatsapp_number_not_connected"},"whatsapp_opt_in_required":{"$ref":"#/components/examples/whatsapp_opt_in_required"},"whatsapp_recipient_opted_out":{"$ref":"#/components/examples/whatsapp_recipient_opted_out"},"whatsapp_template_not_approved":{"$ref":"#/components/examples/whatsapp_template_not_approved"},"whatsapp_window_closed":{"$ref":"#/components/examples/whatsapp_window_closed"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Conflict: `idempotency_key_reused`, `idempotency_request_in_progress`, `whatsapp_client_message_id_reused`, `whatsapp_marketing_opted_out`, `whatsapp_number_not_connected`, `whatsapp_opt_in_required`, `whatsapp_recipient_opted_out`, `whatsapp_template_not_approved`, `whatsapp_window_closed`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"},"whatsapp_upstream_throttled":{"$ref":"#/components/examples/whatsapp_upstream_throttled"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`, `whatsapp_upstream_throttled`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"503":{"content":{"application/json":{"examples":{"whatsapp_upstream_unavailable":{"$ref":"#/components/examples/whatsapp_upstream_unavailable"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Service unavailable: `whatsapp_upstream_unavailable`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Send a WhatsApp message","tags":["WhatsApp"],"x-api-key-resource":"whatsapp","x-error-codes":["bad_request","api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","resource_not_found","whatsapp_template_not_found","idempotency_key_reused","idempotency_request_in_progress","whatsapp_client_message_id_reused","whatsapp_marketing_opted_out","whatsapp_number_not_connected","whatsapp_opt_in_required","whatsapp_recipient_opted_out","whatsapp_template_not_approved","whatsapp_window_closed","parameter_invalid","rate_limit_exceeded","whatsapp_upstream_throttled","internal_error","whatsapp_upstream_unavailable"]}},"/api/v1/whatsapp/messages/{message_id}":{"get":{"description":"Current delivery status of a message you sent. Poll it to follow `queued` → `sent` → `delivered` → `read` (or `failed`).","operationId":"getWhatsAppMessage","parameters":[{"description":"The `id` returned when the message was sent.","in":"path","name":"message_id","required":true,"schema":{"title":"Message Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"conversationId":"0b6f2a8e-4c1d-4f7a-8f53-6a1c9e2d7b44","createdAt":"2026-01-15T09:30:00+00:00","id":"7d3c1a52-9f0e-4b8e-9a59-2f4f3c6b1e10","status":"delivered","wamid":"wamid.HBgMOTE5ODEyMzQ1Njc4FQIAERgSQ0Y2"},"schema":{"$ref":"#/components/schemas/WhatsAppMessage"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"404":{"content":{"application/json":{"examples":{"resource_not_found":{"$ref":"#/components/examples/resource_not_found"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found: `resource_not_found`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"422":{"content":{"application/json":{"examples":{"parameter_invalid":{"$ref":"#/components/examples/parameter_invalid"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameters: `parameter_invalid`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Get a WhatsApp message","tags":["WhatsApp"],"x-api-key-resource":"whatsapp","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","resource_not_found","parameter_invalid","rate_limit_exceeded","internal_error"]}},"/api/v1/workspace":{"get":{"description":"Returns the workspace the request runs in, the key that sent it (access, resources, expiry) and its rate limit. Every key can call this, including read-only keys and keys limited to other resources. With `X-Workspace-Id`, an agency key sees the client workspace.","operationId":"getWorkspace","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"apiKey":{"id":"0d9e8f7a-6b5c-4d3e-2f1a-0b9c8d7e6f5a","name":"CRM sync","prefix":"vk_live_Ab3dE6","scopes":{"access":"read","resources":["calls","leads"]}},"rateLimit":{"limit":300,"windowSeconds":60},"success":true,"workspace":{"id":"7b1c2f0e-1d2a-4c3b-9a8e-5f6d7c8b9a01","name":"Acme Realty"}},"schema":{"$ref":"#/components/schemas/WorkspaceIdentity"}}},"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"401":{"content":{"application/json":{"examples":{"api_key_expired":{"$ref":"#/components/examples/api_key_expired"},"invalid_api_key":{"$ref":"#/components/examples/invalid_api_key"},"unauthenticated":{"$ref":"#/components/examples/unauthenticated"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unauthorized: `api_key_expired`, `invalid_api_key`, `unauthenticated`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"403":{"content":{"application/json":{"examples":{"api_key_scope_denied":{"$ref":"#/components/examples/api_key_scope_denied"},"permission_denied":{"$ref":"#/components/examples/permission_denied"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden: `api_key_scope_denied`, `permission_denied`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"429":{"content":{"application/json":{"examples":{"rate_limit_exceeded":{"$ref":"#/components/examples/rate_limit_exceeded"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many requests: `rate_limit_exceeded`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"500":{"content":{"application/json":{"examples":{"internal_error":{"$ref":"#/components/examples/internal_error"}},"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Server error: `internal_error`.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"summary":"Check an API key","tags":["Workspace"],"x-api-key-resource":"any","x-error-codes":["api_key_expired","invalid_api_key","unauthenticated","api_key_scope_denied","permission_denied","rate_limit_exceeded","internal_error"]}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"servers":[{"url":"https://api.callmitra.ai"}],"tags":[{"description":"The people your agents call.","name":"Leads"},{"description":"Notes on a lead: typed by your team, sent by API, or written by the AI.","name":"Lead notes"},{"description":"Numbers that are never dialed.","name":"Do-not-call"},{"description":"A list of leads, an agent and a caller ID, dialed on a schedule.","name":"Campaigns"},{"description":"Place calls and read their results: status, transcript, summary, outcome, recording.","name":"Calls"},{"description":"Your AI agents: create, edit, publish, start and pause them, import one from another platform, and list the voices and tools they can use.","name":"Agents"},{"description":"Caller IDs and SIP trunks connected to your workspace.","name":"Phone numbers"},{"description":"Check which workspace and key a request runs as and, for an agency, list its client workspaces. Every API key can call these.","name":"Workspace"},{"description":"**Webhook endpoints** receive events as they happen: create one, pick the event types (or all), and keep the `whsec_` secret it returns once. Each body is `{id, type, apiVersion, createdAt, data}`; the event types and their `data` are listed under **Webhooks** below.\n\n**Verifying a delivery (Standard Webhooks):** the signed content is `{webhook-id}.{webhook-timestamp}.{raw request body}`. Base64-decode the part of your secret after `whsec_`, compute HMAC-SHA256 of the signed content with it and base64-encode the result. `webhook-signature` holds one or more space-separated `v1,<signature>` values; accept the request if any matches (compare in constant time). Use the raw request body bytes, before parsing. Reject requests whose `webhook-timestamp` is more than 5 minutes from your clock. `webhook-id` is the same on every retry and redelivery; use it to drop repeats. After a secret rotation the old secret keeps signing (a second `v1,` value) for 24 hours. Deliveries also carry `X-Signature-SHA256`, a hex HMAC-SHA256 of the raw body only (keyed with the whole `whsec_...` string), for compatibility with receivers built for campaign webhook URLs. It does not cover the id or the timestamp, so it does not stop replays: verify `webhook-signature` and the 5-minute timestamp window instead.\n\n**Retries:** answer with any 2xx within 10 seconds; redirects are not followed. Otherwise the delivery is retried up to 12 attempts with exponential backoff, starting at 30 seconds. A 4xx other than 408, 409, 425 or 429 is not retried. An endpoint that fails 20 times in a row over at least 24 hours is turned off with a reason; turn it back on by updating it. Deliveries, with their latest attempt, are kept for 30 days, and any of them can be sent again.\n\n**Webhook URLs on a campaign or agent** receive call results, callbacks and failed transfers as a flat JSON body with `event` and `timestamp` (Unix seconds). The campaign's URL wins; otherwise the agent's post-call webhook. `X-Signature-SHA256` is the hex HMAC-SHA256 of the raw request body using that URL's secret; reject a `timestamp` more than 5 minutes old. `X-Webhook-Id` is the same on every retry. These retry the same way. Every other event, including ticket changes, goes to webhook endpoints only.","name":"Webhooks"},{"description":"Push leads in from forms, ads or your CRM. Create a lead integration in the console to get its URL and key; new leads join the integration's campaign and are called automatically when that campaign is running.","name":"Lead intake webhook"},{"description":"Send WhatsApp messages from your connected WhatsApp Business number and read their delivery status. A message outside the 24-hour customer service window must be an approved template; marketing templates also need a recorded opt-in.","name":"WhatsApp"},{"description":"Support tickets: create, update, add notes, reply to the customer, and list the categories and teams tickets are filed under.","name":"Tickets"}],"webhooks":{"callCompleted":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event). A webhook URL set on a campaign or an agent receives the fields of `data` at the top level instead, plus `event` (the type) and `timestamp` (Unix seconds), signed with `X-Signature-SHA256` only.","operationId":"onCallCompleted","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"additionalProperties":true,"properties":{"agentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"callAnalysis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}]},"callId":{"format":"uuid","type":"string"},"campaignId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"crmPayload":{"anyOf":[{"additionalProperties":true,"description":"Everything the call stored for your CRM, including callAnalysis and transfer details.","properties":{},"type":"object"},{"type":"null"}]},"customerNumber":{"anyOf":[{"description":"The number dialled or the caller's number.","type":"string"},{"type":"null"}]},"direction":{"enum":["outbound","inbound"],"type":"string"},"duration":{"anyOf":[{"description":"Seconds.","type":"number"},{"type":"null"}]},"endTime":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"endedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"extractedFields":{"additionalProperties":true,"type":"object"},"lead":{"anyOf":[{"properties":{"company":{"type":"string"},"customFields":{"additionalProperties":true,"description":"Custom field values (text, numbers, booleans or lists). Sensitive and archived fields are left out.","properties":{},"type":"object"},"email":{"type":"string"},"externalId":{"anyOf":[{"description":"Your ID for this lead, when you sent one.","type":"string"},{"type":"null"}]},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"phone":{"type":"string"}},"required":["id"],"type":"object"},{"type":"null"}]},"leadId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"merchantOutcome":{"description":"Outcome of the lead's or call's latest result.","enum":["qualified","interested","callback","not_interested","no_response","no_answer","busy","call_failed","voicemail",""],"type":"string"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}]},"outcomeCategory":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"description":"The lead's phone, or the number dialled when there is no lead.","type":"string"},{"type":"null"}]},"providerCallId":{"anyOf":[{"type":"string"},{"type":"null"}]},"recommendedLeadStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"recordingUrl":{"anyOf":[{"description":"Fetch with your `X-API-Key`.","format":"uri","type":"string"},{"type":"null"}]},"sentiment":{"anyOf":[{"enum":["positive","neutral","negative"],"type":"string"},{"type":"null"}]},"startTime":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"status":{"description":"Final call status, for example `completed`, `no_answer`, `busy` or `failed`.","type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"transcript":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["callId","status"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"call.completed","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"call.completed: a call finished","tags":["Webhooks"]}},"callEscalated":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event). A webhook URL set on a campaign or an agent receives the fields of `data` at the top level instead, plus `event` (the type) and `timestamp` (Unix seconds), signed with `X-Signature-SHA256` only.","operationId":"onCallEscalated","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"additionalProperties":true,"properties":{"agentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"callId":{"format":"uuid","type":"string"},"campaignId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"customerNumber":{"anyOf":[{"description":"The number dialled or the caller's number.","type":"string"},{"type":"null"}]},"direction":{"enum":["outbound","inbound"],"type":"string"},"endedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"lead":{"anyOf":[{"properties":{"company":{"type":"string"},"customFields":{"additionalProperties":true,"description":"Custom field values (text, numbers, booleans or lists). Sensitive and archived fields are left out.","properties":{},"type":"object"},"email":{"type":"string"},"externalId":{"anyOf":[{"description":"Your ID for this lead, when you sent one.","type":"string"},{"type":"null"}]},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"phone":{"type":"string"}},"required":["id"],"type":"object"},{"type":"null"}]},"leadId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"description":"The lead's phone, or the number dialled when there is no lead.","type":"string"},{"type":"null"}]},"providerCallId":{"anyOf":[{"type":"string"},{"type":"null"}]},"transferDialStatus":{"anyOf":[{"description":"The carrier's answer for the transfer leg, when known.","type":"string"},{"type":"null"}]},"transferReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"transferStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"transferTarget":{"anyOf":[{"type":"string"},{"type":"null"}]},"transferType":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["callId"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"call.escalated","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"call.escalated: a call was transferred to a person","tags":["Webhooks"]}},"callFailed":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onCallFailed","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"additionalProperties":true,"properties":{"agentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"callAnalysis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}]},"callId":{"format":"uuid","type":"string"},"campaignId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"crmPayload":{"anyOf":[{"additionalProperties":true,"description":"Everything the call stored for your CRM, including callAnalysis and transfer details.","properties":{},"type":"object"},{"type":"null"}]},"customerNumber":{"anyOf":[{"description":"The number dialled or the caller's number.","type":"string"},{"type":"null"}]},"direction":{"enum":["outbound","inbound"],"type":"string"},"duration":{"anyOf":[{"description":"Seconds.","type":"number"},{"type":"null"}]},"endTime":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"endedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"extractedFields":{"additionalProperties":true,"type":"object"},"lead":{"anyOf":[{"properties":{"company":{"type":"string"},"customFields":{"additionalProperties":true,"description":"Custom field values (text, numbers, booleans or lists). Sensitive and archived fields are left out.","properties":{},"type":"object"},"email":{"type":"string"},"externalId":{"anyOf":[{"description":"Your ID for this lead, when you sent one.","type":"string"},{"type":"null"}]},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"phone":{"type":"string"}},"required":["id"],"type":"object"},{"type":"null"}]},"leadId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"merchantOutcome":{"description":"Outcome of the lead's or call's latest result.","enum":["qualified","interested","callback","not_interested","no_response","no_answer","busy","call_failed","voicemail",""],"type":"string"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}]},"outcomeCategory":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"description":"The lead's phone, or the number dialled when there is no lead.","type":"string"},{"type":"null"}]},"providerCallId":{"anyOf":[{"type":"string"},{"type":"null"}]},"recommendedLeadStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"recordingUrl":{"anyOf":[{"description":"Fetch with your `X-API-Key`.","format":"uri","type":"string"},{"type":"null"}]},"sentiment":{"anyOf":[{"enum":["positive","neutral","negative"],"type":"string"},{"type":"null"}]},"startTime":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"status":{"description":"Final call status, for example `completed`, `no_answer`, `busy` or `failed`.","type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"transcript":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["callId","status"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"call.failed","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"call.failed: a call ended without connecting","tags":["Webhooks"]}},"callbackCompleted":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event). A webhook URL set on a campaign or an agent receives the fields of `data` at the top level instead, plus `event` (the type) and `timestamp` (Unix seconds), signed with `X-Signature-SHA256` only.","operationId":"onCallbackCompleted","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"agentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"attempts":{"type":"integer"},"callbackId":{"format":"uuid","type":"string"},"campaignId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"dialAt":{"description":"The callback time, ISO 8601.","format":"date-time","type":"string"},"kind":{"type":"string"},"leadId":{"format":"uuid","type":"string"},"note":{"type":"string"},"source":{"type":"string"},"when":{"description":"The callback time in the lead's time zone, readable.","type":"string"}},"required":["callbackId","leadId","dialAt"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"callback.completed","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"callback.completed: a booked callback was made","tags":["Webhooks"]}},"callbackFailed":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event). A webhook URL set on a campaign or an agent receives the fields of `data` at the top level instead, plus `event` (the type) and `timestamp` (Unix seconds), signed with `X-Signature-SHA256` only.","operationId":"onCallbackFailed","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"agentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"attempts":{"type":"integer"},"callbackId":{"format":"uuid","type":"string"},"campaignId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"dialAt":{"description":"The callback time, ISO 8601.","format":"date-time","type":"string"},"kind":{"type":"string"},"leadId":{"format":"uuid","type":"string"},"note":{"type":"string"},"source":{"type":"string"},"when":{"description":"The callback time in the lead's time zone, readable.","type":"string"}},"required":["callbackId","leadId","dialAt"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"callback.failed","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"callback.failed: a booked callback did not reach the lead","tags":["Webhooks"]}},"callbackScheduled":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event). A webhook URL set on a campaign or an agent receives the fields of `data` at the top level instead, plus `event` (the type) and `timestamp` (Unix seconds), signed with `X-Signature-SHA256` only.","operationId":"onCallbackScheduled","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"agentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"attempts":{"type":"integer"},"callbackId":{"format":"uuid","type":"string"},"campaignId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"dialAt":{"description":"The callback time, ISO 8601.","format":"date-time","type":"string"},"kind":{"type":"string"},"leadId":{"format":"uuid","type":"string"},"note":{"type":"string"},"source":{"type":"string"},"when":{"description":"The callback time in the lead's time zone, readable.","type":"string"}},"required":["callbackId","leadId","dialAt"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"callback.scheduled","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"callback.scheduled: a callback was booked","tags":["Webhooks"]}},"campaignCompleted":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onCampaignCompleted","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"agentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"campaignId":{"format":"uuid","type":"string"},"completedAt":{"anyOf":[{"description":"Only on campaign.completed.","format":"date-time","type":"string"},{"type":"null"}]},"direction":{"enum":["outbound","inbound"],"type":"string"},"name":{"type":"string"},"startedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]}},"required":["campaignId"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"campaign.completed","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"campaign.completed: a campaign dialled every lead","tags":["Webhooks"]}},"campaignStarted":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onCampaignStarted","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"agentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"campaignId":{"format":"uuid","type":"string"},"completedAt":{"anyOf":[{"description":"Only on campaign.completed.","format":"date-time","type":"string"},{"type":"null"}]},"direction":{"enum":["outbound","inbound"],"type":"string"},"name":{"type":"string"},"startedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]}},"required":["campaignId"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"campaign.started","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"campaign.started: a campaign was started","tags":["Webhooks"]}},"leadCreated":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event). Sent for leads added one at a time: `createLead`, the console's add-lead form, and each lead a connected lead source delivers (Meta lead ads, Google Ads lead forms, lead-source webhooks). It is not sent for spreadsheet imports, campaign lead uploads or campaigns created with leads, nor for leads made automatically for WhatsApp contacts, unknown inbound callers, outbound calls to a new number or do-not-call entries.","operationId":"onLeadCreated","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"assignedToUserId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"callStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"type":"string"},"createdAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"customFields":{"additionalProperties":true,"description":"Custom field values (text, numbers, booleans or lists). Sensitive and archived fields are left out.","properties":{},"type":"object"},"email":{"type":"string"},"externalId":{"anyOf":[{"description":"Your ID for this lead, when you sent one.","type":"string"},{"type":"null"}]},"id":{"format":"uuid","type":"string"},"leadSourceId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"name":{"type":"string"},"phone":{"type":"string"},"source":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"items":{"type":"string"},"type":"array"},"title":{"type":"string"},"updatedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]}},"required":["id"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"lead.created","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"lead.created: a lead was created","tags":["Webhooks"]}},"leadUpdated":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onLeadUpdated","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"assignedToUserId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"callStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"type":"string"},"createdAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"customFields":{"additionalProperties":true,"description":"Custom field values (text, numbers, booleans or lists). Sensitive and archived fields are left out.","properties":{},"type":"object"},"email":{"type":"string"},"externalId":{"anyOf":[{"description":"Your ID for this lead, when you sent one.","type":"string"},{"type":"null"}]},"id":{"format":"uuid","type":"string"},"leadSourceId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"name":{"type":"string"},"phone":{"type":"string"},"source":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"items":{"type":"string"},"type":"array"},"title":{"type":"string"},"updatedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]}},"required":["id"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"lead.updated","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"lead.updated: a lead was edited","tags":["Webhooks"]}},"ticketCreated":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onTicketCreated","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"additionalProperties":true,"description":"`category`, `team`, `tags` and `mergedInto` appear only when the ticket has them. Some changes add extra keys describing the change.","properties":{"assignedToUserId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"assignees":{"items":{"properties":{"email":{"type":"string"},"name":{"type":"string"},"userId":{"format":"uuid","type":"string"}},"type":"object"},"type":"array"},"category":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"closedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatScore":{"anyOf":[{"type":"integer"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"leadId":{"format":"uuid","type":"string"},"merchantId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"mergedInto":{"properties":{"id":{"format":"uuid","type":"string"},"ref":{"type":"string"}},"type":"object"},"previousStatus":{"description":"Only on ticket.reopened.","type":"string"},"priority":{"type":"string"},"reopenedBy":{"description":"Only on ticket.reopened.","type":"string"},"resolvedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"source":{"type":"string"},"sourceCallId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"type":"string"},"subject":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"team":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"ticketId":{"format":"uuid","type":"string"},"ticketRef":{"description":"Short reference shown to the customer.","type":"string"},"type":{"type":"string"},"version":{"type":"integer"}},"required":["ticketId","leadId","status"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"ticket.created","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"ticket.created: a support ticket was opened","tags":["Webhooks"]}},"ticketRated":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onTicketRated","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"additionalProperties":true,"description":"`category`, `team`, `tags` and `mergedInto` appear only when the ticket has them. Some changes add extra keys describing the change.","properties":{"assignedToUserId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"assignees":{"items":{"properties":{"email":{"type":"string"},"name":{"type":"string"},"userId":{"format":"uuid","type":"string"}},"type":"object"},"type":"array"},"category":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"closedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatScore":{"anyOf":[{"type":"integer"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"leadId":{"format":"uuid","type":"string"},"merchantId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"mergedInto":{"properties":{"id":{"format":"uuid","type":"string"},"ref":{"type":"string"}},"type":"object"},"previousStatus":{"description":"Only on ticket.reopened.","type":"string"},"priority":{"type":"string"},"reopenedBy":{"description":"Only on ticket.reopened.","type":"string"},"resolvedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"source":{"type":"string"},"sourceCallId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"type":"string"},"subject":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"team":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"ticketId":{"format":"uuid","type":"string"},"ticketRef":{"description":"Short reference shown to the customer.","type":"string"},"type":{"type":"string"},"version":{"type":"integer"}},"required":["ticketId","leadId","status"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"ticket.rated","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"ticket.rated: a customer rated a support ticket","tags":["Webhooks"]}},"ticketReopened":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onTicketReopened","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"additionalProperties":true,"description":"`category`, `team`, `tags` and `mergedInto` appear only when the ticket has them. Some changes add extra keys describing the change.","properties":{"assignedToUserId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"assignees":{"items":{"properties":{"email":{"type":"string"},"name":{"type":"string"},"userId":{"format":"uuid","type":"string"}},"type":"object"},"type":"array"},"category":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"closedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatScore":{"anyOf":[{"type":"integer"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"leadId":{"format":"uuid","type":"string"},"merchantId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"mergedInto":{"properties":{"id":{"format":"uuid","type":"string"},"ref":{"type":"string"}},"type":"object"},"previousStatus":{"description":"Only on ticket.reopened.","type":"string"},"priority":{"type":"string"},"reopenedBy":{"description":"Only on ticket.reopened.","type":"string"},"resolvedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"source":{"type":"string"},"sourceCallId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"type":"string"},"subject":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"team":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"ticketId":{"format":"uuid","type":"string"},"ticketRef":{"description":"Short reference shown to the customer.","type":"string"},"type":{"type":"string"},"version":{"type":"integer"}},"required":["ticketId","leadId","status"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"ticket.reopened","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"ticket.reopened: a support ticket opened again","tags":["Webhooks"]}},"ticketResolved":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onTicketResolved","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"additionalProperties":true,"description":"`category`, `team`, `tags` and `mergedInto` appear only when the ticket has them. Some changes add extra keys describing the change.","properties":{"assignedToUserId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"assignees":{"items":{"properties":{"email":{"type":"string"},"name":{"type":"string"},"userId":{"format":"uuid","type":"string"}},"type":"object"},"type":"array"},"category":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"closedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatScore":{"anyOf":[{"type":"integer"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"leadId":{"format":"uuid","type":"string"},"merchantId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"mergedInto":{"properties":{"id":{"format":"uuid","type":"string"},"ref":{"type":"string"}},"type":"object"},"previousStatus":{"description":"Only on ticket.reopened.","type":"string"},"priority":{"type":"string"},"reopenedBy":{"description":"Only on ticket.reopened.","type":"string"},"resolvedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"source":{"type":"string"},"sourceCallId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"type":"string"},"subject":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"team":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"ticketId":{"format":"uuid","type":"string"},"ticketRef":{"description":"Short reference shown to the customer.","type":"string"},"type":{"type":"string"},"version":{"type":"integer"}},"required":["ticketId","leadId","status"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"ticket.resolved","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"ticket.resolved: a support ticket was resolved","tags":["Webhooks"]}},"ticketUpdated":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onTicketUpdated","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"additionalProperties":true,"description":"`category`, `team`, `tags` and `mergedInto` appear only when the ticket has them. Some changes add extra keys describing the change.","properties":{"assignedToUserId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"assignees":{"items":{"properties":{"email":{"type":"string"},"name":{"type":"string"},"userId":{"format":"uuid","type":"string"}},"type":"object"},"type":"array"},"category":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"closedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"csatScore":{"anyOf":[{"type":"integer"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"firstResponseAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"leadId":{"format":"uuid","type":"string"},"merchantId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"mergedInto":{"properties":{"id":{"format":"uuid","type":"string"},"ref":{"type":"string"}},"type":"object"},"previousStatus":{"description":"Only on ticket.reopened.","type":"string"},"priority":{"type":"string"},"reopenedBy":{"description":"Only on ticket.reopened.","type":"string"},"resolvedAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"source":{"type":"string"},"sourceCallId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"status":{"type":"string"},"subject":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"team":{"properties":{"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"type":"object"},"ticketId":{"format":"uuid","type":"string"},"ticketRef":{"description":"Short reference shown to the customer.","type":"string"},"type":{"type":"string"},"version":{"type":"integer"}},"required":["ticketId","leadId","status"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"ticket.updated","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"ticket.updated: a support ticket changed","tags":["Webhooks"]}},"transferFailed":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event). A webhook URL set on a campaign or an agent receives the fields of `data` at the top level instead, plus `event` (the type) and `timestamp` (Unix seconds), signed with `X-Signature-SHA256` only.","operationId":"onTransferFailed","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"agentId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"callId":{"format":"uuid","type":"string"},"campaignId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"dialStatus":{"anyOf":[{"description":"The carrier's answer, for example `no-answer` or `busy`.","type":"string"},{"type":"null"}]},"leadId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]}},"required":["callId"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"transfer.failed","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"transfer.failed: a transfer to a person did not connect","tags":["Webhooks"]}},"webhookTest":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onWebhookTest","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"endpointId":{"format":"uuid","type":"string"},"message":{"type":"string"}},"required":["endpointId"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"webhook.test","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"webhook.test: sent by the send test event operation","tags":["Webhooks"]}},"whatsappMessageReceived":{"post":{"description":"Sent to webhook endpoints subscribed to this event (or to every event).","operationId":"onWhatsappMessageReceived","parameters":[{"description":"The event id (`evt_…`). Same on every retry and redelivery: use it to drop duplicates. Webhook endpoints only.","in":"header","name":"webhook-id","schema":{"type":"string"}},{"description":"When this attempt was sent, Unix seconds. Webhook endpoints only.","in":"header","name":"webhook-timestamp","schema":{"type":"string"}},{"description":"Space-separated `v1,<base64 signature>` values (two for 24 hours after a secret rotation). Webhook endpoints only.","in":"header","name":"webhook-signature","schema":{"type":"string"}},{"description":"Same on every retry of this delivery (the event id for webhook endpoints).","in":"header","name":"X-Webhook-Id","schema":{"type":"string"}},{"description":"The event type, for example `call.completed`.","in":"header","name":"X-Webhook-Event","schema":{"type":"string"}},{"description":"Hex HMAC-SHA256 of the raw request body only. On webhook endpoints it is a compatibility header, keyed with the whole `whsec_...` string: it covers neither `webhook-id` nor `webhook-timestamp`, so a captured request can be replayed. Verify `webhook-signature` and reject a `webhook-timestamp` more than 5 minutes from your clock instead. On a campaign or agent webhook URL it is the only signature, keyed with that URL's secret (when one is set); the signed body carries `timestamp`, so reject one more than 5 minutes old.","in":"header","name":"X-Signature-SHA256","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"const":"v1","type":"string"},"createdAt":{"description":"When the event happened, ISO 8601 UTC.","format":"date-time","type":"string"},"data":{"properties":{"contact":{"properties":{"bsuid":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"format":"uuid","type":"string"},"leadId":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"optInStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"items":{"type":"string"},"type":"array"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]}},"type":"object"},"conversationId":{"format":"uuid","type":"string"},"entrySource":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"properties":{"createdAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"hasMedia":{"type":"boolean"},"id":{"format":"uuid","type":"string"},"mediaFilename":{"anyOf":[{"type":"string"},{"type":"null"}]},"mediaMime":{"anyOf":[{"type":"string"},{"type":"null"}]},"payload":{"additionalProperties":true,"description":"The message content as WhatsApp sent it (keys unchanged).","properties":{},"type":"object"},"replyToWamid":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"description":"`text`, `image`, `button`, `interactive` and so on.","type":"string"},"wamid":{"anyOf":[{"type":"string"},{"type":"null"}]}},"type":"object"},"phoneId":{"format":"uuid","type":"string"},"serviceWindowExpiresAt":{"anyOf":[{"description":"ISO 8601 timestamp, UTC.","format":"date-time","type":"string"},{"type":"null"}]},"windowOpen":{"description":"True while you can send free-form replies.","type":"boolean"}},"required":["conversationId","message"],"type":"object"},"id":{"description":"Event id, `evt_` and 32 hex characters. Same on retries and redeliveries.","type":"string"},"type":{"const":"whatsapp.message.received","type":"string"}},"required":["id","type","apiVersion","createdAt","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Anything else is retried."}},"summary":"whatsapp.message.received: a customer sent a WhatsApp message","tags":["Webhooks"]}}}}