Create
client.teams.webhookEndpoints.create(stringteamID, WebhookEndpointCreateParams { enabledEvents, url, description } body, RequestOptionsoptions?): WebhookEndpointCreateResponse { webhookEndpoint }
POST/teams/{teamId}/webhook-endpoints
Register a new webhook endpoint for the team, at most 10 of them. The response carries the secret, which is never returned again
Create
import Scenario from '@scenario-labs/sdk';
const client = new Scenario({
apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});
const webhookEndpoint = await client.teams.webhookEndpoints.create('teamId', {
enabledEvents: ['*'],
url: 'url',
});
console.log(webhookEndpoint.webhookEndpoint);{
"webhookEndpoint": {
"id": "id",
"createdAt": "createdAt",
"enabled": true,
"enabledEvents": [
"*"
],
"nbFailedCalls": 0,
"nbTotalCalls": 0,
"ownerId": "ownerId",
"ownerType": "project",
"secret": "secret",
"updatedAt": "updatedAt",
"url": "url",
"description": "description"
}
}Returns Examples
{
"webhookEndpoint": {
"id": "id",
"createdAt": "createdAt",
"enabled": true,
"enabledEvents": [
"*"
],
"nbFailedCalls": 0,
"nbTotalCalls": 0,
"ownerId": "ownerId",
"ownerType": "project",
"secret": "secret",
"updatedAt": "updatedAt",
"url": "url",
"description": "description"
}
}