WebhooksCreate webhook
Webhooks

Create webhook

Create a webhook subscription for link events. The webhook URL receives POST requests when the subscribed events occur (e.g., link clicked, link created, uptime alert).

curl -X POST "https://api.mythic-analytics.com/api/v1/links/webhooks" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "url": "https://api.acme-retail.com/webhooks/links",
  "events": [
    "link.clicked",
    "uptime.down"
  ],
  "secret": "example_string",
  "metadata": {}
}'
{
  "success": true,
  "data": {
    "id": "whk_7kH3nPqR",
    "url": "https://api.acme-retail.com/webhooks/links",
    "events": [
      "link.clicked",
      "uptime.down"
    ],
    "active": true,
    "metadata": {},
    "created_at": "2024-05-20T10:00:00.000Z"
  }
}
POST
/links/webhooks
POST
Security Scheme
Bearer Tokenstring
Required

Admin API key as bearer token. Format: Bearer YOUR_ADMIN_KEY

Admin API key as bearer token. Format: Bearer YOUR_ADMIN_KEY
Content-Typestring
Required

The media type of the request body

Options: application/json
urlstring
Required

Endpoint URL that receives webhook POST requests.

Format: uri
eventsarray
Required

Events to subscribe to.

secretstring

Optional secret for HMAC signature verification.

metadataobject

Arbitrary metadata attached to the webhook.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Admin API key as bearer token. Format: Bearer YOUR_ADMIN_KEY

Body

application/json
urlstring
Required

Endpoint URL that receives webhook POST requests.

eventsarray
Required

Events to subscribe to.

secretstring

Optional secret for HMAC signature verification.

metadataobject

Arbitrary metadata attached to the webhook.

Responses