Skip to main content
POST
Create an SMS conversation

Authorizations

Authorization
string
header
default:pk_live_your_api_key
required

API key provided as Authorization: Bearer <key>.

Body

application/json

Select exactly one agent. Use agentSlug for PAM-managed agents, or agentId for a specific custom agent.

agentId
string<uuid>
required

Specific custom agent id.

toNumber
string
required

Phone number in E.164 format.

Pattern: ^\+\d{7,15}$
agentSlug
string

Stable slug for a PAM-managed agent.

Required string length: 1 - 255
fromNumber
string

Required when you use agentSlug. Ignored when the selected agent has a configured phone number.

Pattern: ^\+\d{7,15}$
welcomeMessage
string

Exact first SMS body. Required when you use a PAM-managed SMS agent.

dynamicVariables
object

Required when you use a PAM-managed recall, retention, or declined-services SMS agent. Send only public variables documented in the Agents guide; generated prompt blocks are internal.

metadata
object

Opaque metadata stored with the conversation for reconciliation.

externalReferenceId
string

Optional opaque caller-owned reference echoed as top-level externalReferenceId on webhook payloads. PAM does not interpret this value, does not require it to be globally unique, and does not use it as an idempotency key.

Required string length: 1 - 255
idempotencyKey
string

Stable key for safely retrying this create request.

Required string length: 1 - 255
webhookUrl
string<uri>

Optional HTTPS destination for webhook events from this SMS conversation. The URL overrides only this conversation's destination; event subscriptions, custom headers, and signing secret still come from the matching webhook registration.

Pattern: ^https://

Response

SMS conversation created

data
object
meta
object