Skip to content

Preview swap cancellation

POST
/v1/rotations/{rotationId}/swap-requests/{requestId}/cancel/preview
curl --request POST \
--url https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/cancel/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ] }'

Requires a Slack member access token and the current expectedRevision for an accepted request. Returns the assignments after cancelling the remaining swap intervals, without changing duty. Completed intervals remain unchanged. Check complete before presenting a restoration result. If the result is incomplete, refresh the preview; do not substitute the original participants as returning holders. Use the returned ETag as If-Match when cancelling.

rotationId
required
string
requestId
required
string

The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.

object
operationId

A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.

string
expectedRevision

The request revision reviewed by the caller.

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

Current conflict identifiers acknowledged for the interval this caller would receive.

Array<string>
acknowledgedStartedLegKeys

Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.

Array<string>
Examplegenerated
{
"operationId": "example",
"expectedRevision": 1,
"acknowledgedConflictIds": [
"example"
],
"acknowledgedStartedLegKeys": [
"example"
]
}

OK

Media typeapplication/json

Assignments after cancelling an accepted swap, evaluated at asOfUtc. complete is true when every remaining interval has a complete restoration preview.

object
asOfUtc
required
string format: date-time
requestRevision
required
integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
legs
required
Array<object>

Restoration intervals for one side of a swap. completed means its duty has ended and remains unchanged. Completed intervals have no restoration segments. For remaining duty, complete identifies a complete result.

object
key
required
string
cellId
required
string
from
required
string format: date-time
to
required
string format: date-time
completed
required
boolean
complete
required
boolean
segments
required
Array<object>

Effective duty during part of an assignment interval.

object
from
required

The inclusive UTC start.

string format: date-time
to
required

The exclusive UTC end.

string format: date-time
userIds
required

Slack user identifiers of the effective holders. An empty list means no assignee only when resolved is true.

Array<string>
resolved
required

Whether the holders or absence of duty are known for this interval.

boolean
complete
required
boolean
Examplegenerated
{
"asOfUtc": "2026-04-15T12:00:00Z",
"requestRevision": 1,
"legs": [
{
"key": "example",
"cellId": "example",
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"completed": true,
"complete": true,
"segments": [
{
"from": "2026-04-15T12:00:00Z",
"to": "2026-04-15T12:00:00Z",
"userIds": [
"example"
],
"resolved": true
}
]
}
],
"complete": true
}