Create webhook endpoint
curl --request POST \
--url https://api.anchorage-staging.com/v2/webhook/endpoints \
--header 'Api-Access-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"url": "https://your-domain.com/transaction-webhooks",
"description": "Endpoint for receiving transaction event webhooks",
"subscriptions": [
{
"eventTypeId": "withdrawal.initiated"
}
],
"publicKey": "----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeg+pxTCsjew/+7IK4+Vw5zyHDnMW7bzn\nsClhuYIKjXF8EJ1lfyZC2VPVullBKgvHRzNMfC1KkF2LIoRp2ibcWQ==\n-----END PUBLIC KEY-----"
}
]
'import requests
url = "https://api.anchorage-staging.com/v2/webhook/endpoints"
payload = [
{
"url": "https://your-domain.com/transaction-webhooks",
"description": "Endpoint for receiving transaction event webhooks",
"subscriptions": [{ "eventTypeId": "withdrawal.initiated" }],
"publicKey": "----BEGIN PUBLIC KEY-----
MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeg+pxTCsjew/+7IK4+Vw5zyHDnMW7bzn
sClhuYIKjXF8EJ1lfyZC2VPVullBKgvHRzNMfC1KkF2LIoRp2ibcWQ==
-----END PUBLIC KEY-----"
}
]
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([
{
url: 'https://your-domain.com/transaction-webhooks',
description: 'Endpoint for receiving transaction event webhooks',
subscriptions: [{eventTypeId: 'withdrawal.initiated'}],
publicKey: '----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeg+pxTCsjew/+7IK4+Vw5zyHDnMW7bzn\nsClhuYIKjXF8EJ1lfyZC2VPVullBKgvHRzNMfC1KkF2LIoRp2ibcWQ==\n-----END PUBLIC KEY-----'
}
])
};
fetch('https://api.anchorage-staging.com/v2/webhook/endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}Permissions required: Configure Webhooks
Create a new endpoint where you would like to receive webhook notifications.
POST
/
webhook
/
endpoints
Create webhook endpoint
curl --request POST \
--url https://api.anchorage-staging.com/v2/webhook/endpoints \
--header 'Api-Access-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"url": "https://your-domain.com/transaction-webhooks",
"description": "Endpoint for receiving transaction event webhooks",
"subscriptions": [
{
"eventTypeId": "withdrawal.initiated"
}
],
"publicKey": "----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeg+pxTCsjew/+7IK4+Vw5zyHDnMW7bzn\nsClhuYIKjXF8EJ1lfyZC2VPVullBKgvHRzNMfC1KkF2LIoRp2ibcWQ==\n-----END PUBLIC KEY-----"
}
]
'import requests
url = "https://api.anchorage-staging.com/v2/webhook/endpoints"
payload = [
{
"url": "https://your-domain.com/transaction-webhooks",
"description": "Endpoint for receiving transaction event webhooks",
"subscriptions": [{ "eventTypeId": "withdrawal.initiated" }],
"publicKey": "----BEGIN PUBLIC KEY-----
MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeg+pxTCsjew/+7IK4+Vw5zyHDnMW7bzn
sClhuYIKjXF8EJ1lfyZC2VPVullBKgvHRzNMfC1KkF2LIoRp2ibcWQ==
-----END PUBLIC KEY-----"
}
]
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([
{
url: 'https://your-domain.com/transaction-webhooks',
description: 'Endpoint for receiving transaction event webhooks',
subscriptions: [{eventTypeId: 'withdrawal.initiated'}],
publicKey: '----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEeg+pxTCsjew/+7IK4+Vw5zyHDnMW7bzn\nsClhuYIKjXF8EJ1lfyZC2VPVullBKgvHRzNMfC1KkF2LIoRp2ibcWQ==\n-----END PUBLIC KEY-----'
}
])
};
fetch('https://api.anchorage-staging.com/v2/webhook/endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}Authorizations
An API key associated with a security role
Body
application/json
Response
Created webhook endpoint ids
Was this page helpful?
⌘I