POST /webhooks
Create a new webhook
Create a new webhook for the current account
Authentication Required
Authorization: Bearer {token}
header string This header is required to access this endpoint
Required Parameters
x-account-id
header string Account ID for the request
Request Body
{ "name": "string", "url": "string", "events": [ "string" ]}{ "name": "string", "url": "string", "description": "string", "active": true, "headers": {}, "events": [ "string" ]}Try it out
Loading...
Output:
Responses
Description
Webhook created successfully
{ "id": 0, "name": "string", "url": "string", "active": false, "description": "string", "headers": {}, "events": [ "string" ], "createdAt": "string", "updatedAt": "string", "createdBy": "string", "updatedBy": "string", "secret": "string"}Description
Bad Request - Invalid input parameters
Description
Unauthorized - User not authenticated
Description
Forbidden - User does not have the required permissions
Description
Internal server error
References
#/components/parameters/xAccountIdHeader#/components/schemas/WebhookInput#/components/schemas/Webhook#/components/schemas/WebhookWithSecret
#/components/parameters/xAccountIdHeader
in: headername: x-account-idschema: type: stringdescription: Account ID for the requestrequired: trueexample: "2311"|export type xAccountIdHeader = any; // Schema type not fully supported#/components/schemas/WebhookInput
type: objectproperties: name: type: string description: Name of the webhook url: type: string description: URL where webhook events will be sent description: type: string description: Description of the webhook active: type: boolean default: true description: Whether the webhook is active headers: type: object additionalProperties: type: string description: Custom headers to send with the webhook request events: type: array items: type: string description: List of events to subscribe torequired: - name - url - events|export interface WebhookInput { /** Name of the webhook */ name: string; /** URL where webhook events will be sent */ url: string; /** Description of the webhook */ description?: string; /** Whether the webhook is active */ active?: boolean; /** Custom headers to send with the webhook request */ headers?: Record<string, string>; /** List of events to subscribe to */ events: string[];}#/components/schemas/Webhook
type: objectproperties: id: type: integer readOnly: true name: type: string description: Name of the webhook url: type: string description: URL where webhook events will be sent active: type: boolean description: Whether the webhook is active description: type: string description: Description of the webhook headers: type: object additionalProperties: type: string description: Custom headers to send with the webhook request events: type: array items: type: string description: List of events the webhook is subscribed to createdAt: type: string format: date-time readOnly: true updatedAt: type: string format: date-time readOnly: true createdBy: type: string readOnly: true updatedBy: type: string readOnly: truerequired: - id - name - url - active - events|export interface Webhook { id: number; /** Name of the webhook */ name: string; /** URL where webhook events will be sent */ url: string; /** Whether the webhook is active */ active: boolean; /** Description of the webhook */ description?: string; /** Custom headers to send with the webhook request */ headers?: Record<string, string>; /** List of events the webhook is subscribed to */ events: string[]; createdAt?: Date; updatedAt?: Date; createdBy?: string; updatedBy?: string;}#/components/schemas/WebhookWithSecret
allOf: - type: object properties: id: type: integer readOnly: true name: type: string description: Name of the webhook url: type: string description: URL where webhook events will be sent active: type: boolean description: Whether the webhook is active description: type: string description: Description of the webhook headers: type: object additionalProperties: type: string description: Custom headers to send with the webhook request events: type: array items: type: string description: List of events the webhook is subscribed to createdAt: type: string format: date-time readOnly: true updatedAt: type: string format: date-time readOnly: true createdBy: type: string readOnly: true updatedBy: type: string readOnly: true required: - id - name - url - active - events fromRef: "#/components/schemas/Webhook" - properties: secret: type: string description: Secret key for signing webhook payloads. This is only returned once when the webhook is created.>export interface WebhookWithSecret_AllOf_0 { id: number; /** Name of the webhook */ name: string; /** URL where webhook events will be sent */ url: string; /** Whether the webhook is active */ active: boolean; /** Description of the webhook */ description?: string; /** Custom headers to send with the webhook request */ headers?: Record<string, string>; /** List of events the webhook is subscribed to */ events: string[]; createdAt?: Date; updatedAt?: Date; createdBy?: string; updatedBy?: string;}
export interface WebhookWithSecret_AllOf_1 { /** Secret key for signing webhook payloads. This is only returned once when the webhook is created. */ secret?: string;}
export type WebhookWithSecret = WebhookWithSecret_AllOf_0 & WebhookWithSecret_AllOf_1;Route Source Code
Check out the source code for this route entrypoint here: /webhooks/route.ts
Or the swagger.yaml spec this documentation was generated from:
/webhooks/swagger.yaml