> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesask.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Receive push notifications when recordings are processed or synced to a CRM.

## How it works

Sales Ask sends a `POST` request to every active webhook URL registered for your organization when a subscribed event occurs. No polling required.

```text theme={null}
Sales Ask  ──POST──▶  https://your-crm.com/hooks/salesask
```

Webhook URLs and event subscriptions are configured in Sales Ask under **Settings → Organization → Webhooks**.

## Events

| Event                           | Fired when                                                                                   |
| ------------------------------- | -------------------------------------------------------------------------------------------- |
| `recording.processed`           | AI analysis finishes (transcription, speaker identification, notes, coaching, action items). |
| `recording.integration_updated` | A recording is synced to a CRM via the integration sync action.                              |

Organizations with no explicit event subscription default to `recording.processed` only. To receive `recording.integration_updated` events, explicitly subscribe via the Events dropdown in webhook settings.

## Webhook envelope

Every webhook delivery wraps the payload in an envelope with the event name:

```json theme={null}
{
  "event": "recording.processed",
  "data": {
    "id": "abc123",
    "name": "Call with John Doe",
    "actionItems": "Action items from meeting\n- Follow up on quote\nClient action items\n- Send contract",
    "notes": "Rep discussed pricing and timeline. Customer showed strong buying intent.",
    "meetingUrl": "https://app.salesask.com/meetings/abc123",
    "process": "1. Discovery question: \nAnswer: Yes\n\nProcess Summary: Good discovery.",
    "processFollowed": 3,
    "processMissed": 1,
    "processTotal": 4
  }
}
```

### Payload fields (inside `data`)

| Field             | Type    | Description                                                       |
| ----------------- | ------- | ----------------------------------------------------------------- |
| `id`              | string  | Recording ID. Use with `GET /v1/recordings/:id` for full details. |
| `name`            | string  | Recording name.                                                   |
| `actionItems`     | string  | Formatted action items text (explicit + client).                  |
| `notes`           | string  | Plain-text notes from AI analysis.                                |
| `meetingUrl`      | string  | Link to the recording in the Sales Ask app.                       |
| `process`         | string  | Process Q\&A and summary text.                                    |
| `processFollowed` | integer | Count of process questions answered yes.                          |
| `processMissed`   | integer | Count of process questions not answered yes.                      |
| `processTotal`    | integer | Total process questions.                                          |

Custom fields from the recording are merged at the top level of `data`.

### recording.processed

Fired after AI analysis completes. Only delivered to webhooks whose trigger matches the recording source (or trigger is set to `all`).

### recording.integration\_updated

Fired after a recording is synced to a CRM. The `data` payload is the same shape as `recording.processed`.

## Responding to events

Your endpoint must return a **2xx** status to acknowledge receipt. Sales Ask does not retry failed deliveries, so if your endpoint is down you will miss the event.

<Note>
  Requests time out after 10 seconds. Respond quickly and offload heavy work to a background job.
</Note>

## List webhooks

Returns all webhook URLs registered for your organization (configured in Sales Ask).

```bash theme={null}
curl https://integrations.salesask.com/v1/webhooks \
  -H "x-api-key: <YOUR_API_KEY>"
```

Response includes `id`, `url`, `active`, `trigger`, and `events` for each webhook.

## Send a test webhook

POST a test payload to a URL using a recording you provide. The recording must have `status: "processed"` (e.g. from `GET /v1/recordings` or `GET /v1/recordings/:id`).

```bash theme={null}
curl -X POST https://integrations.salesask.com/v1/webhooks/test \
  -H "x-api-key: <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-crm.com/hooks/salesask",
    "recording": { "id": "rec_123", "status": "processed", ... }
  }'
```

The payload sent to `url` is the same shape as the outbound webhook payload above (integration format). Use this to verify your endpoint without waiting for a real processing event.
