# Create a webhook subscription

> 🔐 **Required role:** `EVNT_SUB`
📖 **Data dictionary:** [Event subscription](/reference/data-dictionary/event-subscription)

**Create a webhook subscription for entity events**
Subscribe to receive webhook notifications when entities are created, updated, or deleted.
The webhook URL must use HTTPS and will receive POST requests with event data.
**Business Applications:**
- Real-time integrations
- Event-driven workflows
- System synchronization

Endpoint: POST /api/v1/event-subscriptions
Version: 1.0.0
Security: BearerAuth, CfAccessClientId, CfAccessClientSecret

## Security:

  - `BearerAuth` (unknown)
    http bearer JWT

  - `CfAccessClientId` (unknown)
    apiKey in header CF-Access-Client-Id

  - `CfAccessClientSecret` (unknown)
    apiKey in header CF-Access-Client-Secret

## Request fields (application/json):

  - `entityType` (string, required)
    Entity of the event, as the `entity` value of an enabled catalog entry
(`GET /api/v1/event-subscriptions/catalog`).
    Example: RequestItem

  - `operation` (string, required)
    Operation of the event, as the `operation` value of the same catalog entry.
    Enum: "CREATED", "UPDATED", "DELETED", "SIGNED", "EXECUTED", "CANCELLED", "FAILED", "POSTED", "APPROVED", "REJECTED", "COMPLETED", "SENT", "VIEWED", "NOTIFIED", "MARK_FINISHED", "UNDO", "MARK_NA", "FILE_UPLOADED", "FILE_DELETED", "FILE_REPLACED", "FILE_FLAGGED", "FILE_ATTACHED", "FILE_REMOVED", "COMMENT_ADDED", "DUE_DATE_ADDED", "DUE_DATE_CHANGED", "ASSIGNEE_ADDED", "ASSIGNEE_REMOVED", "REVIEWER_ADDED", "REVIEWER_REMOVED", "REVIEWER_CHANGED", "RESTRICTED", "REQUEST_REASSIGNED", "CONSENT_RECORDED"

  - `deliveryUrl` (string, required)
    Deliveryurl

  - `filterExpression` (string | null)
    Narrows what this subscription receives. Supported values: `ownPaymentLinksOnly` (only
payments made through quick payment links minted by the API user that owns this
subscription; links minted through the SafeSend application-key route have no minting
user and never match), `paymentLinkOnly` (payments made through any quick payment link of the
firm) and `allPayments` (every payment of the firm). The last two are accepted only while
the API user holds the `PYMT_EVNT_ALL` Product API role, and stop delivering if the firm
revokes it. Any other value is rejected with 400. Required for `Payment` subscriptions;
optional for other entity types, where omitting it means every event of the entity and
operation.
    Example: ownPaymentLinksOnly

  - `description` (string | null)
    Description

## Response 201:

  - `201` (unknown)
    Event Subscriptions created successfully

## Response 201 fields (application/json):

  - `data` (object)

  - `data.subscription` (object)
    Subscription

  - `data.webhookSecret` (string)
    The caller's webhook signing secret. It is the same secret for every subscription of the
caller and can be read again with `GET /api/v1/event-subscriptions/webhook/secret`.

  - `data.webhookSecretInstructions` (string)
    Fixed advisory text. It says the secret "will not be shown again"; the secret is in fact
also returned by `GET /api/v1/event-subscriptions/webhook/secret`.

  - `error` (object | null)

  - `meta` (object)

  - `meta.success` (boolean)

  - `meta.message` (string)

  - `meta.timestamp` (string)

  - `meta.version` (string)

## Response 400:

  - `400` (unknown)
    Invalid input data

## Response 401:

  - `401` (unknown)
    Unauthorized - Invalid or missing authentication token

## Response 403:

  - `403` (unknown)
    Forbidden - Insufficient permissions (requires EVNT_SUB)

## Response 500:

  - `500` (unknown)
    Internal server error

