Request
Yizame
Planned: it answers with a typed refusal · No credits
POST/v1/webhooks
curl -s -X POST "https://api.risksindex.com/v1/webhooks" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: <a-unique-key-per-attempt>" \
-d '{}'const res = await fetch("https://api.risksindex.com/v1/webhooks", { method: "POST", headers: { "Content-Type": "application/json", "Idempotency-Key": "<a-unique-key-per-attempt>" }, body: "{}" });
const { data, meta } = await res.json();import json, urllib.request
req = urllib.request.Request("https://api.risksindex.com/v1/webhooks", data="{}".encode(), method="POST", headers={"Content-Type": "application/json", "Idempotency-Key": "<a-unique-key-per-attempt>"})
with urllib.request.urlopen(req) as res:
answer = json.load(res)200 OKapplication/json
{
"provenance": [
{
"repository": "string",
"commit": "string",
"path": "string",
"sha256": "string",
"licence": "string"
}
]
} Creates a webhook subscription for the account of the token: an https url, the event types (for example index.hazard.created, or *) and an optional description. The receiver must complete the CloudEvents validation handshake. The signing secret is answered once. Scope index.webhook_subscribe:write. Off (503 WEBHOOKS_OFF) until INDEX_API_DATABASE_URL is set; the change feed at /v1/changes carries the same changes. Availability: Planned (answers a typed problem response until built).
Parameters
Parameters
Idempotency-Keyoptionalheader · string
Optional. A value of your own (a UUID is fine) that makes this write safe to retry: the same caller, key and request within 24 hours gets the first answer again, with the header Idempotent-Replayed: true, and the work is not done twice. It applies to a request that carries a credential.
Answers
Responses
- 200
An OGC API document (raw OGC shape, not the envelope)
- 400Problem, RFC 9457
Bad body. Codes: BAD_BODY, BAD_BUILD, BAD_JSON, BAD_QUERY, BAD_WEBHOOK
- 401Problem, RFC 9457
Authentication required. Codes: AUTH_REQUIRED, TOKEN_INVALID
- 403Problem, RFC 9457
Insufficient scope. Codes: INSUFFICIENT_SCOPE
- 404Problem, RFC 9457
No such webhook. Codes: WEBHOOK_NOT_FOUND
- 409Problem, RFC 9457
Webhook exists. Codes: WEBHOOK_EXISTS, WEBHOOK_LIMIT
- 413Problem, RFC 9457
Body too large. Codes: BODY_TOO_LARGE, TOO_LARGE
- 414
- 422Problem, RFC 9457
Receiver not validated. Codes: WEBHOOK_NOT_VALIDATED, WEBHOOK_URL_REFUSED
- 429Problem, RFC 9457
Rate limited. Codes: RATE_LIMITED
- 500Problem, RFC 9457
Internal error. Codes: INTERNAL
- 503Problem, RFC 9457
Webhooks off. Codes: WEBHOOKS_OFF
Get started
Get a key with a free account, or choose who the account is for, its seats and any council, and see your workstation first.