Recovery
Oddin-style stateful recovery — republishes active markets + recent settlements to your AMQP vhost, terminated by snapshot_complete
Documentation Index
Fetch the complete documentation index at: https://docs.ticktock.bet/llms.txt
Use this file to discover all available pages before exploring further.
When to call it
Use this endpoint whenever your AMQP consumer falls behind and you need to resync without polling REST for every match individually. Typical triggers:- AMQP connection dropped and your durable queue’s TTL elapsed.
- Service restart with no persisted last-message timestamp.
- The
<alive>message arrived withsubscribed="0"(producer downtime) — Oddin convention is to immediately initiate recovery.
How it works
You make a single REST call. The server schedules a background replay onto your tenant’s AMQP vhost (the same exchange the live feed uses,ttfeed). For every booked match the replay publishes:
- One
<odds_change>listing the current active B2B market offers with up-to-date odds. - One
<bet_settlement>per match for offers settled betweenafterand now. - One
<bet_cancel>per match for offers voided betweenafterand now. - A terminating
<snapshot_complete request_id="…">so you know the replay is finished.
recovery=1 AMQP header and use routing-key priority lo (vs live hi). You can route them to the same queue as live or bind a separate queue for them.
Required scope
- Minimum:
cs2:recovery:initiate
cs2.odds.basic bundle, so existing odds-feed customers don’t need a new key.
Parameters
| Parameter | Required | Description |
|---|---|---|
after | yes | Unix timestamp in milliseconds. The replay includes settlements and voids whose latest transition happened after this moment; active markets are republished regardless of after. Must be within the stateful-recovery window (3 days by default) and not in the future. |
request_id | yes | Client-chosen identifier (≤ 64 chars). Echoed back on the final <snapshot_complete> so your code can correlate the replay with the request that triggered it. |
node_id | no | Optional multi-node tag (≤ 64 chars). When supplied, it appears in the last section of every recovery routing key. Use it to bind a per-node queue if multiple of your processes consume the same vhost — only the node that asked for the replay sees it. |
Errors
| Status | Reason |
|---|---|
409 | Another recovery for this tenant is already in flight. Wait for <snapshot_complete> from the previous request before retrying, or skip — one recovery is enough. |
409 | The API key has cs2:recovery:initiate but the tenant has no provisioned AMQP vhost yet. Contact support. |
422 | after is in the future, or older than the configured stateful-recovery window (3 days). Pick a more recent timestamp. |
Example
Client recipe
Detect the loss
<alive subscribed="0"> message. Stop processing live messages until recovery completes — either pause your consumer or buffer the incoming envelopes and apply them after <snapshot_complete>.Initiate the replay
POST /cs2/v1/recovery/initiate_request with after = <unix_ms of last processed message>. The server returns 202 Accepted immediately; the replay is scheduled in the background.Apply recovery envelopes
recovery=1, priority lo) overwrite your local state for the keys they touch. Active markets get their current odds; settled / voided markets get their final result.Routing keys produced
node_id is omitted, the last section is -.
See also
- AMQP messaging feed — the channel your replay arrives on
- Market descriptions — fetch the template + code catalog once at integration time
Authorizations
Tenant API key issued during onboarding
Query Parameters
Unix timestamp in milliseconds. The replay includes settlements / voids that happened strictly after this moment. Must be within the stateful-recovery window.
Client-chosen identifier echoed back on the final <snapshot_complete> message so the client can correlate this replay with its bookkeeping.
64Optional client-node identifier. When supplied, it appears in the last section of the AMQP routing key so multi-node clients can bind a per-node queue and receive the replay only for that node.
64Response
Successful Response
The response is of type Response Initiate Recovery Cs2 V1 Recovery Initiate Request Post · object.