Create an event rule
US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com
Create a scheduling constraint. Requires the write:events scope.
Request example
curl --request POST \ --url 'https://public-api.sessionboard.com/v1/event/{eventId}/rules/create' \ --header 'x-access-token: <api-token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "<string>", "type": "<string>", "config": {}, "enabled": true}'const response = await fetch('https://public-api.sessionboard.com/v1/event/{eventId}/rules/create', { method: 'POST', headers: { "x-access-token": "<api-token>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "<string>", "type": "<string>", "config": {}, "enabled": true }),});
const data = await response.json();console.log(data);import requests
response = requests.request( "POST", "https://public-api.sessionboard.com/v1/event/{eventId}/rules/create", headers={ "x-access-token": "<api-token>", "Content-Type": "application/json" }, json={ "name": "<string>", "type": "<string>", "config": {}, "enabled": True },)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://public-api.sessionboard.com/v1/event/{eventId}/rules/create", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{ "name": "<string>", "type": "<string>", "config": {}, "enabled": true}', 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}/rules/create", strings.NewReader(`{ "name": "<string>", "type": "<string>", "config": {}, "enabled": true}`)) 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}/rules/create")) .header("x-access-token", "<api-token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"config\": {},\n \"enabled\": true\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
namestringrequiredtypestringrequiredconfigobjectenabledboolean- Default
true
{ "name": "<string>", "type": "<string>", "config": {}, "enabled": true}Responses
200application/json
Rule created
A scheduling constraint or validation rule for an event.
idstring<uuid>event_idintegernamestringtypestringconfigobjectenabledbooleancreated_atstring<date-time>updated_atstring<date-time>
401
Unauthorized
403
Missing write:events scope
Response examples
{ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "event_id": 123, "name": "<string>", "type": "<string>", "config": {}, "enabled": true, "created_at": "2026-01-15T09:30:00Z", "updated_at": "2026-01-15T09:30:00Z"}