> ## 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.

# PAM Outbound API

> Make calls, start SMS conversations, manage API keys, and receive webhook events.

The PAM Outbound API is the external interface for launching and monitoring outbound calls and SMS conversations.

This prototype documents the public `/v1` surface for calls, SMS conversations, API keys, and webhooks. The API uses bearer API keys, JSON request bodies, cursor pagination, and a consistent response envelope.

## Base URL

```bash theme={null}
https://api.pamhq.com/v1
```

Use the environment-specific API host provided during onboarding. Endpoint paths in this documentation are relative to `/v1`.

## Quick Start

Create an API key in the PAM dashboard or ask your PAM contact to provision an initial key. Then send it in the `Authorization` header:

```http theme={null}
Authorization: Bearer $PAM_API_KEY
```

## Response Format

Successful responses return a `data` object or array plus request metadata:

```json theme={null}
{
  "data": {
    "conversationId": "b7ee8d1b-5e3e-4a1a-8f0a-9e2a4f8f1aa2"
  },
  "meta": {
    "requestId": "req_abc123"
  }
}
```

Errors use the same metadata envelope:

```json theme={null}
{
  "error": {
    "code": "validation_error",
    "message": "toNumber is required"
  },
  "meta": {
    "requestId": "req_abc123"
  }
}
```

## What You Can Build

* Use PAM-managed agents, or create your own for custom use cases.
* Make outbound voice calls with PAM agents.
* Start SMS conversations and continue them through replies and tool calls.
* Close open voice or SMS conversations when the outreach is done.
* Receive call and SMS lifecycle events through webhooks.

## Create Your First Call

```bash theme={null}
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": "voice-recall",
    "toNumber": "+15555550199",
    "fromNumber": "+15555550123",
    "welcomeMessage": "Hi Ada, this is PAM Motors following up on your service recall.",
    "dynamicVariables": {
      "contact_first_name": "Ada",
      "contact_last_name": "Lovelace",
      "dealership_name": "PAM Motors",
      "recall_id": "24V-123",
      "service_ids": "RECALL_SERVICE",
      "vin": "1HGBH41JXMN109186",
      "vehicle_year": "2021",
      "vehicle_make": "Honda",
      "vehicle_model": "Accord"
    }
  }'
```

## Create Your First SMS Conversation

```bash theme={null}
curl https://api.pamhq.com/v1/sms-conversations \
  -X POST \
  -H "Authorization: Bearer $PAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agentSlug": "sms-recall",
    "toNumber": "+15555550199",
    "fromNumber": "+15555550123",
    "welcomeMessage": "Hi Ada, this is PAM Motors following up on your service recall.",
    "dynamicVariables": {
      "contact_first_name": "Ada",
      "contact_last_name": "Lovelace",
      "dealership_name": "PAM Motors",
      "recall_id": "24V-123",
      "service_ids": "RECALL_SERVICE",
      "vin": "1HGBH41JXMN109186",
      "vehicle_year": "2021",
      "vehicle_make": "Honda",
      "vehicle_model": "Accord"
    }
  }'
```

## API Reference

The API Reference tab is generated from an OpenAPI 3.0 spec and includes interactive request builders for the implemented `/v1` endpoints.
