Skip to content
torqee Developers
Esc
↑↓navigate↵open⌘Jpreview

Create a webhook endpoint

POST/api/v1/webhooks
Authorization
AuthorizationOAuth2 access token · headerrequired

OAuth 2.1 authorization code flow with PKCE. Audience must be the connect URL.

Scopes:torqee:webhooks:writetorqee:sessions:read
or
AuthorizationBearer token · headerrequired

Workspace API key issued from the torqee web app. Pass the torqee_-prefixed key as the bearer token. API keys carry the same read scopes as OAuth tokens.

Request body
requiredapplication/json
namestringrequired
min length 1 · max length 100
urlstring<uri>required
max length 2048
filtersobject[]required
min items 1 · max items 20
Show properties
Array of object
One of:
object
typestringrequired
sessionIdstring
min length 1
object
typestringrequired
sessionIdstring
min length 1
statusstring[]
min items 1
enabledboolean
Responses
201

Created endpoint

idstringrequired
min length 1
namestringrequired
min length 1
urlstring<uri>required
filtersobject[]required
min items 1 · max items 20
Show properties
Array of object
One of:
object
typestringrequired
sessionIdstring
min length 1
object
typestringrequired
sessionIdstring
min length 1
statusstring[]
min items 1
enabledbooleanrequired
createdAtstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
updatedAtstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
400

Invalid endpoint or filters

errorstringrequired
Allowed:invalid_request
401

Missing or invalid credentials

errorstringrequired
Allowed:unauthorized
403

Membership revoked or insufficient scope

errorstringrequired
Allowed:insufficient_scopeforbidden
404

Tenant database could not be resolved for the workspace

errorstringrequired
Allowed:workspace_not_found
500

Unexpected server error

errorstringrequired
Allowed:internal_server_error
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'https://connect.torqee.app/api/v1/webhooks' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "url": "http://example.com",
  "filters": [
    {
      "type": "session.created",
      "sessionId": "string"
    }
  ],
  "enabled": true
}'
Response
{
  "id": "string",
  "name": "string",
  "url": "http://example.com",
  "filters": [
    {
      "type": "session.created",
      "sessionId": "string"
    }
  ],
  "enabled": true,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}

Was this page helpful?