Create a session status
US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com
Create a new custom session status. Requires the write:metadata
scope.
Unlike the other metadata endpoints, name alone is not enough.
color and status are stored NOT NULL with no defaults, so all three
are required; a payload missing either answers
400 VALIDATION_ERROR naming the field.
status is the underlying approval state this custom label maps onto —
several labels may share one. It must be one of the five values below;
anything else is a 400, not a 500.
Request example
curl --request POST \ --url 'https://public-api.sessionboard.com/v1/event/{eventId}/statuses/create' \ --header 'x-access-token: <api-token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "<string>", "color": "<string>", "status": "pending"}'const response = await fetch('https://public-api.sessionboard.com/v1/event/{eventId}/statuses/create', { method: 'POST', headers: { "x-access-token": "<api-token>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "<string>", "color": "<string>", "status": "pending" }),});
const data = await response.json();console.log(data);import requests
response = requests.request( "POST", "https://public-api.sessionboard.com/v1/event/{eventId}/statuses/create", headers={ "x-access-token": "<api-token>", "Content-Type": "application/json" }, json={ "name": "<string>", "color": "<string>", "status": "pending" },)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://public-api.sessionboard.com/v1/event/{eventId}/statuses/create", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{ "name": "<string>", "color": "<string>", "status": "pending"}', CURLOPT_HTTPHEADER => [ "x-access-token: <api-token>", "Content-Type: application/json", ],]);
$response = curl_exec($curl);curl_close($curl);
echo $response;package main
import ( "fmt" "io" "net/http" "strings")
func main() { req, _ := http.NewRequest("POST", "https://public-api.sessionboard.com/v1/event/{eventId}/statuses/create", strings.NewReader(`{ "name": "<string>", "color": "<string>", "status": "pending"}`)) req.Header.Add("x-access-token", "<api-token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://public-api.sessionboard.com/v1/event/{eventId}/statuses/create")) .header("x-access-token", "<api-token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"<string>\",\n \"color\": \"<string>\",\n \"status\": \"pending\"\n}")) .build();
HttpResponse<String> response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Try it
Response headers
Authorizations
x-access-tokenstringheaderOrganization API token. Generate from Organization Settings → API Tokens.
AuthorizationBearer <token>headerorOAuth 2.1 access token. Obtained via the OAuth PKCE flow at
/oauth/token.
Send one of these. See Authentication.
Path parameters
eventIdintegerpathrequired
Request body
namestringrequiredcolorstringrequiredstatusstringrequiredApproval state this custom status maps onto.
- Allowed values
"pending", "accepted", "declined", "accept_queue", "decline_queue"
{ "name": "<string>", "color": "<string>", "status": "pending"}Responses
201application/json
Status created
A custom session status definition configured for an event.
idstringnamestringstatusstringApproval state this custom label maps onto. Stored NOT NULL, so it is always present on a status created through this API.
- Allowed values
"pending", "accepted", "declined", "accept_queue", "decline_queue"
status_namestring | nullcolorstringorderintegeris_custombooleancreated_atstring | nullcreated_by_user_idinteger | nullcreated_by_user_namestring | null
400
Missing name, color or status, or a status outside the enum
401
Unauthorized
403
Missing write:metadata scope
Response examples
{ "id": "<string>", "name": "<string>", "status": "pending", "status_name": "<string>", "color": "<string>", "order": 123, "is_custom": true, "created_at": "<string>", "created_by_user_id": 123, "created_by_user_name": "<string>"}