Webhooks

Webhooks are designed to notify your systems when certain/all registered events happen in near real-time. They allow you to collect information about those events. Rebilly can send these information via POST to an URL of your choice.

Trigger a test webhook

Trigger a test webhook.

Request
Security:
header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

Webhook resource.

eventsFilter
Array of strings (GlobalWebhookEventType)
Default: []

An array of System event type.

Items Enum: "aml-list-possibly-matched" "customer-created" "customer-merged" "customer-one-time-password-requested" "customer-updated" "dispute-created" "dispute-modified" "experian-check-performed" "gateway-account-downtime-ended" "gateway-account-downtime-started" … 52 more
status
string (OnOff)
Default: "active"
Enum: "active" "inactive"
method
required
string
Enum: "GET" "POST" "PUT" "PATCH" "DELETE"
url
required
string <uri>

URL that will be triggered when the given event occurs.

Array of objects (WebhookHeader)
Array
name
required
string
status
string (OnOff)
Default: "active"
Enum: "active" "inactive"
value
required
string
credentialHash
required
string

Hash from Credentials which is used for authentication by the given URL.

Responses
204Test webhook was triggered.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
422Invalid data was sent.
post/previews/webhooks
Request samples
application/json
{
  • "eventsFilter": [ ],
  • "status": "active",
  • "method": "GET",
  • "headers": [
    ],
  • "credentialHash": "string"
}
Response samples
application/json
{
  • "status": 400,
  • "title": "string",
  • "detail": "string",
  • "error": "string"
}

Retrieve a list of webhooks

Retrieve a list of webhooks.

Request
Security:
query Parameters
limit
integer [ 0 .. 1000 ]

The collection items limit.

offset
integer >= 0

The collection items offset.

filter
string

The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200A list of Webhooks was retrieved successfully.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
get/webhooks
Request samples
// all parameters are optional
const firstCollection = await api.webhooks.getAll();

// alternatively you can specify one or more of them
const params = {limit: 20, offset: 100, sort: '-createdTime'}; 
const secondCollection = await api.webhooks.getAll(params);

// access the collection items, each item is a Member
secondCollection.items.forEach(webhook => console.log(webhook.fields.name));
Response samples
application/json
[
  • {
    }
]

Create a webhook

Create a webhook.

Request
Security:
header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

Webhook resource.

eventsFilter
Array of strings (GlobalWebhookEventType)
Default: []

An array of System event type.

Items Enum: "aml-list-possibly-matched" "customer-created" "customer-merged" "customer-one-time-password-requested" "customer-updated" "dispute-created" "dispute-modified" "experian-check-performed" "gateway-account-downtime-ended" "gateway-account-downtime-started" … 52 more
status
string (OnOff)
Default: "active"
Enum: "active" "inactive"
method
required
string
Enum: "GET" "POST" "PUT" "PATCH" "DELETE"
url
required
string <uri>

URL that will be triggered when the given event occurs.

Array of objects (WebhookHeader)
Array
name
required
string
status
string (OnOff)
Default: "active"
Enum: "active" "inactive"
value
required
string
credentialHash
required
string

Hash from Credentials which is used for authentication by the given URL.

Responses
201Webhook was created.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
422Invalid data was sent.
post/webhooks
Request samples
application/json
{
  • "eventsFilter": [ ],
  • "status": "active",
  • "method": "GET",
  • "headers": [
    ],
  • "credentialHash": "string"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "eventsFilter": [ ],
  • "status": "active",
  • "method": "GET",
  • "headers": [
    ],
  • "credentialHash": "string",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}

Retrieve a webhook

Retrieve a webhook with specified identifier string.

Request
Security:
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200Webhook was retrieved successfully.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
404Resource was not found.
get/webhooks/{id}
Request samples
const webhook = await api.webhooks.get({id: 'foobar-001'});
console.log(webhook.fields.id);
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "eventsFilter": [ ],
  • "status": "active",
  • "method": "GET",
  • "headers": [
    ],
  • "credentialHash": "string",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}

Create or update a webhook with predefined ID

Create or update a webhook with predefined identifier string.

Request
Security:
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

Webhook resource.

eventsFilter
Array of strings (GlobalWebhookEventType)
Default: []

An array of System event type.

Items Enum: "aml-list-possibly-matched" "customer-created" "customer-merged" "customer-one-time-password-requested" "customer-updated" "dispute-created" "dispute-modified" "experian-check-performed" "gateway-account-downtime-ended" "gateway-account-downtime-started" … 52 more
status
string (OnOff)
Default: "active"
Enum: "active" "inactive"
method
required
string
Enum: "GET" "POST" "PUT" "PATCH" "DELETE"
url
required
string <uri>

URL that will be triggered when the given event occurs.

Array of objects (WebhookHeader)
Array
name
required
string
status
string (OnOff)
Default: "active"
Enum: "active" "inactive"
value
required
string
credentialHash
required
string

Hash from Credentials which is used for authentication by the given URL.

Responses
200Webhook was updated.
201Webhook was created.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
422Invalid data was sent.
put/webhooks/{id}
Request samples
application/json
{
  • "eventsFilter": [ ],
  • "status": "active",
  • "method": "GET",
  • "headers": [
    ],
  • "credentialHash": "string"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "eventsFilter": [ ],
  • "status": "active",
  • "method": "GET",
  • "headers": [
    ],
  • "credentialHash": "string",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}