POST /api/v1/events/{id}/cancel
Cancel an event. All open positions are refunded to their holders at the original purchase price. The event is marked as cancelled and removed from the active feed.
Authenticationβ
Required β Bearer token. Caller must be the event creator.
Requestβ
| Parameter | Type | In | Description |
|---|---|---|---|
id | int64 | path | Event ID (int64) |
Exampleβ
curl -X POST https://yoyo.market/api/v1/events/1/cancel \
-H "Authorization: Bearer <token>"
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"
}