Webhooks

Create Webhook

POST
/v1/webhooks

Authorization

headerx-api-key<token>

Workspace API key, sent in the x-api-key header. Keys start with op_ and are created in the dashboard.

Request Body

application/json
  1. body
name*string
Length1 <= length <= 120
url*string
Formaturi
Lengthlength <= 2048
secret?string
Length16 <= length <= 128
events*array<string>
Items1 <= items <= 31
enabled?boolean
Defaulttrue

Response Body

Created webhook. The signing secret is shown only in this response.

application/json
  1. response
webhook*
Example Request
import { Configuration, WebhooksApi } from "@onepostly/sdk";const webhooksApi = new WebhooksApi(  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY }));const response = await webhooksApi.createWebhook({  createWebhookBody: {    "name": "Post events",    "url": "https://example.com/hooks/onepostly",    "secret": "s7a9Kx2mQ8vB4nR6tY3wZ1pL5oN0uMf",    "events": [      "post.platform.published"    ],    "enabled": true  },});console.log(response);
Example Response
{  "webhook": {    "id": "dlv_1",    "name": "Post events",    "url": "https://example.com/hooks/onepostly",    "enabled": true,    "events": [      "post.platform.published"    ],    "secret": "s7a9Kx2mQ8vB4nR6tY3wZ1pL5oN0uMf"  }}