🔌Subscribers API: How to use it

🔌 How to Use Subscribers Endpoints

This document focuses specifically on managing WebHook Subscribers using the Clara API endpoints under /api/v1/subscribers.

Each section includes request format, parameters, example payloads, and HTTP responses.

📘 How to Use Subscribers via Clara API

This document provides detailed usage instructions for the /api/v1/subscribers endpoint, including payloads, descriptions, and HTTP status codes.


➕ Create Subscriber

Endpoint

POST /api/v1/subscribers

Request Body

FieldTypeRequiredDescription
namestring✅ YesName of the webhook subscriber
callbackUrlstring✅ YesURL to which webhook POSTs will be delivered
eventsstring[]✅ YesList of subscribed event types (e.g. PAYMENT_PAID)
enabledboolean❌ NoWhether the subscriber is active
companyUuiduuid❌ NoCompany UUID if not passed in credential

Example

{
  "name": "My Webhook",
  "callbackUrl": "https://example.com/my/webhook/endpoint",
  "events": [
    "PAYMENT_PAID",
    "CARD_CREATION_REQUEST_CREATED"
  ],
  "enabled": true,
  "companyUuid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed"
}

Responses

StatusMeaning
201Subscriber created successfully
400Bad Request
401Unauthorized
403Forbidden

♻️ Update Subscriber

Endpoint

PATCH /api/v1/subscribers/{uuid}

Request Body

FieldTypeRequiredDescription
namestring❌ NoUpdated name
callbackUrlstring❌ NoNew webhook target URL
eventsstring[]❌ NoUpdated list of event types
enabledboolean❌ NoWhether the subscriber is active or not
companyUuiduuid❌ NoOptional company identifier

Example

{
  "name": "Updated Webhook",
  "callbackUrl": "https://api.company.com/hook",
  "events": [
    "CARD_CREATION_REQUEST_ERROR"
  ],
  "enabled": false
}

Responses

StatusMeaning
200Subscriber updated
400Bad Request
401Unauthorized
403Forbidden

➕ Add Event to Subscriber

Endpoint

POST /api/v1/subscribers/add-event

Request Body

FieldTypeRequiredDescription
callbackUrlstring✅ YesCallback URL of the target subscriber
eventstring✅ YesEvent to add (e.g. CARD_CREATION_REQUEST_CREATED)
companyUuiduuid❌ NoOptional company UUID

Example

{
  "callbackUrl": "https://example.com/my/webhook/endpoint",
  "event": "CARD_CREATION_REQUEST_CREATED"
}

Responses

StatusMeaning
201Event added
400Bad Request
401Unauthorized
403Forbidden

➖ Delete Event from Subscriber

Endpoint

DELETE /api/v1/subscribers/delete-event

Request Body

FieldTypeRequiredDescription
callbackUrlstring✅ YesCallback URL of the subscriber
eventstring✅ YesEvent to remove
companyUuiduuid❌ NoOptional company UUID

Example

{
  "callbackUrl": "https://example.com/my/webhook/endpoint",
  "event": "CARD_CREATION_REQUEST_CREATED"
}

Responses

StatusMeaning
204Event removed
400Bad Request
401Unauthorized
403Forbidden

🗑️ Delete Subscriber

Endpoint

DELETE /api/v1/subscribers/{uuid}

Request Body

FieldTypeRequiredDescription
companyUuiduuid❌ NoOptional company UUID

Example

{
  "companyUuid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed"
}

Responses

StatusMeaning
204Subscriber deleted
400Bad Request
401Unauthorized
403Forbidden