Overview
Base URL and the webhook key
The Webhooks API has its own host and uses a webhook key that also signs every message.
Overview
The Webhooks API has its own host: https://webhooks.gray3.io. All routes live under /v1/webhook.
Every request sends two headers:
X-Gray-Project-Id: proj_your_project_id
Authorization: Bearer gray_whk_your_webhook_keyOne key, two jobs
The webhook key (it starts with gray_whk_) is shown once, when you create the webhook or rotate its key in Console. It does two things:
- It authenticates your calls to this API.
- It signs every message Gray3 sends to you, so you can verify it.
Your Cloud API secret key (gray_sk_) does not work here, and the webhook key does not work on the Cloud API.
Rotating the key
Rotate the key in Console › Webhooks. The old key stops working immediately, both for API calls and for signing, so deploy the new key to your receiver right away. Messages still being retried are signed with the new key.
What only Console can do
Creating the webhook, deleting it, and rotating its key happen only in Console. Everything else, including changing the URL, pausing, and managing addresses, is available through the API.
Response envelope
Responses use the same envelope as the other Gray3 APIs: { "data": … } on success and { "error": { "code", "message" } } on failure. See Errors.