Open a battle
POST/battles
Opens a lobby with seats_total seats and seats the creator at index 0.
Whether seat 0 lands FILLED or READY depends on creator_game_url:
supplying it makes the seat READY, omitting it leaves it FILLED and the
creator must supply a URL later. A two-seat battle created without
creator_game_url does not auto-start when the other player joins.
The response carries a viewer token for the live feed when the instance has a
signing key. If it does not, the battle is still created and ws_token is
simply absent — see the ws_token field note.
Pricing a battle
The entry is the bonus buy, and a mode's prices (buy_amounts_usd on
GET /games) are measured in US dollars. So entry_amount must be worth
one of them, and an amount between two rungs is refused rather than rounded —
the game's bet stepper cannot land there.
This service holds no exchange rates and will not convert for you. A battle in
any currency other than USD must send buy_amount_usd: the entry expressed
in US dollars. It is the only number the price ladder, the recipe's bet-raise
and the seat's own buy-price verification are compared against; entry_amount
and currency remain the casino's own numbers, for its own pot and refunds.
Omitting it in a non-USD currency is a 400 (buy_amount_usd_required), not
a battle priced by accident.
Scope: battles:write
Request
Responses
- 201
- 400
- 401
- 403
- 409
- 413
- 503
Battle opened
Invalid body, a play_mode that is neither REAL nor FUN — an unrecognised one is refused, never resolved to REAL — or a creator_display_name over 64 characters. Also returned for an unknown field — including a tenant_id, which is rejected rather than ignored; for an entry_amount this bonus is not sold at (amount_not_sold, whose message lists the prices that ARE sold); and for a non-USD battle that omitted buy_amount_usd (buy_amount_usd_required)
Missing, malformed, revoked or expired API key
The key lacks battles:write, the casino is suspended, or the game is not allowed
The creator already holds as many active battles as this instance allows
Body over 1 MiB
The lobby is still initialising, or the instance is at capacity