Docs

Create Resource State

POST /resource-states

POST/resource-states

Required Tokens

FieldTypeRequiredDescription
BearerAuthorization: Bearer <api-key>OptionalYour API key. Pass it as the Bearer token on every request.
Event tokenx-Event-TokenOptionalRun **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

FieldTypeRequiredDescription
namestringRequiredDisplay name, e.g. `Overtime`. Must not be empty.
categorystringRequiredOne of `Regular`, `Premium`, `Penalty`, `Violation`.
colorstring?OptionalHex 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

CodeHTTP StatusDescription
UNAUTHORIZED401Missing or invalid token.
BAD_REQUEST400Name empty, or category not one of the four valid values.