Skip to main content
PUT
/
api
/
v1
/
notifications
/
webhooks
/
{webhook_id}
Update webhook subscriptions
curl --request PUT \
  --url https://api.byblend.com/api/v1/notifications/webhooks/{webhook_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "event_codes": [
    [
      "order.shipped",
      "order.delivered"
    ]
  ],
  "url": "https://example.com/webhook"
}'
{
  "id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
  "created_at": "2023-11-07T05:31:56Z",
  "is_active": true,
  "type": "webhook",
  "user_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
  "subscriptions": [
    {
      "name": "Order Created",
      "description": "Triggered when an order is created",
      "event_code": "order.created"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
event_codes
string[]
required

List of event codes to subscribe to. Event codes can be retrieved from the /notifications/events endpoint. Pass 'all' for all events.

url
string
required

URL of the webhook endpoint

Example:

"https://example.com/webhook"

Response

200 - application/json

Webhook subscription updated successfully

id
string<uuid>

Unique identifier

Example:

"0227d1e5-ba9a-42b5-8fe2-38882aa65708"

created_at
string<date-time>

Date and time the subscription was created

is_active
boolean

Whether the subscription is currently active

Example:

true

type
string

Type of subscription, one of 'webhook' or 'email' or 'sms'

Example:

"webhook"

user_id
string

ID of the user who created the subscription; for email or sms endpoints, this is the recipient.

Example:

"0227d1e5-ba9a-42b5-8fe2-38882aa65708"

subscriptions
object[]
I