Docs
Create Resource State
POST /resource-states
POST
/resource-statesRequired Tokens
| Field | Type | Required | Description |
|---|---|---|---|
| Bearer | Authorization: Bearer <api-key> | Optional | Your API key. Pass it as the Bearer token on every request. |
| Event token | x-Event-Token | Optional | Run **Get Tokens** in the Authorization folder, or call `GET /Events/{eventId}/authorize` manually. |
Adds a new resource state to the event's state catalog. Use this before creating rule thresholds that transition into this state. sortOrder is auto-populated to max + 1 among existing states.
Event scoping: This endpoint does not include {eventId} in the URL. The event is determined automatically from your x-Event-Token.
Requires EventSettings permission on the event.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Display name, e.g. `Overtime`. Must not be empty. |
| category | string | Required | One of `Regular`, `Premium`, `Penalty`, `Violation`. |
| color | string? | Optional | Hex color or token for calendar backgrounds. |
Example Request
{
"name": "Overtime",
"category": "Premium",
"color": "#F59E0B"
}
Response
201 Created — The response body is the new state's Guid.
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid token. |
BAD_REQUEST | 400 | Name empty, or category not one of the four valid values. |