Create webhook subscriptions
curl --request POST \
--url https://api.anchorage-staging.com/v2/webhook/endpoints/{endpointId}/subscriptions \
--header 'Api-Access-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"eventTypeId": "<string>"
}
]
'import requests
url = "https://api.anchorage-staging.com/v2/webhook/endpoints/{endpointId}/subscriptions"
payload = [{ "eventTypeId": "<string>" }]
headers = {
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{eventTypeId: '<string>'}])
};
fetch('https://api.anchorage-staging.com/v2/webhook/endpoints/{endpointId}/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Permissions required: Configure Webhooks
Subscribe to event types to receive notifications in a webhook endpoint.
POST
/
webhook
/
endpoints
/
{endpointId}
/
subscriptions
Create webhook subscriptions
curl --request POST \
--url https://api.anchorage-staging.com/v2/webhook/endpoints/{endpointId}/subscriptions \
--header 'Api-Access-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"eventTypeId": "<string>"
}
]
'import requests
url = "https://api.anchorage-staging.com/v2/webhook/endpoints/{endpointId}/subscriptions"
payload = [{ "eventTypeId": "<string>" }]
headers = {
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{eventTypeId: '<string>'}])
};
fetch('https://api.anchorage-staging.com/v2/webhook/endpoints/{endpointId}/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Authorizations
An API key associated with a security role
Path Parameters
Unique identifier for the endpoint
Minimum string length:
1Body
application/json
Response
Successfully created webhook subscription
The response is of type CreateWebhookSubscriptionsResponse · object.
Was this page helpful?