POST /api/v1/events/{id}/close
Close an event by declaring the winning outcome. Triggers settlement of all positions across every pool and market within the event. Holders of the winning outcome receive payouts; losing positions are zeroed out.
Authenticationβ
Required -- Bearer token. Caller must be the event creator.
Requestβ
| Parameter | Type | In | Description |
|---|---|---|---|
id | int64 | path | Event ID |
won_side | string | body | Winning outcome: "YES" or "NO" (simple close) |
pools | array | body | Per-pool outcomes (alternative to won_side) |
For simple events with one pool, use won_side. For events with multiple pools, use the pools array with per-pool or per-market outcomes.
Example (simple close)β
curl -X POST https://intotes.com/api/v1/events/1/close \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ "won_side": "YES" }'
Example (per-pool close)β
curl -X POST https://intotes.com/api/v1/events/1/close \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"pools": [
{ "pool_id": 10, "won_side": "YES" },
{ "pool_id": 11, "won_side": "NO" }
]
}'
Responseβ
200 OKβ
{
"status": "ok"
}
403 Forbiddenβ
Returned when the authenticated user is not the event creator.
{
"error": "forbidden"
}
404 Not Foundβ
{
"error": "event not found"
}
409 Conflictβ
Returned when the event is already closed or cancelled.
{
"error": "event already resolved"
}