Skip to content
Markets open

API reference

AI voice agents

Build, preview and attach AI voice agents to campaigns.

9 operationsBase URL https://packetexchange.io/api/v1Postman collection

List your AI voice agents

GET/api/v1/ai-agents

Access
API key. Scoped keys need dialer:write.
Rate limit
100 requests per second (the default)

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
userIdrequireddata[].userIdstring (uuid)-
namerequireddata[].namestring-
voiceIdrequireddata[].voiceIdstring | null-
voiceProviderrequireddata[].voiceProviderstring-
languagerequireddata[].languagestring-
firstMessagerequireddata[].firstMessagestring | nullWhat the agent says when the call is answered
systemPromptrequireddata[].systemPromptstringThe script and instructions the agent follows
modelrequireddata[].modelstring-
guardrailsrequireddata[].guardrailsstring | null-
toolsrequireddata[].toolsstring[]-
maxCallSecondsrequireddata[].maxCallSecondsinteger-
enabledrequireddata[].enabledboolean-
createdAtrequireddata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata[].updatedAtstring (date-time)ISO-8601 timestamp (UTC)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Create an AI voice agent

POST/api/v1/ai-agents

Access
API key. Scoped keys need dialer:write.
Rate limit
100 requests per second (the default)

Request body (application/json)

FieldTypeDescription
namerequiredstring-max 120 chars
voiceIdstring | null-max 120 chars
voiceProviderstring-max 40 chars
languagestring-max 12 chars
firstMessagestring | null-max 500 chars
systemPromptrequiredstring-max 8000 chars
modelstring-max 60 chars
guardrailsstring | null-max 4000 chars
toolsstring[]-
maxCallSecondsinteger-1 to 3600
enabledboolean-

Response 201

FieldTypeDescription
datarequiredobjectSame fields as AiAgent, shown earlier on this page.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List the voices an agent can speak with

GET/api/v1/ai-agents/voices

Access
API key. Scoped keys need dialer:write.
Rate limit
100 requests per second (the default)

A trimmed list (about 60), English non-premium voices first.

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring-
namerequireddata[].namestring-
descriptionrequireddata[].descriptionstring-
genderrequireddata[].genderstring-
languagerequireddata[].languagestring-
is_prorequireddata[].is_proboolean-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Hear a voice speak a short line

POST/api/v1/ai-agents/voices/preview

Access
API key. Scoped keys need dialer:write.
Rate limit
100 requests per second (the default)

Returns MP3 audio of text (up to 300 characters) in the chosen voice.

Request body (application/json)

FieldTypeDescription
voiceIdrequiredstring-max 120 chars
textrequiredstring-max 300 chars

Response 200 (audio/mpeg)

MP3 audio of the line.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Draft an agent from a plain-English description

POST/api/v1/ai-agents/draft

Access
API key. Scoped keys need dialer:write.
Rate limit
20 requests per minute

Turns a description such as "call leads and book demos" into a name, opening line, script, guardrails and suggested tools. Nothing is saved; pass the result to POST /ai-agents.

Request body (application/json)

FieldTypeDescription
descriptionrequiredstring-max 2000 chars

Response 200

FieldTypeDescription
datarequiredobject-
namerequireddata.namestring-
firstMessagerequireddata.firstMessagestring-
systemPromptrequireddata.systemPromptstring-
guardrailsrequireddata.guardrailsstring-
suggestedToolsrequireddata.suggestedToolsstring[]-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get an AI voice agent

GET/api/v1/ai-agents/{id}

Access
API key. Scoped keys need dialer:write.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobjectSame fields as AiAgent, shown earlier on this page.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Update an AI voice agent

PATCH/api/v1/ai-agents/{id}

Access
API key. Scoped keys need dialer:write.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
namestring-max 120 chars
voiceIdstring | null-max 120 chars
voiceProviderstring-max 40 chars
languagestring-max 12 chars
firstMessagestring | null-max 500 chars
systemPromptstring-max 8000 chars
modelstring-max 60 chars
guardrailsstring | null-max 4000 chars
toolsstring[]-
maxCallSecondsinteger-1 to 3600
enabledboolean-

Response 200

FieldTypeDescription
datarequiredobjectSame fields as AiAgent, shown earlier on this page.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Delete an AI voice agent

DELETE/api/v1/ai-agents/{id}

Access
API key. Scoped keys need dialer:write.
Rate limit
100 requests per second (the default)

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Simulate one conversation turn with an agent

POST/api/v1/ai-agents/{id}/simulate

Access
API key. Scoped keys need dialer:write.
Rate limit
20 requests per minute

Send what the callee said (message) plus the prior turns (history); the agent answers with its spoken reply and what it would do next. No call is placed and nothing is billed.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
historyobject[]-
rolerequiredhistory[].rolestring-One of user, assistant
contentrequiredhistory[].contentstring-max 4000 chars
messagerequiredstring-max 2000 chars

Response 200

FieldTypeDescription
datarequiredobject-
replyrequireddata.replystringWhat the agent would say
actionrequireddata.actionstring-One of continue, end, transfer
captureddata.capturedobjectStructured details captured this turn (name, email, intent...)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.