Avnology ID
API ReferenceWebhooks

Create Webhook

Subscribe to events by creating a webhook endpoint with event type filters and signing secret.

Endpoint

POST /v1/webhooks

Base URL: https://api-id.avnology.net

Authentication: API Key or OAuth token with admin:webhooks:write scope

Request

curl -X POST https://api-id.avnology.net/v1/webhooks \
  -H








FieldTypeRequiredDescription
urlstringYesHTTPS destination URL for webhook deliveries
eventsstring[]YesEvent types to subscribe to (see Events)
descriptionstringNoHuman-readable description
activebooleanNoWhether the webhook is active (default: true)
organization_idstringNoScope webhook to an organization
custom_headersobjectNoCustom HTTP headers included with each delivery

Response

Success (201 Created)

{
  "id": "whk_9f8e7d6c-5b4a-3c2d-1e0f-9a8b7c6d5e4f",
  "url": "https://api.acme.com/webhooks/avnology",
  "events": ["user.created", "user.updated", "user.deleted", "session.created"],
  "secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "active": true,
  "description": "Sync user changes to our CRM",
  "organization_id": 

Important: The secret field is the HMAC-SHA256 signing secret. It is only returned on creation and rotation. Store it securely to verify webhook signatures.

Errors

StatusCodeDescription
400AVNOLOGY_AUTH_902Invalid URL or event types
403AVNOLOGY_AUTH_100Insufficient permissions

Code Examples

JavaScript (fetch)

async function createWebhook(apiKey, url, events) {
  return fetch('https://api-id.avnology.net/v1/webhooks', {
    method: 'POST',
    headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' },


Python (httpx)

import httpx

def create_webhook(api_key: str, url: str, events: list[str]) -> dict:
    return httpx.post("https://api-id.avnology.net/v1/webhooks",
        headers={"Authorization"

Go (net/http)

func createWebhook(ctx context.Context, apiKey, webhookURL string, events []string) (*Webhook, error) {