Skip to main content

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​

ParameterTypeInDescription
idint64pathEvent ID
won_sidestringbodyWinning outcome: "YES" or "NO" (simple close)
poolsarraybodyPer-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"
}