Preview swap cancellation
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/cancel/preview"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"operationId\": \"example\", \"expectedRevision\": 1, \"acknowledgedConflictIds\": [ \"example\" ], \"acknowledgedStartedLegKeys\": [ \"example\" ] }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json-patch+json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/cancel/preview"
payload := strings.NewReader("{ \"operationId\": \"example\", \"expectedRevision\": 1, \"acknowledgedConflictIds\": [ \"example\" ], \"acknowledgedStartedLegKeys\": [ \"example\" ] }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json-patch+json");RequestBody body = RequestBody.create(mediaType, "{ \"operationId\": \"example\", \"expectedRevision\": 1, \"acknowledgedConflictIds\": [ \"example\" ], \"acknowledgedStartedLegKeys\": [ \"example\" ] }");Request request = new Request.Builder() .url("https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/cancel/preview") .post(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json-patch+json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/cancel/preview', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'}, data: '{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ] }'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/cancel/preview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'}, body: '{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ] }'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.
object
A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.
The request revision reviewed by the caller.
Current conflict identifiers acknowledged for the interval this caller would receive.
Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.
Examplegenerated
{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ]}The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.
object
A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.
The request revision reviewed by the caller.
Current conflict identifiers acknowledged for the interval this caller would receive.
Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.
Examplegenerated
{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ]}The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.
object
A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.
The request revision reviewed by the caller.
Current conflict identifiers acknowledged for the interval this caller would receive.
Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.
Examplegenerated
{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ]}The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.
object
A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.
The request revision reviewed by the caller.
Current conflict identifiers acknowledged for the interval this caller would receive.
Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.
Examplegenerated
{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ]}Responses
Section titled “Responses”OK
Assignments after cancelling an accepted swap, evaluated at asOfUtc. complete is true when every remaining interval has a complete restoration preview.
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
Effective duty during part of an assignment interval.
object
The inclusive UTC start.
The exclusive UTC end.
Slack user identifiers of the effective holders. An empty list means no assignee only when resolved is true.
Whether the holders or absence of duty are known for this interval.
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}