Temporary issue
We hit a problem while loading this page. Please try again in a moment.
API Docs
HTTP endpoints for creating, retrieving, and checking draws.
API Overview
Use the API to create saved draws, fetch stored results, and verify published outcomes with the same deterministic rules used across the platform.
https://api.raffleroll.com/v1
application/json
- 200 request succeeded
- 201 draw created
- 202 draw accepted and still processing
- 401 missing or invalid API key
- 404 draw not found
- 409 draw is not ready for verification yet
- 422 request payload is invalid
- 500 saved draw could not be verified
Public draw IDs are 12-character tokens, for example
8Q4X7M2RKP2N.
Any saved draw can be viewed by anyone who has its draw ID.
API draws stay available for 1 year.
["alice", "bob"]
[["alice", 2], ["bob", 1]]
[{"label": "alice", "count": 2}]
-
POST /v1/drawscreates and stores a draw. -
GET /v1/draws/:idreturns the saved draw. -
POST /v1/draws/:id/verifychecks the saved result.
Send your API key in the x-api-key header.
Bearer auth is also accepted.
Need a key for a real integration? Request API access
curl https://api.raffleroll.com/v1/draws/DRAW_ID \ -H 'x-api-key: YOUR_KEY'
Create a draw
Each draw request saves the raw entries, the expanded ticket list, and the final result. Participants must be sent as an ordered array. Weighted entries can be sent as duplicates, as ordered pairs, or as ordered objects with label and count.
curl -X POST https://api.raffleroll.com/v1/draws \
-H 'content-type: application/json' \
-H 'x-api-key: YOUR_KEY' \
-d '{
"participants": [
{"label": "bob", "count": 1},
{"label": "alice", "count": 2},
{"label": "carol", "count": 1}
],
"n": 1,
"algorithm_version": "1.0.2"
}'
{
"id": "8Q4X7M2RKP2N",
"kind": "api",
"status": "finalized",
"winner_count": 1,
"raw_participants": [
"{\"label\": \"bob\", \"count\": 1}",
"{\"label\": \"alice\", \"count\": 2}",
"{\"label\": \"carol\", \"count\": 1}"
],
"participants": ["bob", "alice", "alice", "carol"],
"canonical_participants": ["alice", "alice", "bob", "carol"],
"participants_hash": "6f9d...",
"seed_commit": "f0de...",
"seed": "c219...",
"normalized_seed": "c219...",
"algorithm_version": "1.0.2",
"winners": ["alice"],
"indexes": [1],
"drand": {
"network": "mainnet",
"round": 123456,
"randomness": "88f5..."
},
"expires_at": "2027-03-28T11:47:00Z",
"inserted_at": "2026-03-28T11:47:00Z"
}
Get a draw
Retrieve the saved draw details for a known 12-character draw ID, including raw entries, expanded tickets, and canonical proof order.
curl https://api.raffleroll.com/v1/draws/DRAW_ID \ -H 'x-api-key: YOUR_KEY'
{
"id": "8Q4X7M2RKP2N",
"kind": "api",
"status": "finalized",
"winner_count": 1,
"raw_participants": [
"{\"label\": \"bob\", \"count\": 1}",
"{\"label\": \"alice\", \"count\": 2}",
"{\"label\": \"carol\", \"count\": 1}"
],
"participants": ["bob", "alice", "alice", "carol"],
"canonical_participants": ["alice", "alice", "bob", "carol"],
"participants_hash": "6f9d...",
"seed_commit": "f0de...",
"seed": "c219...",
"normalized_seed": "c219...",
"algorithm_version": "1.0.2",
"winners": ["alice"],
"indexes": [1],
"drand": {
"network": "mainnet",
"round": 123456,
"randomness": "88f5..."
},
"expires_at": "2027-03-28T11:47:00Z",
"inserted_at": "2026-03-28T11:47:00Z"
}
Verify a saved result
This endpoint reruns the stored draw and checks whether the saved winners still match. It does not accept a manual participant list or seed input.
curl -X POST https://api.raffleroll.com/v1/draws/DRAW_ID/verify \ -H 'x-api-key: YOUR_KEY'
{
"ok": true,
"id": "8Q4X7M2RKP2N",
"status": "finalized",
"checked_at": "2026-03-30T12:15:00Z",
"algorithm_version": "1.0.2",
"winner_count": 1,
"comparisons": {
"participants_hash": true,
"normalized_seed": true,
"winners": true,
"indexes": true
},
"stored": {
"participants_hash": "6f9d...",
"normalized_seed": "c219...",
"winners": ["alice"],
"indexes": [1]
},
"recomputed": {
"participants_hash": "6f9d...",
"normalized_seed": "c219...",
"winners": ["alice"],
"indexes": [1]
}
}
{
"ok": false,
"id": "8Q4X7M2RKP2N",
"status": "pending_randomness",
"error": "draw is not finalized",
"retryable": true,
"finalize_attempts": 2,
"last_finalize_error": "The public randomness service could not be reached right now",
"last_finalize_attempt_at": "2026-03-30T12:12:00Z",
"next_finalize_at": "2026-03-30T12:17:00Z"
}