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

# Create a webhook

> Register an endpoint to receive generation/bulk job completion events

<ParamField header="Authorization" type="string" required>
  `Bearer {api_key}`
</ParamField>

## Body

<ParamField body="target_url" type="string" required>
  HTTPS URL that will receive `POST` requests for each event. See [Webhooks guide](/docs/guides/webhooks) for the full payload/signing format.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://dev-backend-ai.truefans.in/api/external/v1/webhooks/" \
    -H "Authorization: Bearer $TRUEFAN_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"target_url": "https://myapp.example.com/webhooks/truefan"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "webhook": {
      "endpoint_id": "9d2f1e0a-...",
      "target_url": "https://myapp.example.com/webhooks/truefan",
      "is_active": true,
      "created": "2026-08-21T10:00:00Z"
    },
    "secret": "b1946ac92492d2347c6235b4d2611184..."
  }
  ```
</ResponseExample>

<Warning>
  `secret` is returned **exactly once**, at creation — used to verify the HMAC signature on every delivery. It's never shown again after this response.
</Warning>
