> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.videogen.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.videogen.io/_mcp/server.

# Create webhook

POST https://api.videogen.io/v1/webhooks/endpoints
Content-Type: application/json

Register a new webhook endpoint to receive `tool_execution.*`, `workflow_run.*`, and `file.*` events. The signing secret is only returned in this response. Store it securely.

Reference: https://docs.videogen.io/rest-api-reference/webhooks/create-webhook-endpoint

## Authentication

- `Authorization` header (bearer token, required) — API key from [app.videogen.io/api](https://app.videogen.io/api). The full key is only shown once when you create it.

## Request

### Body (application/json)

This endpoint expects a CreateWebhookEndpointRequest.

- `url` (string, required) — HTTPS URL that will receive webhook POST requests.
- `events` (list of enum, required) — Webhook event names to subscribe to. Must contain at least one event.
  - Allowed values: `tool_execution.succeeded`, `tool_execution.failed`, `tool_execution.cancelled`, `workflow_run.succeeded`, `workflow_run.failed`, `workflow_run.cancelled`, `project_export.succeeded`, `project_export.failed`, `project_export.cancelled`, `assistant_message.succeeded`, `assistant_message.failed`, `assistant_message.cancelled`, `file.upload.completed`, `file.upload.failed`, `file.playback_ready`, `file.download_ready`, `file.analysis_completed`, `file.analysis_failed`
- `description` (string, optional, nullable)

## Response

### 201

Created; `signingSecret` is only returned in this response.

- `endpointId` (string, required) — Webhook endpoint id (e.g. `ep_...`).
- `url` (string, required)
- `events` (list of enum, required)
  - Allowed values: `tool_execution.succeeded`, `tool_execution.failed`, `tool_execution.cancelled`, `workflow_run.succeeded`, `workflow_run.failed`, `workflow_run.cancelled`, `project_export.succeeded`, `project_export.failed`, `project_export.cancelled`, `assistant_message.succeeded`, `assistant_message.failed`, `assistant_message.cancelled`, `file.upload.completed`, `file.upload.failed`, `file.playback_ready`, `file.download_ready`, `file.analysis_completed`, `file.analysis_failed`
- `createdAt` (integer, required) — Seconds since epoch (Unix timestamp) when the endpoint was created.
- `description` (string, optional, nullable)
- `signingSecret` (string, optional) — HMAC secret for verifying [Standard Webhooks](https://www.standardwebhooks.com/) signatures. Only returned once on create; store it securely.
- `signingSecretLast4` (string, optional) — Last four characters of the signing secret, for display purposes.

## Examples

**Request**

```json
{
  "url": "https://webhooks.myapp.com/videogen",
  "events": [
    "tool_execution.succeeded",
    "tool_execution.failed"
  ]
}
```

**Response**

```json
{
  "endpointId": "ep_31QmZ8rT2vK5nL7sB4pR9cD1fH",
  "url": "https://webhooks.myapp.com/videogen",
  "events": [
    "tool_execution.succeeded",
    "tool_execution.failed"
  ],
  "createdAt": 1705308600,
  "description": "Webhook endpoint for receiving VideoGen tool execution results",
  "signingSecret": "a1b2c3d4e5f67890abcdef1234567890",
  "signingSecretLast4": "7890"
}
```

**SDK Code**

```typescript
import { VideoGen } from "@videogen/sdk";

const client = new VideoGen({ apiKey: "sk_videogen_live_..." });

await client.webhooks.createWebhookEndpoint({
  url: "https://webhooks.myapp.com/videogen",
  events: [
    "tool_execution.succeeded",
    "tool_execution.failed",
  ],
});
```

```python
from videogen import VideoGen

client = VideoGen(api_key="sk_videogen_live_...")

client.webhooks.create_webhook_endpoint(
    url="https://webhooks.myapp.com/videogen",
    events=[
      "tool_execution.succeeded",
      "tool_execution.failed",
    ],
)
```