Create a webhook
post
https://api.complycube.com
/v1/webhooks
Create a webhook
Creates a new webhook. Returns the webhook endpoint object with the
secret
field populated.
You can create up to a maximum of 20 webhooks.Parameters
Header
Content-Type*
string
The content-type must always be set to
application/json
.Authorization*
string
The live or sandbox API key.
Body
url*
string
The URL of the webhook endpoint.
enabled*
boolean
Determines whether the webhook should be active.
events*
array
The list of event types to which the endpoint is subscribed for.
description
string
A description of what the webhook is used for.
Responses
200
Webhook successfully created.
400
An example of a Bad Request response, when an invalid event type is provided.
cURL
Node.js
Python
PHP
.NET
curl -X POST https://api.complycube.com/v1/webhooks \
-H 'Authorization: <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"description": "This is my webhook, I like it a lot",
"url": "https://yoursite.com/my/webhook/endpoint",
"enabled": true,
"events": [
"check.pending",
"check.completed"
]
}'
const { ComplyCube } = require("@complycube/api");
const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });
const webhook = await complycube.webhook.create({
description: "This is my webhook, I like it a lot",
url: "https://yoursite.com/my/webhook/endpoint",
enabled: true,
events: [
"check.pending",
"check.completed"
]
});
from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')
my_hook = {
'description': 'This is my webhook, I like it a lot',
'url': 'https://yoursite.com/my/webhook/endpoint',
'enabled': True,
'events': ['check.pending','check.completed']
}
webhook = cc_api.webhooks.create(**my_hook)
use ComplyCube\ComplyCubeClient;
$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');
$webhook = $ccapi->webhooks()->create([
description => 'This is my webhook, I like it a lot',
url => 'https://yoursite.com/my/webhook/endpoint',
enabled => true,
events => [ 'check.pending','check.completed']
]);
using ComplyCube.Net;
using ComplyCube.Net.Resources.Webhooks;
var webhookApi = new WebhookApi(new ComplyCubeClient("<YOUR_API_KEY>"));
var webhookRequest = new WebhookRequest {
url = "https://yoursite.com/my/webhook/endpoint",
description = "This is my webhook, I like it a lot",
enabled = true,
events = new string[] {"check.completed",
"check.pending"}
};
var webhook = await webhookApi.CreateAsync(webhookRequest);
Last modified 5mo ago