Skip to main content

POST /api/v1/events/{id}/pools/{pool_id}/markets/{market_id}/close

Close a specific market within a pool by declaring the winning outcome. Positions in this market are settled: holders of the winning side receive payouts.

Authentication​

Required -- Bearer token. Caller must be the event creator.

Request​

ParameterTypeInDescription
idint64pathEvent ID (int64)
pool_idint64pathPool ID (int64)
market_idint64pathMarket ID (int64)
won_sidestringbodyWinning outcome: "YES" or "NO"

Example​

curl -X POST https://intotes.com/api/v1/events/1/pools/10/markets/101/close \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ "won_side": "YES" }'

Response​

200 OK​

{
"status": "ok"
}

403 Forbidden​

Returned when the authenticated user is not the event creator.

{
"error": "forbidden"
}

404 Not Found​

{
"error": "market not found"
}

409 Conflict​

Returned when the market is already closed.

{
"error": "market already resolved"
}