Delete a rotation
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Delete, RequestUri = new Uri("https://api.roundrobinbot.eu/v1/rotations/example"), Headers = { { "If-Match", "example" }, { "Authorization", "Bearer <token>" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.roundrobinbot.eu/v1/rotations/example"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("If-Match", "example") req.Header.Add("Authorization", "Bearer <token>")
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();
Request request = new Request.Builder() .url("https://api.roundrobinbot.eu/v1/rotations/example") .delete(null) .addHeader("If-Match", "example") .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'DELETE', url: 'https://api.roundrobinbot.eu/v1/rotations/example', headers: {'If-Match': 'example', Authorization: 'Bearer <token>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.roundrobinbot.eu/v1/rotations/example';const options = { method: 'DELETE', headers: {'If-Match': 'example', Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.roundrobinbot.eu/v1/rotations/example \ --header 'Authorization: Bearer <token>' \ --header 'If-Match: example'Removes the rotation and everything that hangs off it: whoever was on duty comes off duty, the on-duty user group is emptied, the channel topic is put back and the calendar entries go. It answers 204 with no body, and a second delete of the same rotation answers 404. If-Match is required, as it is on every write here, and a validator that has been spent is refused with 412. A delete cannot be corrected by sending it again, so a caller working from a stale read is stopped rather than allowed to remove a rotation that has changed since they looked at it. Read the rotation, then send its ETag. There is no undelete. A rotation you may want back is better disabled, with PATCH /v1/rotations/{rotationId} and enabled: false: it keeps its configuration and its history, holds whoever was on duty, and hands over to nobody.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”The ETag from your last read of this rotation, 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
Responses
Section titled “Responses”No Content
Bad Request
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Unauthorized
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Precondition Failed
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Precondition Required
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}