Coinbax API

webhooks

View as Markdown

List webhook subscriptions

GET/api/v1/webhooksX-API-Key

Query parameters

  • isActivestringrequired
  • eventTypestringrequired

Responses

200List of webhook subscriptions

Response follows the unified success / data / meta / error envelope.

curl https://api-staging.coinbax.com/api/v1/webhooks?isActive=<isActive>&eventType=<eventType> \
  -H "X-API-Key: $COINBAX_API_KEY"
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks?isActive=<isActive>&eventType=<eventType>', {
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
  },
});
const result = await response.json();

Create webhook subscription

POST/api/v1/webhooksX-API-Key

Request body

  • urlstringrequired

    The URL to send webhook events to

  • eventTypesarray of stringrequired

    Event types to subscribe to

    array of string
    string
  • ipWhitelistarray of string

    Optional list of IP addresses allowed to send webhooks

    array of string
    string
  • metadataobject

    Optional metadata for the subscription

    object

    Optional metadata for the subscription

Responses

201Webhook subscription created successfully

Response follows the unified success / data / meta / error envelope.

400Invalid event types

Response follows the unified success / data / meta / error envelope.

401Unauthorized

Response follows the unified success / data / meta / error envelope.

curl -X POST https://api-staging.coinbax.com/api/v1/webhooks \
  -H "X-API-Key: $COINBAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://api.example.com/webhooks",
  "eventTypes": [
    "transaction.created",
    "transaction.completed"
  ],
  "ipWhitelist": [
    "1.2.3.4",
    "5.6.7.8"
  ],
  "metadata": {
    "environment": "production",
    "team": "payments"
  }
}'
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "url": "https://api.example.com/webhooks",
    "eventTypes": [
      "transaction.created",
      "transaction.completed"
    ],
    "ipWhitelist": [
      "1.2.3.4",
      "5.6.7.8"
    ],
    "metadata": {
      "environment": "production",
      "team": "payments"
    }
  }),
});
const result = await response.json();

Get available webhook event types

GET/api/v1/webhooks/events/typesX-API-Key

Responses

200List of available event types

Response follows the unified success / data / meta / error envelope.

curl https://api-staging.coinbax.com/api/v1/webhooks/events/types \
  -H "X-API-Key: $COINBAX_API_KEY"
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks/events/types', {
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
  },
});
const result = await response.json();

Get webhook subscription

GET/api/v1/webhooks/{id}X-API-Key

Path parameters

  • idstringrequired

    Subscription ID

Responses

200Webhook subscription details

Response follows the unified success / data / meta / error envelope.

404Subscription not found

Response follows the unified success / data / meta / error envelope.

curl https://api-staging.coinbax.com/api/v1/webhooks/<id> \
  -H "X-API-Key: $COINBAX_API_KEY"
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks/<id>', {
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
  },
});
const result = await response.json();

Delete webhook subscription

DELETE/api/v1/webhooks/{id}X-API-Key

Path parameters

  • idstringrequired

    Subscription ID

Responses

200Webhook subscription deleted

Response follows the unified success / data / meta / error envelope.

404Subscription not found

Response follows the unified success / data / meta / error envelope.

curl -X DELETE https://api-staging.coinbax.com/api/v1/webhooks/<id> \
  -H "X-API-Key: $COINBAX_API_KEY"
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks/<id>', {
  method: 'DELETE',
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
  },
});
const result = await response.json();

Update webhook subscription

PATCH/api/v1/webhooks/{id}X-API-Key

Path parameters

  • idstringrequired

    Subscription ID

Request body

  • urlstring

    The URL to send webhook events to

  • eventTypesarray of string

    Event types to subscribe to

    array of string
    string
  • isActiveboolean

    Whether the subscription is active

  • ipWhitelistarray of string

    Optional list of IP addresses allowed to send webhooks

    array of string
    string
  • metadataobject

    Optional metadata for the subscription

    object

    Optional metadata for the subscription

Responses

200Webhook subscription updated

Response follows the unified success / data / meta / error envelope.

400Invalid event types

Response follows the unified success / data / meta / error envelope.

404Subscription not found

Response follows the unified success / data / meta / error envelope.

