Basketball API reference
Every basketball endpoint of the KeepTheScore API, with its parameters, request body and responses, generated from the live API.
Keys, tokens, request bodies and rate limits are explained in the API guide.
In the paths below, {token} is a board token when you send an API key, or one of the board's own tokens without one.
This page is generated from the live API. The same reference is available as OpenAPI 3 at
/apispec.json, if you'd rather generate a client than read tables.
Basketball
Toggle bonus for away team in basketball.
When show_double_bonus is enabled on the board, this cycles through three states: no bonus -> bonus -> double bonus -> no bonus When show_double_bonus is disabled, this performs a simple toggle: no bonus <-> bonus If double_bonus is active and the bonus is toggled off, double_bonus is also turned off.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | BonusToggledResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — BonusToggledResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
bonus |
boolean | yes | Whether the team is in the bonus now |
state |
string | yes | The team's bonus after the call: "none", "bonus" or "double_bonus" |
double_bonus |
boolean | no | Whether the team is in the double bonus now. Only on a board that shows the 2x bonus. |
Increment away team fouls for basketball.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Request body — IncrementRequest (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
amount |
integer | yes | How much to add. A negative number subtracts; the value stops at 0. |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Increment away team points for basketball.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Request body — IncrementRequest (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
amount |
integer | yes | How much to add. A negative number subtracts; the value stops at 0. |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Increment away team timeouts for basketball.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Request body — IncrementRequest (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
amount |
integer | yes | How much to add. A negative number subtracts; the value stops at 0. |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Toggle the FINAL state of a basketball scoreboard.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Toggle bonus for home team in basketball.
When show_double_bonus is enabled on the board, this cycles through three states: no bonus -> bonus -> double bonus -> no bonus When show_double_bonus is disabled, this performs a simple toggle: no bonus <-> bonus If double_bonus is active and the bonus is toggled off, double_bonus is also turned off.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | BonusToggledResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — BonusToggledResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
bonus |
boolean | yes | Whether the team is in the bonus now |
state |
string | yes | The team's bonus after the call: "none", "bonus" or "double_bonus" |
double_bonus |
boolean | no | Whether the team is in the double bonus now. Only on a board that shows the 2x bonus. |
Increment home team fouls for basketball.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Request body — IncrementRequest (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
amount |
integer | yes | How much to add. A negative number subtracts; the value stops at 0. |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Increment home team points for basketball.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Request body — IncrementRequest (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
amount |
integer | yes | How much to add. A negative number subtracts; the value stops at 0. |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Increment home team timeouts for basketball.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Request body — IncrementRequest (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
amount |
integer | yes | How much to add. A negative number subtracts; the value stops at 0. |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Increment period for basketball.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Request body — IncrementRequest (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
amount |
integer | yes | How much to add. A negative number subtracts; the value stops at 0. |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Toggle possession between home and away teams.
When toggling possession, one team gets possession and the other loses it.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Reset all game state to initial values for a new basketball game.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Adjust the timeout clock by a number of seconds.
A positive amount adds time, a negative one takes it off. Works while the clock waits or counts. It does not go below 0, and a clock that is counting or stopped does not go above the length it was loaded with.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Request body — AdjustSecondsRequest (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
amount |
integer | yes | Seconds to add (positive) or take off (negative) |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Load the board's full timeout length (1:00 unless changed) into the timeout clock.
The clock then waits for a start. Resetting a timeout that is counting ends it: the game clock and the period come back on the board.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Load the board's short timeout length (0:30 unless changed) into the timeout clock.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |
Start or stop the timeout clock.
While it counts, the board shows the countdown in place of the game clock. Starting it stops the game clock (and the shot clock) if they are running. A timeout that ran out starts again from the same length. Answers 400 when the clock is at 0:00 with nothing loaded, or when the board has the timeout clock switched off.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | yes |
Responses
| Status | Meaning | Error codes | Body |
|---|---|---|---|
200 |
OK | — | MessageResponse |
400 |
Malformed request | — | — |
403 |
This token does not allow the board to be edited | — | — |
404 |
Board not found | — | — |
429 |
Too many requests | — | — |
500 |
Internal server error | — | — |
Response body (200) — MessageResponse (JSON)
| Field | Type | Always present | Description |
|---|---|---|---|
message |
string | yes | Status message |