# Create a webhook endpoint (/docs/api-reference/webhooks/create)

> Subscribes an HTTPS URL to document events in the API key's mode.

`POST https://druckling-nine.vercel.app/v1/webhook_endpoints`

Subscribes an HTTPS URL to document events in the API key's mode. The signing `secret` is returned only here. Requests follow the Standard Webhooks spec (`webhook-id`, `webhook-timestamp`, `webhook-signature`). Needs a full-access key.

## Request body (JSON Schema)

```json
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "maxLength": 2048,
      "description": "Public https:// URL that answers 2xx within 10 seconds."
    },
    "events": {
      "type": "array",
      "minItems": 1,
      "items": {
        "enum": [
          "document.rendered",
          "document.failed",
          "document.expired",
          "batch.completed",
          "document.delivered",
          "document.delivery_failed",
          "workflow.run_succeeded",
          "workflow.run_failed"
        ],
        "type": "string",
        "description": "`batch.completed` is sent once per batch when it reaches a final status (`completed`, `failed` or `canceled`); `data` is the batch. `document.delivered` and `document.delivery_failed` follow a document's copy to your own bucket (`data.storage`); a failure is sent once retries are used up. `workflow.run_succeeded` and `workflow.run_failed` are sent when a workflow run finishes; `data` is the run with each step's outcome."
      }
    },
    "description": {
      "type": "string",
      "maxLength": 200
    }
  },
  "required": [
    "url",
    "events"
  ]
}
```

## Response 201: OK

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "object": {
      "const": "webhook_endpoint"
    },
    "url": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "enum": [
          "document.rendered",
          "document.failed",
          "document.expired",
          "batch.completed",
          "document.delivered",
          "document.delivery_failed",
          "workflow.run_succeeded",
          "workflow.run_failed"
        ],
        "type": "string",
        "description": "`batch.completed` is sent once per batch when it reaches a final status (`completed`, `failed` or `canceled`); `data` is the batch. `document.delivered` and `document.delivery_failed` follow a document's copy to your own bucket (`data.storage`); a failure is sent once retries are used up. `workflow.run_succeeded` and `workflow.run_failed` are sent when a workflow run finishes; `data` is the run with each step's outcome."
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "test_mode": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "secret": {
      "type": "string",
      "description": "whsec_… signing secret; store it now."
    }
  },
  "required": [
    "id",
    "object",
    "url",
    "description",
    "events",
    "enabled",
    "test_mode",
    "created_at",
    "secret"
  ]
}
```