Skip to main content
Use POST /v1/sms-conversations to create a single SMS conversation. PAM sends the first outbound SMS immediately, then continues the conversation through inbound replies, assistant turns, and optional tool calls.

Create an SMS Conversation

Successful requests return 201 Created:
in_progress means the opening SMS was accepted by the provider and persisted by PAM.

Request Fields

Your API key determines the client organization for attribution and billing. Do not send clientOrgId in the request body. Use externalReferenceId when your system needs to map webhooks back to one of your own objects, such as a touchpoint, campaign, or workflow run. PAM stores the value and echoes it on webhooks when provided. For PAM-managed agents, PAM generates internal prompt context blocks from the submitted dynamicVariables plus server-owned client configuration. Those generated context blocks are not returned by SMS conversation GET or list responses.

Opening Message Rules

PAM-managed SMS agents require welcomeMessage. Build the message from your customer, dealership, and outreach context, then pass the resolved text in the create request. Custom SMS agents can use their configured opening behavior. For those agents, PAM can generate the opening turn from the agent configuration and dynamicVariables.

Supersede Behavior

Only one open SMS conversation should exist for the same (fromNumber, toNumber) pair. When you create a new SMS conversation for a pair that already has open conversations, PAM closes the older open conversations with:
Use the new conversationId returned by the create response for all future reconciliation.

List Conversations

Use GET /v1/sms-conversations to list SMS conversations for your organization.
You can filter by status, agentId, toNumber, fromNumber, createdAfter, and createdBefore. Results are cursor-paginated:
If hasMore is true, pass the returned cursor in the next request.

Get Conversation Status

Use GET /v1/sms-conversations/{id} to get the current status for one SMS conversation.
These read endpoints are useful when a webhook is delayed, retried, or missed by your system.

Status Meanings

Lifecycle Webhooks

Subscribe to these events to follow the conversation: Delivery updates are canonical PAM states, not raw provider events. A message can receive duplicate or out-of-order provider signals; PAM normalizes those before emitting sms.message_delivery_updated.

Close a Conversation

Use POST /v1/sms-conversations/{id}/close to manually close an open SMS conversation.
If reason is omitted, PAM uses admin_closed.

Common Errors

  • 400 validation_error — invalid phone format, invalid or non-HTTPS webhookUrl, both agentId and agentSlug were provided, or neither was provided.
  • 400 validation_errorfromNumber is missing for a PAM-managed agent.
  • 400 validation_errorwelcomeMessage is missing or blank for a PAM-managed SMS agent.
  • 400 validation_error — a managed agent request is missing required dynamicVariables.
  • 401 unauthorized — missing, expired, revoked, or invalid API key.
  • 404 not_found — the agent could not be resolved or the conversation does not belong to the authenticated client.