ReferenceSDKClient
Webhooks
SDK reference for webhooks — Create and manage webhook endpoints that can trigger graph executions.
Create and manage webhook endpoints that can trigger graph executions.
createWebhook
Create a new webhook that can trigger graphs. The optional "schema" parameter defines the webhook's expected JSON Schema for input data.
POST
Usage:
const result = await swirls.client.webhooks.createWebhook({
projectId: '...',
name: '...',
label: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | No | |
projectId | string | Yes | |
folderId | string | null | No | |
name | string | Yes | |
label | string | Yes | |
description | string | No | |
schema | object | No | |
enabled | boolean | No |
Output:
| Field | Type | Description |
|---|---|---|
id | string |
getWebhook
Get a webhook by ID
GET
Usage:
const result = await swirls.client.webhooks.getWebhook({
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
projectId | string | |
folderId | string | null | |
name | string | |
label | string | |
description | string | null | |
schema | object | null | |
enabled | boolean | |
createdAt | unknown | |
orgId | string | null | |
userId | string |
updateWebhook
Update a webhook. The "schema" parameter defines the webhook's expected JSON Schema for input data.
PUT
Usage:
const result = await swirls.client.webhooks.updateWebhook({
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | No | |
description | string | No | |
schema | object | null | No | |
enabled | boolean | No | |
folderId | string | null | No |
Output:
| Field | Type | Description |
|---|---|---|
id | string | |
projectId | string | |
folderId | string | null | |
name | string | |
label | string | |
description | string | null | |
schema | object | null | |
enabled | boolean | |
createdAt | unknown | |
orgId | string | null | |
userId | string |
deleteWebhook
Delete a webhook
DELETE
Usage:
const result = await swirls.client.webhooks.deleteWebhook({
id: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
listWebhooks
List all webhooks in a project
GET
Usage:
const result = await swirls.client.webhooks.listWebhooks({
projectId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | |
folderId | string | null | No | |
pagination | object | No |
Output:
| Field | Type | Description |
|---|---|---|
pagination | object | |
results | object[] | |
totalCount | number |
listTriggersForWebhook
GET
Usage:
const result = await swirls.client.webhooks.listTriggersForWebhook({
webhookId: '...',
})Input:
| Parameter | Type | Required | Description |
|---|---|---|---|
webhookId | string | Yes | |
pagination | object | No |
Output:
| Field | Type | Description |
|---|---|---|
pagination | object | |
results | object[] | |
totalCount | number |