For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create a Webhook

Create a Webhook

post

This endpoint allows you to create a new Webhook.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
urlstringRequired

Encoded URL for the callback endpoint.

Responses
201

Returns the created Webhook

application/json
idstringRequired
urlstringRequired
walletAddressstringRequired
post/v2/webhooks
POST /v2/webhooks HTTP/1.1
Host: api.underdogprotocol.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 41

{
  "url": "text",
  "triggers": [
    "CLAIM_BADGE"
  ]
}
{
  "id": "text",
  "url": "text",
  "walletAddress": "text"
}

Example

curl --location 'https://dev.underdogprotocol.com/v2/webhooks' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https:/google.com",
    "triggers": []
}'
const axios = require('axios');
let data = JSON.stringify({
  "url": "https:/google.com",
  "triggers": []
});

let config = {
  method: 'post',
maxBodyLength: Infinity,
  url: 'https://dev.underdogprotocol.com/v2/webhooks',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

Last updated