curl -X PATCH https://api-staging.coinbax.com/api/v1/webhooks/<id> \
  -H "X-API-Key: $COINBAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://api.example.com/webhooks/v2",
  "eventTypes": [
    "transaction.created",
    "transaction.completed",
    "transaction.refunded"
  ],
  "isActive": true,
  "ipWhitelist": [
    "1.2.3.4",
    "5.6.7.8"
  ],
  "metadata": {
    "environment": "production",
    "team": "payments"
  }
}'
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks/<id>', {
  method: 'PATCH',
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "url": "https://api.example.com/webhooks/v2",
    "eventTypes": [
      "transaction.created",
      "transaction.completed",
      "transaction.refunded"
    ],
    "isActive": true,
    "ipWhitelist": [
      "1.2.3.4",
      "5.6.7.8"
    ],
    "metadata": {
      "environment": "production",
      "team": "payments"
    }
  }),
});
const result = await response.json();

Complete secret rotation

POST/api/v1/webhooks/{id}/complete-rotationX-API-Key

Path parameters

  • idstringrequired

    Subscription ID

Responses

200Secret rotation completed

Response follows the unified success / data / meta / error envelope.

400No rotation in progress

Response follows the unified success / data / meta / error envelope.

404Subscription not found

Response follows the unified success / data / meta / error envelope.

curl -X POST https://api-staging.coinbax.com/api/v1/webhooks/<id>/complete-rotation \
  -H "X-API-Key: $COINBAX_API_KEY"
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks/<id>/complete-rotation', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
  },
});
const result = await response.json();

Get webhook delivery logs

GET/api/v1/webhooks/{id}/delivery-logsX-API-Key

Path parameters

  • idstringrequired

    Subscription ID

Query parameters

  • limitnumber

    Number of logs to return

  • offsetnumber

    Number of logs to skip

  • successOnlyboolean

    Filter for successful deliveries only

  • failuresOnlyboolean

    Filter for failed deliveries only

Responses

200Delivery logs with pagination

Response follows the unified success / data / meta / error envelope.

404Subscription not found

Response follows the unified success / data / meta / error envelope.

curl https://api-staging.coinbax.com/api/v1/webhooks/<id>/delivery-logs \
  -H "X-API-Key: $COINBAX_API_KEY"
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks/<id>/delivery-logs', {
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
  },
});
const result = await response.json();

Reset circuit breaker

POST/api/v1/webhooks/{id}/reset-circuit-breakerX-API-Key

Path parameters

  • idstringrequired

    Subscription ID

Responses

200Circuit breaker reset

Response follows the unified success / data / meta / error envelope.

404Subscription not found

Response follows the unified success / data / meta / error envelope.

curl -X POST https://api-staging.coinbax.com/api/v1/webhooks/<id>/reset-circuit-breaker \
  -H "X-API-Key: $COINBAX_API_KEY"
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks/<id>/reset-circuit-breaker', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
  },
});
const result = await response.json();

Rotate webhook secret

POST/api/v1/webhooks/{id}/rotate-secretX-API-Key

Path parameters

  • idstringrequired

    Subscription ID

Responses

200Secret rotation initiated

Response follows the unified success / data / meta / error envelope.

404Subscription not found

Response follows the unified success / data / meta / error envelope.

curl -X POST https://api-staging.coinbax.com/api/v1/webhooks/<id>/rotate-secret \
  -H "X-API-Key: $COINBAX_API_KEY"
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks/<id>/rotate-secret', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
  },
});
const result = await response.json();

Test webhook endpoint

POST/api/v1/webhooks/{id}/testX-API-Key

Path parameters

  • idstringrequired

    Subscription ID

Responses

200Test result

Response follows the unified success / data / meta / error envelope.

404Subscription not found

Response follows the unified success / data / meta / error envelope.

curl -X POST https://api-staging.coinbax.com/api/v1/webhooks/<id>/test \
  -H "X-API-Key: $COINBAX_API_KEY"
const response = await fetch('https://api-staging.coinbax.com/api/v1/webhooks/<id>/test', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.COINBAX_API_KEY,
  },
});
const result = await response.json();