SWIRLS_
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:

ParameterTypeRequiredDescription
idstringNo
projectIdstringYes
folderIdstring | nullNo
namestringYes
labelstringYes
descriptionstringNo
schemaobjectNo
enabledbooleanNo

Output:

FieldTypeDescription
idstring

getWebhook

Get a webhook by ID

GET

Usage:

const result = await swirls.client.webhooks.getWebhook({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

Output:

FieldTypeDescription
idstring
projectIdstring
folderIdstring | null
namestring
labelstring
descriptionstring | null
schemaobject | null
enabledboolean
createdAtunknown
orgIdstring | null
userIdstring

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:

ParameterTypeRequiredDescription
idstringYes
namestringNo
descriptionstringNo
schemaobject | nullNo
enabledbooleanNo
folderIdstring | nullNo

Output:

FieldTypeDescription
idstring
projectIdstring
folderIdstring | null
namestring
labelstring
descriptionstring | null
schemaobject | null
enabledboolean
createdAtunknown
orgIdstring | null
userIdstring

deleteWebhook

Delete a webhook

DELETE

Usage:

const result = await swirls.client.webhooks.deleteWebhook({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

listWebhooks

List all webhooks in a project

GET

Usage:

const result = await swirls.client.webhooks.listWebhooks({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
folderIdstring | nullNo
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

listTriggersForWebhook

GET

Usage:

const result = await swirls.client.webhooks.listTriggersForWebhook({
  webhookId: '...',
})

Input:

ParameterTypeRequiredDescription
webhookIdstringYes
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

On this page