Manual · 02 · walkthrough
Your first delivery in nine minutes.
This walkthrough issues a source token, registers an endpoint, sends one event, verifies the signature a consumer receives and reads the attempt log. You need a Gitiox source with the Gateway role and one HTTPS endpoint you control. Examples target the sandbox region; nothing here touches production data.
Before you begin
All requests use https://gateway.gitiox.com/v1 and a bearer token. Sandbox tokens begin with gx_test_ and can only publish events whose occurred_at is within the last seven days; production tokens begin with gx_live_. The same endpoint may be registered in both environments.
-
Issue a source token
In the Gitiox console open Settings → Sources, select the source you are integrating, then Gateway tokens → Issue token. Choose the
ingest:writescope and the region of the source. The token is displayed once; store it in your secret manager, not in the repository.export GITIOX_TOKEN="gx_test_4f9c2a7e0b1d8c35a6e2d0f1" export GITIOX_SOURCE="src_01J9K3M8YVQ2" # Settings → Sources → IDTokens are scoped to one source and one environment. Rotate with
POST /v1/tokens/{id}/rotate; the previous token stays valid for 24 hours so consumers can be rolled without a gap. -
Register an endpoint
An endpoint is a URL plus the event types it wants. Gateway assigns the signing secret at creation and returns it once, in the
signing_secretfield.curl -sS -X POST "https://gateway.gitiox.com/v1/endpoints" \ -H "Authorization: Bearer $GITIOX_TOKEN" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: reg-staging-001" \ -d '{ "url": "https://ops.example.net/hooks/gitiox", "description": "Staging consumer", "events": ["repository.push", "ci.run.finished"], "active": true }'{ "endpoint": { "id": "ep_01JC9Z4T7M2XQP6VF3K8N1RAWD", "url": "https://ops.example.net/hooks/gitiox", "status": "active", "events": ["repository.push", "ci.run.finished"], "signing_secret_set": true, "created_at": "2026-11-24T09:41:07Z" }, "signing_secret": "whsec_9tR2Kd...", "request_id": "req_01JC9Z4V3B8H2M4T6Q0W9X1Y5Z" }Write it down
The signing secret is shown once and cannot be retrieved later. If you lose it, rotate the endpoint secret with
PATCH /v1/endpoints/{id}and deploy the new value before the overlap window closes. -
Send the first event
Publish a single canonical event. The body is the envelope without an
id— Gateway assignsevt_…anddlv_…identifiers, so retries of the sameIdempotency-Keynever duplicate a delivery.curl -sS -X POST "https://gateway.gitiox.com/v1/events" \ -H "Authorization: Bearer $GITIOX_TOKEN" \ -H "X-Gitiox-Source: $GITIOX_SOURCE" \ -H "Idempotency-Key: smoke-2026-11-24-a" \ -H "Content-Type: application/json" \ -d '{ "type": "repository.push", "occurred_at": "2026-11-24T09:42:18Z", "actor": { "id": "usr_8842", "login": "m.kask" }, "target": { "kind": "repository", "id": "repo_5512", "name": "core/relay" }, "data": { "ref": "refs/heads/main", "commit_count": 3 } }'{ "delivery_id": "dlv_01JCA1M4Q7T3XK9Z2P8R5V6WNE", "event_id": "evt_01JCA1M4Q7T3XK9Z2P8R5V6WNE", "status": "queued", "accepted_at": "2026-11-24T09:42:18Z", "request_id": "req_01JCA1M4R2D8K7N3Q5V0W6X9YZ" }The 202 is a durability acknowledgement, not a delivery receipt. Keep the
delivery_id; it is the handle for polling and replay. -
Verify the signature your consumer receives
Each attempt carries
X-Gitiox-Signaturein the formt=<unix>,v1=<hex>. Compute HMAC-SHA256 over the concatenation of the timestamp, a literal dot and the raw request body. Parse the body only after the check passes.import hashlib, hmac, time def verify(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool: parts = dict(item.split("=", 1) for item in header.split(",")) # 1. reject stale timestamps before doing any work if abs(time.time() - int(parts["t"])) > tolerance: return False # 2. signed message is: timestamp + "." + raw body message = parts["t"].encode() + b"." + body expected = hmac.new(secret.encode(), message, hashlib.sha256).hexdigest() # 3. constant-time compare return hmac.compare_digest(expected, parts["v1"])POST /hooks/gitiox HTTP/1.1 Host: ops.example.net Content-Type: application/json User-Agent: Gitiox-Gateway/1.8.3 X-Gitiox-Signature: t=1764008600,v1=4f1c9d2b8e7a03c5d6f18b2a9e4c7d0f3a5b8c1e2d4f6a7b9c0d1e3f5a7b9c2d X-Gitiox-Delivery: dlv_01JCA1M4Q7T3XK9Z2P8R5V6WNE X-Gitiox-Event: repository.push x-request-id: req_01JCA1M4R2D8K7N3Q5V0W6X9YZReject replayed payloads by remembering
X-Gitiox-Deliveryfor at least the signature tolerance. A valid signature on a duplicate delivery is still a duplicate event. -
Read the attempt log
Fetch the delivery to see every attempt, its latency and the response code your endpoint returned. This is the same object the console shows on the delivery detail screen.
curl -sS "https://gateway.gitiox.com/v1/deliveries/dlv_01JCA1M4Q7T3XK9Z2P8R5V6WNE" \ -H "Authorization: Bearer $GITIOX_TOKEN"{ "id": "dlv_01JCA1M4Q7T3XK9Z2P8R5V6WNE", "status": "delivered", "event": { "id": "evt_01JCA1M4Q7T3XK9Z2P8R5V6WNE", "type": "repository.push" }, "endpoint": { "id": "ep_01JC9Z4T7M2XQP6VF3K8N1RAWD", "url": "https://ops.example.net/hooks/gitiox" }, "created_at": "2026-11-24T09:42:18Z", "delivered_at": "2026-11-24T09:42:19Z", "attempts": [ { "n": 1, "at": "2026-11-24T09:42:19Z", "status_code": 200, "latency_ms": 184, "outcome": "delivered", "request_id": "req_01JCA1M4R2D8K7N3Q5V0W6X9YZ" } ], "next_retry_at": null, "request_id": "req_01JCA1M5B7F3K2M8Q4T6V0W1XY" }Checkpoint
You have a signed delivery with a recorded attempt. From here the useful paths are filters, replay and alerting — all documented in endpoints and errors & retries.
-
Replay a delivery by hand
Replay is the escape hatch for consumers that were down or misconfigured. The envelope is unchanged; Gateway re-signs it with a fresh timestamp and starts a new attempt counter. The original delivery record is preserved.
curl -sS -X POST \ "https://gateway.gitiox.com/v1/deliveries/dlv_01JCA1M4Q7T3XK9Z2P8R5V6WNE/replay" \ -H "Authorization: Bearer $GITIOX_TOKEN" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: replay-2026-11-24-01" \ -d '{ "reason": "consumer deployed without the webhook route" }'{ "delivery_id": "dlv_01JCA1M4Q7T3XK9Z2P8R5V6WNE", "replay_id": "rpl_01JCB7N2C5W8Q3M6T0V4X9Y1ZAD", "status": "queued", "attempt": 1, "scheduled_at": "2026-11-24T09:58:02Z", "request_id": "req_01JCB7N2D3G5H7J9K1L3M5N7P8" }Replay is limited to deliveries from the last seven days and to tokens with the
deliveries:writescope. A rate limit of 60 replays per minute applies to each token.
07If it does not arrive
Five failures account for almost every onboarding ticket. Match the symptom before opening the payload.
| Symptom | Likely cause | Do this |
|---|---|---|
| 202, endpoint silent | The event type is not in the endpoint filter. | Read endpoint.events; PATCH the endpoint with the missing type. |
| Signature mismatch | A framework parsed and re-serialised the body before the check. | Verify against the raw byte stream; do not use the parsed object. |
| attempts show 404 | Route missing in the deployed consumer. | Deploy the route, then replay the delivery. |
| attempts show timeout | Consumer writes synchronously and exceeds 10 s. | Answer 202 immediately and process from a queue. |
| 429 at ingest | Source quota exceeded, or a retry loop without backoff. | Honour Retry-After; check the producer for duplicate sends. |
Table 2 — onboarding failures by first symptom.