Webhook API Documentation

Base URL

https://crypto-api.yativo.com/api/webhook

Authentication

All endpoints require authentication unless specified otherwise. Authentication should be provided via an authorization header with a valid token.

Endpoints

Create Webhook

Creates a new webhook subscription that will receive event notifications.

URL: /create-webhook

Method: POST

Auth Required: Yes

Request Body

{
  "account_id": "acc_12345",
  "webhook_name": "Transaction Notifications",
  "webhook_url": "<https://example.com/webhook-receiver>",
  "webhook_secret": "optional_secret_or_auto_generated",
  "subscribed_events": ["transaction.created", "transaction.completed"],
  "version_id": "v1",
  "whitelist_ips": ["192.168.1.1", "10.0.0.1"],
  "max_retries": 3,
  "receive_all_events": false
}
Field Name Type Description Required
account_id String Account identifier Yes
webhook_name String Descriptive name for the webhook Yes
webhook_url String URL that will receive webhook events (must use HTTP/HTTPS) Yes
webhook_secret String Secret used for signing payloads (auto-generated if not provided) No
subscribed_events Array List of event slugs to subscribe to No
version_id String API version identifier No
whitelist_ips Array IP addresses allowed to receive webhooks No
max_retries Number Maximum delivery retry attempts (default: 3) No
receive_all_events Boolean Whether to receive all events regardless of subscriptions No

Success Response

Code: 200 OK

{
  "data": {
    "_id": "61f2d5a83e67b2a4f2c77e9a",
    "user_id": "usr_67890",
    "account_id": "acc_12345",
    "webhook_name": "Transaction Notifications",
    "webhook_url": "<https://example.com/webhook-receiver>",
    "webhook_secret": "your_generated_or_provided_secret",
    "version_id": "v1",
    "subscribed_events": ["transaction.created", "transaction.completed"],
    "whitelist_ips": ["192.168.1.1", "10.0.0.1"],
    "max_retries": 3,
    "status": "active",
    "receive_all_events": false,
    "createdAt": "2025-03-30T12:00:00.000Z",
    "updatedAt": "2025-03-30T12:00:00.000Z"
  },
  "status": true,
  "message": "Webhook created successfully"
}

Error Responses

Code: 400 Bad Request

{
  "status": false,
  "message": "Invalid webhook URL"
}