Overview / System / Create a webhook

Create a webhook

post https://api.flactrum.com/v1/webhooks

The signing secret is returned once, in this response only. It is stored encrypted; a secret that could be read back would not be a secret.

Required scope webhooks.write
Success status201
Returns One Webhook object

Request body

FieldTypeDescription
name * string —
url * string Must be https — a signed payload should not travel over plain HTTP.
scope * string —
branch_id string|null Required when scope is branch.
region string|null Required when scope is region.
events * array At least one. Valid values come from /webhook-events.
is_active boolean —

Response fields

FieldTypeDescription
id string —
name string —
url string —
scope string —
branch_id string|null —
region string|null —
is_active boolean —
events array —
failure_count integer Consecutive failures. Editing the endpoint resets it.
last_delivered_at string|null —
last_error string|null —
secret string Only present in the create and rotate responses. Stored encrypted; never returned again.

Examples

Recorded from the test suite — these are real requests and their real responses.

curl -X POST 'https://api.flactrum.com/v1/webhooks' \
  -H 'Authorization: Bearer flk_your_key:your_secret' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Muhasebe entegrasyonu",
    "url": "https://ornek.com/flactrum",
    "scope": "brand",
    "events": [
        "order.completed"
    ]
}'

HTTP 201 · application/json

{
    "data": {
        "id": "01m43mzrjt5jynq1z93b5p56xw",
        "name": "Muhasebe entegrasyonu",
        "url": "https://ornek.com/flactrum",
        "scope": "brand",
        "branch_id": null,
        "region": null,
        "is_active": true,
        "events": [
            "order.completed"
        ],
        "failure_count": 0,
        "last_delivered_at": null,
        "last_error": null,
        "created_at": "2026-10-04T14:27:18+00:00",
        "updated_at": "2026-10-04T14:27:18+00:00",
        "secret": "es6Sfn9FcaFqsHFPZmKVvUdgkgNghZYvvefaRMB9fUFQw4yc"
    },
    "meta": {
        "notice": "Store this secret now: it is encrypted at rest and will never be shown again."
    }
}