---
title: "Create an organization webhook endpoint"
description: "Register an https URL that receives the events of every workspace in the organization, closed ones included while they exist, for the event types it subscribes to (as on POST /webhooks). `POST /api/v1/organizations/{id}/webhooks`"
url: https://www.unitpost.com/docs/platform/post-organizations-id-webhooks
section: "Platform API reference"
updated: 2026-11-17
---
# Create an organization webhook endpoint

`POST /api/v1/organizations/{id}/webhooks`

Register an `https` URL that receives the events of every workspace in the organization, closed ones included while they exist, for the event types it subscribes to (as on `POST /webhooks`). Workspaces' own endpoints keep receiving theirs: an event goes to each matching endpoint of either kind. Each delivery's envelope names the workspace the event happened in (`workspace_id`) and that workspace's `external_id` as it is when the delivery is made (null when it has none); a workspace endpoint's envelope has no `external_id`. The response includes the `signing_secret` exactly once. Names and URLs are unique in the organization. At most 5 endpoints per organization: the next create is a 422 and creates nothing. One endpoint already receives every workspace's events, so add event types to an existing endpoint (update its `events`) instead of adding endpoints. Takes an organization key (`ok_live_…`) with `organizations:write`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The organization's id (`org_…`), from `GET /whoami` or Organization → API. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | yes | — |
| `events` | enum \| string[] | yes | — |
| `name` | string | no | — |
| `include_text` | boolean | no | `email.received` deliveries to this endpoint also carry the message's plain-text body as `text`, at most 64 KB (`text_truncated` says it was cut). Null for a copy of one of your own sends (`sent_by_us`), a message deleted since, or one with no plain-text part. Default false: metadata only. The text is read when each delivery is sent and is never kept with the event, so the deliveries log doesn't show it. |

## Response fields (201)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `id` | string | yes | — |
| `name` | string | yes | — |
| `url` | string | yes | — |
| `events` | enum \| string[] | yes | — |
| `status` | enum | yes | One of: `enabled`, `disabled`, `suspended`. |
| `include_text` | boolean | no | `email.received` deliveries to this endpoint also carry the message's plain-text body as `text`, at most 64 KB (`text_truncated` says it was cut). Null for a copy of one of your own sends (`sent_by_us`), a message deleted since, or one with no plain-text part. Default false: metadata only. The text is read when each delivery is sent and is never kept with the event, so the deliveries log doesn't show it. |
| `created_at` | string | yes | — |
| `updated_at` | string | yes | — |
| `backlog` | object | no | The deliveries a flush would send. Each count stops at 10,001, which means more than 10,000. Only on `GET /webhooks/{id}`. |
| `signing_secret` | string | yes | The HMAC signing secret. Shown exactly once — store it now; it can never be retrieved again. Use it to verify the signature on every delivery to this endpoint. |

## Responses

| Status | Description |
| --- | --- |
| 201 | Created — includes the one-time signing secret. |
| 401 | Missing or invalid organization key (a workspace key is refused). |
| 403 | API access not approved for the organization, the key lacks the capability, or no User-Agent. |
| 404 | Not this key's organization, or not one of its webhook endpoints (a workspace's endpoint is a 404 here). |
| 409 | That URL or name is already used by another of the organization's endpoints. |
| 422 | Validation error (bad URL, unknown event, an event category not yet available such as `sms.*`, a key the body doesn't take), or the organization already has 5 endpoints (nothing was created). |
| 429 | The organization's rate limit. |

## Example request

```bash
curl -X POST 'https://www.unitpost.com/api/v1/organizations/org_123/webhooks' \
  -H 'Authorization: Bearer YOUR_ORG_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example.com/webhooks/unitpost",
    "events": [
      "email.delivered",
      "email.bounced"
    ]
  }'
```

## Example response (201)

```json
{
  "object": "webhook",
  "id": "id_123",
  "name": "Example",
  "url": "https://example.com",
  "events": [
    "email.sent"
  ],
  "status": "enabled",
  "include_text": false,
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "backlog": {
    "queued": 0,
    "failed": 0
  },
  "signing_secret": "string"
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/platform/post-organizations-id-webhooks
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
