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

# Create Webhook

> Creates a new webhook endpoint for the authenticated partner

## Request Body

<ParamField body="url" type="string" required>
  HTTPS URL where webhook events will be sent
</ParamField>

<ParamField body="filterTypes" type="array">
  List of event types to subscribe to (empty means all events)
</ParamField>

<ParamField body="description" type="string">
  Description of the webhook endpoint
</ParamField>

<ParamField body="secret" type="string">
  Base64 encoded secret for webhook signatures (optional, will be generated if not provided)
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "url": "https://example.com/webhook",
    "filterTypes": ["shipment.created", "shipment.address.updated", "pickup.completed"],
    "description": "Production webhook endpoint"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "ep_2KtRQ8fTStWPKrXP",
    "url": "https://example.com/webhook",
    "filterTypes": ["shipment.created", "shipment.address.updated", "pickup.completed"],
    "active": true,
    "created_at": "2024-01-15T10:00:00Z",
    "description": "Production webhook endpoint",
    "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
  }
  ```
</ResponseExample>

<Note>
  The webhook secret is only returned during creation. Store it securely as it won't be retrievable later.
</Note>

## Response Fields

<ResponseField name="id" type="string">
  Unique identifier for the webhook endpoint
</ResponseField>

<ResponseField name="url" type="string">
  HTTPS URL where webhook events are sent
</ResponseField>

<ResponseField name="filterTypes" type="array">
  Event types this endpoint is subscribed to
</ResponseField>

<ResponseField name="active" type="boolean">
  Whether the endpoint is active (always `true` on creation)
</ResponseField>

<ResponseField name="created_at" type="string">
  When the endpoint was created (ISO 8601 format)
</ResponseField>

<ResponseField name="description" type="string">
  Description of the webhook endpoint
</ResponseField>

<ResponseField name="secret" type="string">
  Webhook signing secret (only shown during creation)
</ResponseField>
