---
title: "Create a campaign-specific webhook subscription."
method: POST
path: "/campaigns/{campaignId}/webhooks"
tags: ["Webhooks"]
---

# Create a campaign-specific webhook subscription.

`POST /campaigns/{campaignId}/webhooks`

## Request

- Base URL: `https://api.pitchlane.com/api/public/v1`
- URL: `https://api.pitchlane.com/api/public/v1/campaigns/{campaignId}/webhooks`
- Auth: API key in header `X-API-Key`

Notify the specified URL when a video event occurs. For general (not specific to one campaign) webhooks, use the /webhooks endpoint.

## Path parameters

- `campaignId` string

## Request body

- object
  - `webhookUrl` string: The URL to send the webhook to when the event occurs.
  - `campaignId` string: The unique identifier of the campaign.
  - `trigger` 'VIDEO_RENDERED' | 'VIDEO_CREATED' | 'VIDEO_VIEWED' | 'VIDEO_FIRST_VIEWED' | 'VIDEO_STARTED' | 'VIDEO_FIRST_STARTED' | 'VIDEO_FINISHED' | 'VIDEO_FIRST_FINISHED' | 'VIDEO_RENDERED_FULLY' | 'VIDEO_UNRENDERABLE': The video event that will trigger the webhook. VIDEO_RENDERED_FULLY is for when all optimisations for the video have been made, however you probably don't need this webhook; you should use VIDEO_RENDERED instead. VIDEO_UNRENDERABLE is triggered when a video cannot be rendered - either due to the website or lead being invalid or our bot unable to access it. Not all errors trigger this webhook - Unexpected/Internal Errors do not, so they can be fixed and retried by our team.

## Response `200`

The webhook was successfully created.

- object: Information about the webhook created.
  - `trigger` 'VIDEO_RENDERED' | 'VIDEO_CREATED' | 'VIDEO_VIEWED' | 'VIDEO_FIRST_VIEWED' | 'VIDEO_STARTED' | 'VIDEO_FIRST_STARTED' | 'VIDEO_FINISHED' | 'VIDEO_FIRST_FINISHED' | 'VIDEO_RENDERED_FULLY' | 'VIDEO_UNRENDERABLE': The video event that will trigger the webhook. VIDEO_RENDERED_FULLY is for when all optimisations for the video have been made, however you probably don't need this webhook; you should use VIDEO_RENDERED instead. VIDEO_UNRENDERABLE is triggered when a video cannot be rendered - either due to the website or lead being invalid or our bot unable to access it. Not all errors trigger this webhook - Unexpected/Internal Errors do not, so they can be fixed and retried by our team.
  - `webhookUrl` string: The URL the webhook will be sent to when the trigger occurs.
  - `id` string: The ID of the webhook created.

## Other responses

- `400`: Invalid input data
- `404`: Campaign not found.

---

[API](https://skmtc.dev/pitchlane/apis/pitchlane-api.md) · [All operations](https://skmtc.dev/pitchlane/apis/pitchlane-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pitchlane/apis/pitchlane-api/revisions/a8d831473a5c?raw)
