Skip to content

End a duty arrangement

POST
/v1/rotations/{rotationId}/duty-arrangements/{arrangementId}/end
curl --request POST \
--url https://api.roundrobinbot.eu/v1/rotations/example/duty-arrangements/example/end \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--header 'If-Match: example' \
--data '{ "operationId": "example", "expectedRevision": 1 }'

Requires write:duty, rotation edit authority, If-Match and the current arrangement revision. Ends only the unserved portion of a direct assignment. Completed service stays unchanged. Accepted cover and swap legs return 409 with repairNotSupported; an elapsed interval returns 409 with arrangementEnded. Read the current arrangement before retrying a stale revision or rotation ETag. Reuse the operation ID only for an identical retry. Success returns 200 and the rotation ETag. The resulting duty is determined by the underlying schedule and availability.

rotationId
required
string

The rotation identifier.

arrangementId
required
string

The active direct assignment to end.

If-Match
required
string

The ETag from your last read of this resource, sent back exactly as you received it, quotes included. The write happens only if nothing changed in between: a stale validator is answered 412 and nothing is written. Send * to write against whatever is current on purpose. Omitting the header is 428, never an unconditional write. https://docs.roundrobinbot.eu/api/conventions/#conditional-writes

Request cancellation.

End the unserved portion of a direct assignment.

object
operationId

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

string
expectedRevision

The current revision of the arrangement being ended.

integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
Examplegenerated
{
"operationId": "example",
"expectedRevision": 1
}

OK

Media typeapplication/json

The committed assignment result for an operation.

object
operationId
required

The submitted operation identifier.

string
rotationVersion
required

The committed rotation version, also returned as an ETag.

integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
effectiveFrom
required

The actual prospective transition start.

string format: date-time
arrangements
required

The arrangements changed by the operation, including cancelled records and any replacement.

Array<object>

An interval assignment. Its recorded terms remain distinct from actual served history.

object
id
required

The arrangement identifier.

string
rotationId
required

The rotation identifier.

string
cellId
required

The rotation cell identifier.

string
userId
required

The assigned person’s Slack user identifier.

string
from
required

The inclusive UTC start.

string format: date-time
to
required

The exclusive UTC end.

string format: date-time
revision
required

The arrangement revision used when changing or ending it.

integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
state
required

active or cancelled. An active record can describe an interval that has already ended.

string
kind
required

directAssignment, acceptedCover or swapLeg. Direct-assignment writes change or end only directAssignment.

string
origin
One of:
null
originalSnapshot
One of:
null
turnSelection
One of:
null
deliveryState
required

pending or published for change-event publication. Neither value confirms that a Slack message has arrived.

string
Examplegenerated
{
"operationId": "example",
"rotationVersion": 1,
"effectiveFrom": "2026-04-15T12:00:00Z",
"arrangements": [
{
"id": "example",
"rotationId": "example",
"cellId": "example",
"userId": "example",
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"revision": 1,
"state": "example",
"kind": "example",
"origin": {
"userIds": [
"example"
],
"complete": true
},
"originalSnapshot": {
"asOfUtc": "2026-04-15T12:00:00Z",
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"complete": true,
"segments": [
{
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"userIds": [
"example"
],
"resolved": true
}
]
},
"turnSelection": {
"kind": "example",
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z"
}
}
],
"deliveryState": "example"
}