Skip to content

POST /v1/projects/{projectId}/webhooks/destinations

Creates a webhook destination for the selected project using its URL, payload API version, event selection and other documented settings. The response includes the signing secret, which is returned only in this response and in idempotent replays of it, never by destination reads; store it securely for signature verification. The API version must be selectable and selected event types must belong to that version's catalog. Supply the required Idempotency-Key header.

photon.projects.createWebhookDestination(input: CreateWebhookDestinationInput, options?: RequestOptions): Promise<CreateWebhookDestinationOutput>
import { Photon } from "@photon-ai/api";

const photon = new Photon({
  headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.createWebhookDestination({
  path: {
    projectId: "projectId",
  },
  headers: {
    idempotencyKey: "idempotencyKey",
  },
  body: {
    apiVersion: "2026-01-01",
    enabledEvents: [],
    name: "name",
    url: "https://example.com",
  },
});
{
  "destination": {
    "apiVersion": "2026-01-01",
    "createdAt": "2026-01-01T00:00:00.000Z",
    "deletedAt": null,
    "description": null,
    "destinationId": "string",
    "enabledEvents": [
      null
    ],
    "name": "string",
    "projectId": "string",
    "status": "enabled",
    "updatedAt": "2026-01-01T00:00:00.000Z",
    "url": "https://example.com"
  },
  "signingSecret": "string"
}

Parameters

Photon-VersionPhotonVersion

Selects the API contract date. Without it, the request is served as 2026-07-01.

Idempotency-Keystringrequired

Identifies one logical mutation across retries.

projectIdstringrequired

Body

apiVersionstring (date)required
descriptionstring
enabledEventsWebhookEventSelectionrequired
namestringrequired
statusWebhookDestinationStatus
urlstring (uri)required

HTTPS URL without credentials or a fragment.

Returns

201 The created destination and its signing secret. CreateWebhookDestinationResponse

Headers: Photon-Version. The raw response carries these headers; see Raw responses.

destinationWebhookDestinationrequired
signingSecretstringrequired