Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.pam.ai/llms.txt

Use this file to discover all available pages before exploring further.

Use POST /v1/calls to start a single outbound voice call outside of a campaign. PAM accepts the request, creates a conversation, and dispatches the call asynchronously.

Create a Call

curl https://api.pamhq.com/v1/calls \
  -X POST \
  -H "Authorization: Bearer $PAM_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: call_01HV7K4ZD3Q9X8P1M8Y2K9A0BC" \
  -d '{
    "agentSlug": "recall-voice",
    "toNumber": "+15555550199",
    "fromNumber": "+15555550123",
    "dynamicVariables": {
      "customerName": "Ada",
      "dealershipName": "PAM Motors",
      "recallId": "24V-123"
    },
    "metadata": {
      "externalContactId": "contact_123"
    }
  }'
Successful requests return 202 Accepted:
{
  "data": {
    "conversationId": "b7ee8d1b-5e3e-4a1a-8f0a-9e2a4f8f1aa2",
    "status": "queued"
  },
  "meta": {
    "request_id": "req_abc123"
  }
}
queued means PAM has accepted the call for dispatch. Use webhooks to track connection, end, and post-call analysis events.

Request Fields

FieldRequiredDescription
agentSlugone of agentSlug or agentIdStable slug for a PAM-managed voice agent.
agentIdone of agentSlug or agentIdUUID of a specific agent.
toNumberyesCustomer phone number in E.164 format.
fromNumberPAM-managed agents onlySender phone number in E.164 format. For custom agents with a configured number, PAM uses the agent’s number.
dynamicVariablesnoString variables available to the agent during the call.
metadatanoOpaque reconciliation data stored with the conversation.
Your API key determines the client organization for attribution and billing. Do not send clientOrgId in the request body.

Idempotency

Idempotency-Key is required. Use the same key when retrying a request after a network error or timeout. If PAM has already created a conversation for the same key and client organization, the retry returns the original conversationId and current status instead of creating a duplicate call.

Lifecycle Webhooks

Subscribe to these events to follow the call:
EventWhen it fires
call.startedThe provider reports that the call started.
call.endedThe call has ended and the transcript has been persisted.
call.analyzedPost-call analysis is available.
Webhook payloads are canonical PAM payloads. Provider-specific Retell identifiers and raw provider payloads are not part of the external contract.

Close a Call

Use POST /v1/calls/{id}/close to close an open voice conversation.
curl https://api.pamhq.com/v1/calls/b7ee8d1b-5e3e-4a1a-8f0a-9e2a4f8f1aa2/close \
  -X POST \
  -H "Authorization: Bearer $PAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "admin_closed"
  }'
If reason is omitted, PAM uses admin_closed.

Common Errors

  • 400 validation_error — missing Idempotency-Key, invalid phone format, both agentId and agentSlug were provided, or neither was provided.
  • 400 validation_errorfromNumber is missing for a PAM-managed agent.
  • 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.