Skip to content

Preview a duty arrangement

POST
/v1/rotations/{rotationId}/duty-arrangements/preview
curl --request POST \
--url https://api.roundrobinbot.eu/v1/rotations/example/duty-arrangements/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '{ "operationId": "example", "cellId": "example", "userId": "example", "from": "2026-04-15T12:00:00Z", "to": "2026-04-15T12:00:00Z", "expectedRevision": 1, "turnSelection": { "kind": "example", "from": "2026-04-15T12:00:00Z", "to": "2026-04-15T12:00:00Z" }, "acknowledgedConflictIds": [ "example" ] }'

Requires read:oncall and permission to assign duty for the selected cell. No duty changes. Send UTC terms and the editor’s acknowledged conflict identifiers. Inspect canCommit and conflicts. For a change, include arrangementId and its current expectedRevision. The write rechecks authority, terms and conflicts; preview does not reserve the interval.

rotationId
required
string

The rotation identifier.

arrangementId
string

The existing direct assignment when previewing a change; omit for a new assignment.

Request cancellation.

Terms for a direct assignment or its preview.

object
operationId

A nonempty operation identifier of at most 128 characters, required for writes. Reuse it only to retry the same write.

string
cellId

The rotation cell receiving the assignment.

string
userId

The Slack user identifier of a person in the cell’s lane.

string
from

The requested inclusive UTC start. A current assignment begins at the actual transition time.

string format: date-time
to

The exclusive UTC end, later than both the start and the write’s transition time.

string format: date-time
expectedRevision

The current arrangement revision when changing an existing assignment or previewing that change.

null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
turnSelection
One of:
null
acknowledgedConflictIds

Conflict identifiers explicitly acknowledged by the rotation editor.

Array<string>
Examplegenerated
{
"operationId": "example",
"cellId": "example",
"userId": "example",
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"expectedRevision": 1,
"turnSelection": {
"kind": "example",
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z"
},
"acknowledgedConflictIds": [
"example"
]
}

OK

Media typeapplication/json

Conflict evaluation for the proposed terms. A preview does not change duty.

object
effectiveFrom
required

The later of the requested start and preview time. The actual write can begin later.

string format: date-time
to
required

The requested exclusive UTC end.

string format: date-time
conflicts
required

Observed conflicts and source uncertainties.

Array<object>

A conflict or an uncertainty affecting the proposed assignment.

object
id
required

The acknowledgment identifier for this conflict and the previewed terms.

string
type
required

absence, sameCellArrangement or unknownAvailability.

string
userId
required

The affected person’s Slack user identifier.

string
from
required

The inclusive UTC start of the conflict intersection with the requested interval.

string format: date-time
to
required

The exclusive UTC end of the conflict intersection with the requested interval.

string format: date-time
source
required

arrangement, manualAvailability, googleCalendar or slackStatus.

string
canAcknowledge
required

Whether explicit acknowledgment permits proceeding with this conflict. False means the conflict blocks the write.

boolean
canCommit
required

Whether every observed conflict permits acknowledgment and has been acknowledged. The write rechecks current state.

boolean
turnSelection
One of:
null
Examplegenerated
{
"effectiveFrom": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"conflicts": [
{
"id": "example",
"type": "example",
"userId": "example",
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"source": "example",
"canAcknowledge": true
}
],
"canCommit": true,
"turnSelection": {
"kind": "example",
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z"
}
}