Open this on a computer

The Sample Bot API site is made for a computer, where you write code. Visit api.samplebot.app on your computer.

Back to samplebot.app

Sample Bot API

Bot API

Sessions and votes

10 endpoints. Every address starts with https://api.samplebot.app/v1/servers/{server id}.

GET/sessions/active sessions:read

The session running now, or null.

curl "https://api.samplebot.app/v1/servers/{server id}/sessions/active" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

Example data:

{
  "id": 81,
  "status": "ACTIVE",
  "startedBy": "1246251869798400001",
  "startedAt": "2026-11-11T18:00:00.000Z",
  "regionId": null
}

GET/sessions sessions:read

Past and present sessions, newest first.

NameInDescription
limitquery1 to 100, default 25
curl "https://api.samplebot.app/v1/servers/{server id}/sessions" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

GET/sessions/:id sessions:read

One session.

NameInDescription
id requiredpath
curl "https://api.samplebot.app/v1/servers/{server id}/sessions/{id}" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

POST/sessions/start sessions:write

Start a session in the session channel.

NameInDescription
regionIdbodyan area to run the session in (optional)
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/sessions/start" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

POST/sessions/status sessions:write

Mark the session ACTIVE, FULL or BOOST.

NameInDescription
status requiredbodyACTIVE, FULL or BOOST
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/sessions/status" \
  -H "Authorization: Bearer $SAMPLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"..."}'

POST/sessions/end sessions:write

End the session (and any open vote).

curl -X POST "https://api.samplebot.app/v1/servers/{server id}/sessions/end" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

GET/votes/active sessions:read

Open session votes, with how many have voted.

curl "https://api.samplebot.app/v1/servers/{server id}/votes/active" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

GET/votes sessions:read

Past votes, newest first.

NameInDescription
limitquery1 to 100
curl "https://api.samplebot.app/v1/servers/{server id}/votes" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"

POST/votes/start sessions:write

Open a public session vote.

NameInDescription
votesNeeded requiredbodyvotes needed to start
regionIdbodyoptional area
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/votes/start" \
  -H "Authorization: Bearer $SAMPLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"votesNeeded":30}'

POST/votes/:id/cancel sessions:write

Call a vote off.

NameInDescription
id requiredpath
curl -X POST "https://api.samplebot.app/v1/servers/{server id}/votes/{id}/cancel" \
  -H "Authorization: Bearer $SAMPLE_API_KEY"