Sync webhooks
Create a sync webhook
Add a webhook to a sync. When an event of the notification_type happens, Stacksync posts the event as JSON to the URL with Authorization: Bearer <api_key>. The URL is checked to be reachable before the webhook is stored. Send validate_only: true to run the checks without storing.
Authorization
AuthorizationstringheaderrequiredBearer <key>, where <key> is a workspace API key or a user API key. See Authentication.
workspace_id*integerThe workspace the resources belong to
base_id*stringThe sync (a sync is called a base in these paths)
uuidregion*stringData region of the sync
"besg""usnv"The webhook to add. The example's host hooks.example.com is a placeholder: replace it with your own HTTPS endpoint; it must resolve publicly. hooks.example.com is a placeholder: replace it with your own host, which the API checks before saving (the example as written is refused).
application/json- body
A webhook of the sync: where one type of notification is posted. A sync holds at most one webhook per notification type and URL
url*stringThe https URL Stacksync posts the notification to: a public internet host that answers an OPTIONS request within 2 seconds, with none of the characters space < > # % { } | \ ^ ~ [ ] `
urinotification_type*stringbase_activity (the sync was switched, edited or failed), real_time_issue_notification (records failed to sync) or backfill (an initial full read finished)
"base_activity""real_time_issue_notification""backfill"api_key*stringSent as Authorization: Bearer <api_key> with every notification, so your endpoint can check the caller
validate_only?booleanRun every check of the write and answer without writing: a refused write answers the error it would answer
falseThe webhook created
application/json- response
One webhook
msg*stringWhat was done
webhook*A webhook of the sync
curl -X POST 'https://api.stacksync.com/v1/workspaces/0/bases/497f6eca-6276-4993-bfeb-53cbbbba6f08/webhooks?region=besg' \ -H 'Content-Type: application/json' \ -d '{ "url": "https://hooks.example.com/stacksync", "notification_type": "real_time_issue_notification", "api_key": "whsec_7f3a9c2e4b1d"}'{ "msg": "Successfully created webhook", "webhook": { "webhook_id": "6a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "url": "https://hooks.example.com/stacksync", "notification_type": "real_time_issue_notification", "api_key": "whsec_7f3a9c2e4b1d" }}