Upsert a webhook

Request

Creates or updates (upserts) a webhook with a specified ID.

Security
SecretApiKey or JWT or ApplicationJWT
Path
idstring, <= 50 characters^[@~\-\.\w]+$required
ID of the resource.
Bodyapplication/jsonrequired
Webhook to create or update.
eventsFilterArray of any
Event types that trigger the webhook. If empty, all event types trigger the webhook.
Default:[]
statusstring
Default:"active"
Enum:"active""inactive"
methodstringrequired
Enum:"GET""POST""PUT""PATCH""DELETE"
urlstring, (uri)required
URL that receives requests when a specified event occurs.
headersArray of objects
Headers to include in the webhook request.
credentialHashstringrequired
Credential hash for authenticating requests to the URL.
bodystring or null

Webhook request body. If this value is null, the default payload for the specified event is used. Template placeholders are permitted.

Invalid placeholders render as empty strings. For example, Hello {{invalid.placeholder}}! is rendered as Hello !.

For more information, see Placeholders.

filterstring or null

Filter that determines whether to send the webhook. This field requires a special format. Use , for multiple allowed values. Use ; for multiple fields.

For more information, see Using filters.

curl -i -X PUT \
  'https://www.rebilly.com/_mock/catalog/all/webhooks/{id}' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "eventsFilter": [],
    "status": "active",
    "method": "GET",
    "url": "http://example.com",
    "headers": [
      {
        "name": "Content-Type",
        "status": "active",
        "value": "value1"
      }
    ],
    "credentialHash": "string",
    "body": "string",
    "filter": "string"
  }'

Responses

Webhook updated.
Headers
Rate-Limit-Limitinteger

Maximum number of requests available at one time for this rate limit. For more information, see Rate limits.

Example:500
Rate-Limit-Remaininginteger

Number of requests still available for this rate limit. For more information, see Rate limits.

Example:499
Bodyapplication/json
idstring, <= 50 charactersread-only
ID of the webhook.
Example:"hook_0YVBG8S0K0DG59J6S3RMN9K452"
eventsFilterArray of any
Event types that trigger the webhook. If empty, all event types trigger the webhook.
Default:[]
statusstring
Default:"active"
Enum:"active""inactive"
methodstringrequired
Enum:"GET""POST""PUT""PATCH""DELETE"
urlstring, (uri)required
URL that receives requests when a specified event occurs.
headersArray of objects
Headers to include in the webhook request.
credentialHashstringrequired
Credential hash for authenticating requests to the URL.
bodystring or null

Webhook request body. If this value is null, the default payload for the specified event is used. Template placeholders are permitted.

Invalid placeholders render as empty strings. For example, Hello {{invalid.placeholder}}! is rendered as Hello !.

For more information, see Placeholders.

filterstring or null

Filter that determines whether to send the webhook. This field requires a special format. Use , for multiple allowed values. Use ; for multiple fields.

For more information, see Using filters.

createdTimestring, (date-time)(CreatedTime)read-only
Date and time when the resource is created. This value is set automatically when the resource is created.
updatedTimestring, (date-time)(UpdatedTime)read-only
Date and time when the resource is updated. This value is set automatically when the resource is updated.
Response
{ "id": "hook_0YVBG8S0K0DG59J6S3RMN9K452", "eventsFilter": [], "status": "active", "method": "GET", "url": "http://example.com", "headers": [ { … } ], "credentialHash": "string", "body": "string", "filter": "string", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ { … } ] }