{"openapi":"3.1.0","info":{"title":"Shiftkeeper API","description":"API reference to interact with Shiftkeeper programatically","version":"0.0.1"},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Enter your API key which starts with 'keeper_'"}},"schemas":{"Schedule":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the schedule."},"description":{"type":"string","maxLength":500,"description":"The description of the schedule."},"time_zone":{"type":"string","description":"The IANA time zone of the schedule."},"layers":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleLayer"},"description":"The layers of the schedule."},"teams":{"type":"array","items":{"$ref":"#/components/schemas/Team"},"description":"The teams linked to the schedule."},"current_revision":{"type":"integer","minimum":0,"description":"The current revision of the schedule. A new revision is created every time the schedule layer configuration is changed."},"current_revision_valid_from":{"type":"string","format":"date-time","description":"The timestamp that marks the start of the current revision."},"current_oncall_shift":{"$ref":"#/components/schemas/ScheduleShift","description":"The current on-call shift for the schedule."},"next_oncall_shift":{"$ref":"#/components/schemas/ScheduleShift","description":"The next on-call shift for the schedule."},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"The users in the schedule. The order does not necessarily match rotation order."}},"required":["name","time_zone","layers","teams","current_revision","current_revision_valid_from","users"],"examples":[{"name":"Incident responders","description":"Incident responders","time_zone":"Europe/Berlin","layers":[{"name":"Main","rotation_start":"2024-01-01T00:00:00Z","concurrent_oncall_users":1,"users":[{"id":"usr_bq7CmsOKLmkMeZkUUu1hy","name":"Rick","email":"rick@example.org","time_zone":"Europe/Paris","role":"owner","seat":"member","slack_id":"U082KENSEQ3"},{"id":"usr_C0GwCFdk0I4pBMRny4qYV","name":"Dena","email":"dena@example.org","role":"standard","seat":"member","slack_id":"U082GMAFR1T"},{"id":"usr_YlxrjoB1JqUsollScfFYT","name":"Lily","email":"lily@example.org","time_zone":"America/New_York","role":"standard","seat":"viewer","slack_id":"U0529FWNCG2"}],"shift_length":{"amount":1,"unit":"weeks"},"restriction_intervals":[]}],"current_revision":1,"current_revision_valid_from":"2024-12-01T00:00:00Z","current_oncall_shift":{"users":[{"id":"usr_bq7CmsOKLmkMeZkUUu1hy","name":"Rick","email":"rick@example.org","time_zone":"Europe/Paris","role":"owner","seat":"member","slack_id":"U082KENSEQ3"}],"start":"2024-01-01T00:00:00Z","end":"2024-01-01T01:00:00Z"},"next_oncall_shift":{"users":[{"id":"usr_C0GwCFdk0I4pBMRny4qYV","name":"Dena","email":"dena@example.org","role":"standard","seat":"member","slack_id":"U082GMAFR1T"}],"start":"2024-01-01T01:00:00Z","end":"2024-01-01T02:00:00Z"},"users":[{"id":"usr_bq7CmsOKLmkMeZkUUu1hy","name":"Rick","email":"rick@example.org","time_zone":"Europe/Paris","role":"owner","seat":"member","slack_id":"U082KENSEQ3"},{"id":"usr_C0GwCFdk0I4pBMRny4qYV","name":"Dena","email":"dena@example.org","role":"standard","seat":"member","slack_id":"U082GMAFR1T"},{"id":"usr_YlxrjoB1JqUsollScfFYT","name":"Lily","email":"lily@example.org","time_zone":"America/New_York","role":"standard","seat":"viewer","slack_id":"U0529FWNCG2"}],"teams":[{"id":"tea_VJ4sYEOOXVvJBXqFjRzpm","name":"Payments","description":"All about payments and billing"}]}]},"ScheduleLayer":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the schedule layer."},"rotation_start":{"type":"string","format":"date-time","description":"The start date and time of the rotation. ISO 8601 format, UTC timezone."},"concurrent_oncall_users":{"type":"integer","minimum":1,"maximum":4,"description":"The number of concurrent on-call users for this layer."},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"The rotation users in the schedule layer. The order of the users in the array determines the round-robin rotation order. A user can appear multiple times in the rotation."},"shift_length":{"type":"object","properties":{"amount":{"type":"integer","minimum":1},"unit":{"type":"string","enum":["hours","days","weeks"]}},"required":["amount","unit"],"description":"Determines how often shifts are rotated."},"restriction_intervals":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleLayerRestrictionInterval"},"maxItems":35,"description":"Determines the time intervals that the layer is restricted to. Useful if you want to limit the on-call hours to specific times, e.g., only during business hours. If not provided, the layer is unrestricted and covers everyday of the week."}},"required":["name","rotation_start","concurrent_oncall_users","users","shift_length"]},"User":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the user."},"name":{"type":"string","description":"The name of the user."},"email":{"type":"string","format":"email","description":"The email of the user."},"time_zone":{"type":"string","description":"The preferred time zone of the user. If not set, the organization's time zone will be used."},"role":{"type":"string","enum":["owner","admin","standard"],"description":"The role of the user. Learn more about roles in [our docs](/shiftkeeper/workspace/users#roles)."},"seat":{"type":"string","enum":["viewer","member"],"description":"The seat of the user. Learn more about seat in [our docs](/shiftkeeper/workspace/users#seats)."},"slack_id":{"type":"string","description":"The Slack ID of the user."}},"required":["id","name","email","role","seat"],"examples":[{"id":"usr_bq7CmsOKLmkMeZkUUu1hy","name":"Rick","email":"rick@example.org","time_zone":"Europe/Paris","role":"owner","seat":"member","slack_id":"U082KENSEQ3"},{"id":"usr_C0GwCFdk0I4pBMRny4qYV","name":"Dena","email":"dena@example.org","role":"standard","seat":"member","slack_id":"U082GMAFR1T"},{"id":"usr_YlxrjoB1JqUsollScfFYT","name":"Lily","email":"lily@example.org","time_zone":"America/New_York","role":"standard","seat":"viewer","slack_id":"U0529FWNCG2"}]},"ScheduleLayerRestrictionInterval":{"type":"object","properties":{"day":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"The day of the restriction interval."},"from":{"type":"string","description":"The start time of the restriction interval."},"to":{"type":"string","description":"The end time of the restriction interval."}},"required":["day","from","to"],"examples":[{"day":"monday","from":"09:00","to":"17:00"},{"day":"tuesday","from":"09:00","to":"17:00"},{"day":"wednesday","from":"09:00","to":"17:00"}]},"Team":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the team."},"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the team."},"description":{"type":"string","maxLength":200,"description":"The description of the team."}},"required":["id","name"],"examples":[{"id":"tea_VJ4sYEOOXVvJBXqFjRzpm","name":"Payments","description":"All about payments and billing"}]},"ScheduleShift":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"The users on-call for this shift."},"start":{"type":"string","format":"date-time","description":"The start time of the on-call shift."},"end":{"type":"string","format":"date-time","description":"The end time of the on-call shift."}},"required":["users","start","end"]},"PaginationMeta":{"type":"object","properties":{"total":{"type":"number","description":"The total number of items in the collection."},"page":{"type":"number","description":"The current page number."},"per_page":{"type":"number","description":"The number of items per page."}},"required":["total","page","per_page"],"examples":[{"total":100,"page":1,"per_page":20}]},"NotFoundError":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","const":404},"code":{"type":"string","const":"not_found"}},"required":["message","status","code"],"example":{"code":"not_found","status":404,"message":"The requested resource was not found"}},"NewSchedule":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the schedule."},"description":{"type":"string","maxLength":500,"description":"The description of the schedule."},"time_zone":{"type":"string","description":"The time zone of the schedule. Must be a valid IANA time zone. Note that the time zone cannot be changed after the schedule is created."},"layers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the schedule layer."},"rotation_start":{"type":"string","format":"date-time","description":"The start date and time of the rotation. ISO 8601 format, UTC timezone."},"concurrent_oncall_users":{"type":"integer","minimum":1,"maximum":4,"description":"The number of concurrent on-call users for this layer."},"user_references":{"type":"array","items":{"$ref":"#/components/schemas/UserReference"},"maxItems":50,"description":"The rotation users in the schedule layer. The order of the users in the array determines the round-robin rotation order. A user can appear multiple times in the rotation."},"shift_length":{"type":"object","properties":{"amount":{"type":"integer","minimum":1},"unit":{"type":"string","enum":["hours","days","weeks"]}},"required":["amount","unit"],"description":"Determines how often shifts are rotated."},"restriction_intervals":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleLayerRestrictionInterval"},"maxItems":35,"description":"Determines the time intervals that the layer is restricted to. Useful if you want to limit the on-call hours to specific times, e.g., only during business hours. If not provided, the layer is unrestricted and covers everyday of the week."}},"required":["name","rotation_start","concurrent_oncall_users","user_references","shift_length"]},"minItems":1,"maxItems":1,"description":"The layers of the schedule. Currently, schedules can have only one layer."},"team_ids":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teams to link to the schedule."}},"required":["name","time_zone","layers","team_ids"],"examples":[{"name":"Incident responders","description":"Incident responders","time_zone":"Europe/Berlin","layers":[{"name":"Main","rotation_start":"2024-01-01T00:00:00Z","concurrent_oncall_users":1,"user_references":[{"type":"email","value":"rick@example.org"},{"type":"email","value":"dena@example.org"},{"type":"email","value":"lily@example.org"}],"shift_length":{"amount":1,"unit":"weeks"}}],"team_ids":["tea_VJ4sYEOOXVvJBXqFjRzpm"]}]},"UserReference":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"email"},"value":{"type":"string","format":"email"}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","const":"slack_user_id"},"value":{"type":"string"}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","const":"internal_user_id"},"value":{"type":"string"}},"required":["type","value"]}],"examples":[{"type":"email","value":"emma@example.org"},{"type":"email","value":"lily@example.org"},{"type":"email","value":"rick@example.org"},{"type":"slack_user_id","value":"U082KENSEQ3"},{"type":"internal_user_id","value":"usr_bq7CmsOKLmkMeZkUUu1hy"}]},"ForbiddenError":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","const":403},"code":{"type":"string","const":"forbidden"}},"required":["message","status","code"],"example":{"code":"forbidden","status":403,"message":"You do not have permission to perform this action"}},"UnprocessableEntityError":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","const":422},"code":{"type":"string","const":"unprocessable_entity"}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}},"UpdateSchedule":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the schedule."},"description":{"type":"string","maxLength":500,"description":"The description of the schedule."},"layers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the schedule layer."},"rotation_start":{"type":"string","format":"date-time","description":"The start date and time of the rotation. ISO 8601 format, UTC timezone."},"concurrent_oncall_users":{"type":"integer","minimum":1,"maximum":4,"description":"The number of concurrent on-call users for this layer."},"user_references":{"type":"array","items":{"$ref":"#/components/schemas/UserReference"},"maxItems":50,"description":"The rotation users in the schedule layer. The order of the users in the array determines the round-robin rotation order. A user can appear multiple times in the rotation."},"shift_length":{"type":"object","properties":{"amount":{"type":"integer","minimum":1},"unit":{"type":"string","enum":["hours","days","weeks"]}},"required":["amount","unit"],"description":"Determines how often shifts are rotated."},"restriction_intervals":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleLayerRestrictionInterval"},"maxItems":35,"description":"Determines the time intervals that the layer is restricted to. Useful if you want to limit the on-call hours to specific times, e.g., only during business hours. If not provided, the layer is unrestricted and covers everyday of the week."}},"required":["name","rotation_start","concurrent_oncall_users","user_references","shift_length"]},"minItems":1,"maxItems":1,"description":"The layers of the schedule. Currently, schedules can have only one layer."},"team_ids":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teams to link to the schedule."}},"examples":[{"name":"Incident responders","team_ids":["tea_VJ4sYEOOXVvJBXqFjRzpm"]}]},"InternalServerError":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","const":500},"code":{"type":"string","const":"internal_server_error"}},"required":["message","status","code"],"example":{"code":"internal_server_error","status":500,"message":"An internal server error occurred"}},"ScheduleOverride":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the override."},"start":{"type":"string","format":"date-time","description":"The start date and time of the override."},"end":{"type":"string","format":"date-time","description":"The end date and time of the override."},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"The on-call users during the override."}},"required":["id","start","end","users"],"examples":[{"id":"ovr_i9fo8GI1YBAQhtoArC3N1","start":"2024-12-01T00:00:00Z","end":"2024-12-08T00:00:00Z","users":[{"id":"usr_C0GwCFdk0I4pBMRny4qYV","name":"Dena","email":"dena@example.org","role":"standard","seat":"member","slack_id":"U082GMAFR1T"}]}]},"NewScheduleOverride":{"type":"object","properties":{"start":{"type":"string","format":"date-time","description":"The start date and time of the override. ISO 8601 format, UTC timezone."},"end":{"type":"string","format":"date-time","description":"The end date and time of the override. ISO 8601 format, UTC timezone."},"user_references":{"type":"array","items":{"$ref":"#/components/schemas/UserReference"},"minItems":1,"maxItems":4,"description":"The users that that will be on-call during the override."}},"required":["start","end","user_references"],"examples":[{"start":"2024-12-01T00:00:00Z","end":"2024-12-08T00:00:00Z","user_references":[{"type":"email","value":"dena@example.org"}]}]},"NewSlackUserGroup":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the user group."},"handle":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","minLength":1,"maxLength":60,"description":"The handle of the user group."},"description":{"type":"string","maxLength":140,"description":"The description of the user group."}},"required":["name","handle"],"examples":[{"name":"Incident responders","handle":"incident-responders"}]},"ScheduleSlackUserGroup":{"type":"object","properties":{"id":{"type":"string","description":"The Slack ID of the user group."},"name":{"type":"string","description":"The name of the user group."},"handle":{"type":"string","description":"The handle of the user group."},"description":{"type":"string","description":"The description of the user group."}},"required":["id","name","handle"],"examples":[{"id":"S083J1KTL9X","name":"Incident responders","handle":"incident-responders"}]},"ScheduleSlackChannel":{"type":"object","properties":{"id":{"type":"string","description":"The Slack ID of the channel."},"name":{"type":"string","description":"The name of the channel."},"is_private":{"type":"boolean","description":"Whether the channel is private."}},"required":["id","name","is_private"],"examples":[{"id":"C082GMY1SJH","name":"general","is_private":false}]},"CoverageRequest":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the coverage request."},"reason":{"type":"string","description":"The reason for the coverage request."},"user":{"$ref":"#/components/schemas/User"},"status":{"type":"string","enum":["pending","accepted","canceled","expired"]},"shifts":{"type":"array","items":{"$ref":"#/components/schemas/CoverageShift"}},"accepted_by":{"$ref":"#/components/schemas/User"},"accepted_shifts":{"type":"array","items":{"$ref":"#/components/schemas/CoverageShift"}}},"required":["id","reason","user","status","shifts"],"examples":[{"id":"cov_RxQottluZ1oeM47nz4bVl","user":{"id":"usr_bq7CmsOKLmkMeZkUUu1hy","name":"Rick","email":"rick@example.org","time_zone":"Europe/Paris","role":"owner","seat":"member","slack_id":"U082KENSEQ3"},"reason":"I will be out of office during this week. Could someone jump in to cover these shifts?","status":"pending","shifts":[{"start":"2024-12-02T09:00:00Z","end":"2024-12-02T17:00:00Z","schedule_reference":{"id":"sch_KR5uoK0xD0rWQoKTDqwgu","name":"Portal support"}},{"start":"2024-12-03T09:00:00Z","end":"2024-12-03T17:00:00Z","schedule_reference":{"id":"sch_KR5uoK0xD0rWQoKTDqwgu","name":"Portal support"}},{"start":"2024-12-04T09:00:00Z","end":"2024-12-04T17:00:00Z","schedule_reference":{"id":"sch_KR5uoK0xD0rWQoKTDqwgu","name":"Portal support"}},{"start":"2024-12-05T09:00:00Z","end":"2024-12-05T17:00:00Z","schedule_reference":{"id":"sch_KR5uoK0xD0rWQoKTDqwgu","name":"Portal support"}},{"start":"2024-12-06T09:00:00Z","end":"2024-12-06T17:00:00Z","schedule_reference":{"id":"sch_KR5uoK0xD0rWQoKTDqwgu","name":"Portal support"}},{"start":"2024-12-01T00:00:00Z","end":"2024-12-08T00:00:00Z","schedule_reference":{"id":"sch_ldYmnBVr5o2ikebwmRRZv","name":"Citadel"}}]}]},"CoverageShift":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"},"schedule_reference":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["start","end","schedule_reference"]},"ScheduleReference":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the schedule.","examples":["sch_oKjoLJUl47g7OYYVPUG5t","sch_kje7ER643ED0STVnB8Zc9"]},"name":{"type":"string","description":"The name of the schedule."}},"required":["id","name"],"examples":[{"id":"sch_xX8gfURsJtt0u9lCOAPMH","name":"Incident responders"}]},"NewCoverageRequest":{"type":"object","properties":{"start":{"type":"string","format":"date-time","description":"The start date and time of the interval you need coverage for."},"end":{"type":"string","format":"date-time","description":"The end date and time of the interval you need coverage for."},"reason":{"type":"string","minLength":1,"maxLength":300,"description":"The reason you need coverage."},"schedule_ids":{"type":"array","items":{"type":"string"},"description":"You can optionally limit the coverage request to specific schedules. If not provided, the coverage request will include all schedules you are a member of."}},"required":["start","end","reason"],"examples":[{"start":"2024-12-01T00:00:00Z","end":"2024-12-08T00:00:00Z","reason":"I will be out of office during this week. Could someone jump in to cover these shifts?","schedule_ids":["sch_KR5uoK0xD0rWQoKTDqwgu","sch_ldYmnBVr5o2ikebwmRRZv"]}]},"NewTeam":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the team."},"description":{"type":"string","maxLength":200,"description":"The description of the team."}},"required":["name"],"examples":[{"name":"Payments","description":"All about payments and billing"}]}}},"paths":{"/schedules/":{"get":{"summary":"List schedules","tags":["Schedules"],"description":"List all schedules in your organization.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","description":"The number of items per page."},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","description":"The page number of the results to return."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schedules":{"type":"array","items":{"$ref":"#/components/schemas/Schedule"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["schedules","meta"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}},"post":{"summary":"Create a schedule","tags":["Schedules"],"description":"Create a new schedule.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewSchedule"}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/Schedule"}},"required":["schedule"]}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["duplicate_schedule_name","invalid_user_reference"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"duplicate_schedule_name","message":"A schedule with this name already exists","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#duplicate-schedule-name"}}}}}}}},"/schedules/{schedule_id}":{"get":{"summary":"Get a schedule","tags":["Schedules"],"description":"Get a schedule by its ID.","parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/Schedule"}},"required":["schedule"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}},"patch":{"summary":"Update a schedule","tags":["Schedules"],"description":"Update a schedule. Changes to the schedule rotation settings do not affect shifts which have already finished.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSchedule"}}}},"parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/Schedule"}},"required":["schedule"]}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["duplicate_schedule_name","invalid_user_reference"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"duplicate_schedule_name","message":"A schedule with this name already exists","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#duplicate-schedule-name"}}}}}}},"delete":{"summary":"Delete a schedule","tags":["Schedules"],"description":"Delete a schedule. This also removes the attached Slack user group, if there is one.","parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"204":{"description":"Schedule deleted successfully"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/InternalServerError"}},"required":["error"]}}}}}}},"/schedules/{schedule_id}/overrides/":{"get":{"summary":"List schedule overrides","tags":["Overrides"],"description":"List all schedule overrides in your organization.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","description":"The number of items per page."},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","description":"The page number of the results to return."},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"from","required":true},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"to","required":true},{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"overrides":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleOverride"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["overrides","meta"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}},"post":{"summary":"Override a schedule shift","tags":["Overrides"],"description":"Create a new schedule override.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewScheduleOverride"}}}},"parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"override":{"$ref":"#/components/schemas/ScheduleOverride"}},"required":["override"]}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}},"/schedules/{schedule_id}/overrides/{override_id}":{"get":{"summary":"Get a schedule override","tags":["Overrides"],"description":"Get a schedule override by its ID.","parameters":[{"schema":{"type":"string"},"in":"path","name":"override_id","required":true,"description":"The ID of the override."},{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"override":{"$ref":"#/components/schemas/ScheduleOverride"}},"required":["override"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}},"delete":{"summary":"Delete a schedule override","tags":["Overrides"],"description":"Delete a schedule override. Overrides that have already finished cannot be deleted.","parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."},{"schema":{"type":"string"},"in":"path","name":"override_id","required":true,"description":"The ID of the override."}],"responses":{"204":{"description":"Schedule override deleted successfully"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["override_already_finished"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"override_already_finished","message":"Override that have already finished cannot be deleted","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#override-already-finished"}}}}}}}},"/schedules/{schedule_id}/shifts/":{"get":{"summary":"List schedule shifts","tags":["Schedules"],"description":"List all shifts for a schedule within a given time interval.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","description":"The number of items per page."},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","description":"The page number of the results to return."},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"from","required":true},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"to","required":true},{"schema":{"type":"boolean"},"in":"query","name":"clip_to_interval"},{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"shifts":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleShift"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["shifts","meta"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}},"/schedules/{schedule_id}/slack_user_group/":{"put":{"summary":"Attach or update the Slack user group for a schedule","tags":["Schedules"],"description":"Attach a Slack user group to a schedule. If the schedule already has a Slack user group attached, it will be updated.\n\nNote that user groups are available only in paid Slack plans.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewSlackUserGroup"}}}},"parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user_group":{"$ref":"#/components/schemas/ScheduleSlackUserGroup"}},"required":["user_group"]}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["slack_group_permission_denied","slack_group_only_available_for_paid_teams","slack_group_duplicate_name","slack_group_duplicate_handle_name"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"slack_group_only_available_for_paid_teams","message":"User groups are available only on paid Slack plans. Unfortunately, your current Slack plan does not support them.","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#slack-group-only-available-for-paid-teams"}}}}}}},"get":{"summary":"Get the Slack user group for a schedule","tags":["Schedules"],"description":"Get the Slack user group attached to the schedule.","parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user_group":{"$ref":"#/components/schemas/ScheduleSlackUserGroup"}},"required":["user_group"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}},"delete":{"summary":"Detach the Slack user group from a schedule","tags":["Schedules"],"description":"Detach the Slack user group from a schedule. The user group will be disabled, as Slack does not allow deleting user groups. If you attach a user group to the schedule in the future, the user group will be reused and re-enabled.","parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"204":{"description":"Slack user group detached from schedule"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["slack_group_permission_denied","slack_group_only_available_for_paid_teams"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"slack_group_only_available_for_paid_teams","message":"User groups are available only on paid Slack plans. Unfortunately, your current Slack plan does not support them.","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#slack-group-only-available-for-paid-teams"}}}}}}}},"/schedules/{schedule_id}/slack_channels/":{"get":{"summary":"List linked schedule Slack channels","tags":["Schedules"],"description":"List all Slack channels linked to a schedule.","parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"channels":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleSlackChannel"}}},"required":["channels"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}},"/schedules/{schedule_id}/slack_channels/{channel_id}":{"put":{"summary":"Link a Slack channel to a schedule","tags":["Schedules"],"description":"Link a Slack channel to a schedule. Shift and schedule related notifications will be sent to the channel. Both public and private channels are supported.","parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."},{"schema":{"type":"string"},"in":"path","name":"channel_id","required":true,"description":"The Slack ID of the channel."}],"responses":{"204":{"description":"Slack channel linked to schedule"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}},"delete":{"summary":"Unlink a Slack channel from a schedule","tags":["Schedules"],"description":"Unlink a Slack channel from a schedule. Once unlinked, schedule notifications will no longer be sent to that channel.","parameters":[{"schema":{"type":"string"},"examples":{"sch_oKjoLJUl47g7OYYVPUG5t":{"value":"sch_oKjoLJUl47g7OYYVPUG5t"},"sch_kje7ER643ED0STVnB8Zc9":{"value":"sch_kje7ER643ED0STVnB8Zc9"}},"in":"path","name":"schedule_id","required":true,"description":"The ID of the schedule."},{"schema":{"type":"string"},"in":"path","name":"channel_id","required":true,"description":"The Slack ID of the channel."}],"responses":{"204":{"description":"Slack channel unlinked from schedule"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}},"/coverage_requests/":{"get":{"summary":"List coverage requests","tags":["Coverage"],"description":"List all coverage requests in your organization.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","description":"The number of items per page."},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","description":"The page number of the results to return."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"coverage_requests":{"type":"array","items":{"$ref":"#/components/schemas/CoverageRequest"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["coverage_requests","meta"]}}}}}}},"/coverage_requests/{coverage_request_id}":{"get":{"summary":"Get a coverage request","tags":["Coverage"],"description":"Get a coverage request by its ID.","parameters":[{"schema":{"type":"string"},"examples":{"cov_RxQottluZ1oeM47nz4bVl":{"value":"cov_RxQottluZ1oeM47nz4bVl"},"cov_ldYmnBVr5o2ikebwmRRZv":{"value":"cov_ldYmnBVr5o2ikebwmRRZv"}},"in":"path","name":"coverage_request_id","required":true,"description":"The ID of the coverage request."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"coverage_request":{"$ref":"#/components/schemas/CoverageRequest"}},"required":["coverage_request"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}},"/coverage_requests/events/":{"post":{"summary":"Accept or decline a coverage request","tags":["Coverage"],"description":"Take an action on a coverage request. The coverage request must be in `pending` state.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["accept","decline"],"description":"The action you want to take on the coverage request"}},"required":["type"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"examples":{"cov_RxQottluZ1oeM47nz4bVl":{"value":"cov_RxQottluZ1oeM47nz4bVl"},"cov_ldYmnBVr5o2ikebwmRRZv":{"value":"cov_ldYmnBVr5o2ikebwmRRZv"}},"in":"path","name":"coverage_request_id","required":true,"description":"The ID of the coverage request."}],"responses":{"204":{"description":"Coverage request event created successfully"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["coverage_request_not_pending","coverage_request_self_owned"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"coverage_request_not_pending","message":"You cannot accept a coverage request that is not in pending state","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#coverage-request-not-pending"}}}}}}}},"/user/shifts/":{"get":{"summary":"List on-call shifts for the authenticated user","tags":["Shifts"],"description":"List all on-call shifts from all schedules of the authenticated user.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","description":"The number of items per page."},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","description":"The page number of the results to return."},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"from","required":true,"description":"The start date and time of the interval to list on-call shifts for."},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"to","required":true,"description":"The end date and time of the interval to list on-call shifts for."},{"schema":{"type":"boolean"},"in":"query","name":"clip_to_interval","description":"If set to `true`, the on-call shifts which go outside of the interval specified by `from` and `to` will be clipped to the interval bounds."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"shifts":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/ScheduleShift"}],"properties":{"schedule_reference":{"$ref":"#/components/schemas/ScheduleReference"}},"required":["schedule_reference"]}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["shifts","meta"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}},"/user/coverage_requests/":{"get":{"summary":"List coverage requests for the authenticated user","tags":["Coverage"],"description":"List all coverage requests for the authenticated user.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","description":"The number of items per page."},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","description":"The page number of the results to return."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"coverage_requests":{"type":"array","items":{"$ref":"#/components/schemas/CoverageRequest"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["coverage_requests","meta"]}}}}}},"post":{"summary":"Request coverage","tags":["Coverage"],"description":"Create a new coverage request for the authenticated user.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewCoverageRequest"}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"coverage_request":{"$ref":"#/components/schemas/CoverageRequest"}},"required":["coverage_request"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["too_many_shifts_in_coverage_request"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"too_many_shifts_in_coverage_request","message":"A coverage request can have a maximum of 500 shifts. Please select a shorter period for your coverage request.","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#too-many-shifts-in-coverage-request"}}}}}}}},"/user/coverage_requests/{coverage_request_id}":{"delete":{"summary":"Cancel a coverage request","tags":["Coverage"],"description":"Cancel a coverage request for the authenticated user. The coverage request must be in `pending` state.","parameters":[{"schema":{"type":"string"},"examples":{"cov_RxQottluZ1oeM47nz4bVl":{"value":"cov_RxQottluZ1oeM47nz4bVl"},"cov_ldYmnBVr5o2ikebwmRRZv":{"value":"cov_ldYmnBVr5o2ikebwmRRZv"}},"in":"path","name":"coverage_request_id","required":true,"description":"The ID of the coverage request."}],"responses":{"204":{"description":"Coverage request cancelled successfully"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["coverage_request_not_pending"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"coverage_request_not_pending","message":"You cannot cancel a coverage request that is not in pending state","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#coverage-request-not-pending"}}}}}}}},"/user/":{"get":{"summary":"Get the authenticated user","tags":["Users"],"description":"Get the authenticated user who owns this API key.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}},"required":["user"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}},"/teams/":{"get":{"summary":"List teams","tags":["Teams"],"description":"List all teams in your organization.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","description":"The number of items per page."},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","description":"The page number of the results to return."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"teams":{"type":"array","items":{"$ref":"#/components/schemas/Team"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["teams","meta"]}}}}}},"post":{"summary":"Create a team","tags":["Teams"],"description":"Create a new team.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewTeam"}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"}},"required":["team"]}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["duplicate_team_name"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"duplicate_team_name","message":"A team with this name already exists","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#duplicate-team-name"}}}}}}}},"/teams/{team_id}":{"get":{"summary":"Get a team","tags":["Teams"],"description":"Get a team by its ID.","parameters":[{"schema":{"type":"string","example":"tea_VJ4sYEOOXVvJBXqFjRzpm"},"in":"path","name":"team_id","required":true,"description":"The ID of the team."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"}},"required":["team"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}},"patch":{"summary":"Update a team","tags":["Teams"],"description":"Update the team's details.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name of the team."},"description":{"type":"string","maxLength":200,"description":"The description of the team."}}},"example":{"name":"Payments","description":"All about payments and billing"}}}},"parameters":[{"schema":{"type":"string","example":"tea_VJ4sYEOOXVvJBXqFjRzpm"},"in":"path","name":"team_id","required":true,"description":"The ID of the team."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"}},"required":["team"]}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"docs_url":{"type":"string"},"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["duplicate_team_name"]}},"required":["message","status","code"],"example":{"code":"unprocessable_entity","status":422,"message":"The request cannot be processed"}}},"required":["error"]},"example":{"error":{"code":"duplicate_team_name","message":"A team with this name already exists","status":422,"docs_url":"https://docs.shiftkeeper.io/api-reference/errors#duplicate-team-name"}}}}}}},"delete":{"summary":"Delete a team","tags":["Teams"],"description":"Delete a team. Deleting a team does not remove the linked schedules.","parameters":[{"schema":{"type":"string","example":"tea_VJ4sYEOOXVvJBXqFjRzpm"},"in":"path","name":"team_id","required":true,"description":"The ID of the team."}],"responses":{"204":{"description":"Team deleted successfully"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/InternalServerError"}},"required":["error"]}}}}}}},"/teams/{team_id}/members/":{"get":{"summary":"List team members","tags":["Teams"],"description":"List all members of a team.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","description":"The number of items per page."},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","description":"The page number of the results to return."},{"schema":{"type":"string","example":"tea_VJ4sYEOOXVvJBXqFjRzpm"},"in":"path","name":"team_id","required":true,"description":"The ID of the team."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["members","meta"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}},"/teams/{team_id}/members/{user_id}":{"put":{"summary":"Add team member","tags":["Teams"],"description":"Add a user to a team.","parameters":[{"schema":{"type":"string","example":"tea_VJ4sYEOOXVvJBXqFjRzpm"},"in":"path","name":"team_id","required":true,"description":"The ID of the team."},{"schema":{"type":"string"},"examples":{"usr_bq7CmsOKLmkMeZkUUu1hy":{"value":"usr_bq7CmsOKLmkMeZkUUu1hy"},"usr_C0GwCFdk0I4pBMRny4qYV":{"value":"usr_C0GwCFdk0I4pBMRny4qYV"},"usr_YlxrjoB1JqUsollScfFYT":{"value":"usr_YlxrjoB1JqUsollScfFYT"}},"in":"path","name":"user_id","required":true,"description":"The ID of the user."}],"responses":{"204":{"description":"Team member added successfully"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}},"get":{"summary":"Get team member","tags":["Teams"],"description":"Check if a user is a member of a team. A `204` response indicates that the user is a member of the team.","parameters":[{"schema":{"type":"string","example":"tea_VJ4sYEOOXVvJBXqFjRzpm"},"in":"path","name":"team_id","required":true,"description":"The ID of the team."},{"schema":{"type":"string"},"examples":{"usr_bq7CmsOKLmkMeZkUUu1hy":{"value":"usr_bq7CmsOKLmkMeZkUUu1hy"},"usr_C0GwCFdk0I4pBMRny4qYV":{"value":"usr_C0GwCFdk0I4pBMRny4qYV"},"usr_YlxrjoB1JqUsollScfFYT":{"value":"usr_YlxrjoB1JqUsollScfFYT"}},"in":"path","name":"user_id","required":true,"description":"The ID of the user."}],"responses":{"204":{"description":"User is a member of the team"},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}},"delete":{"summary":"Remove team member","tags":["Teams"],"description":"Remove a user from a team.","parameters":[{"schema":{"type":"string","example":"tea_VJ4sYEOOXVvJBXqFjRzpm"},"in":"path","name":"team_id","required":true,"description":"The ID of the team."},{"schema":{"type":"string"},"examples":{"usr_bq7CmsOKLmkMeZkUUu1hy":{"value":"usr_bq7CmsOKLmkMeZkUUu1hy"},"usr_C0GwCFdk0I4pBMRny4qYV":{"value":"usr_C0GwCFdk0I4pBMRny4qYV"},"usr_YlxrjoB1JqUsollScfFYT":{"value":"usr_YlxrjoB1JqUsollScfFYT"}},"in":"path","name":"user_id","required":true,"description":"The ID of the user."}],"responses":{"204":{"description":"Team member removed successfully"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ForbiddenError"}},"required":["error"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}},"/users/":{"get":{"summary":"List users","tags":["Users"],"description":"List all users in the organization.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","description":"The number of items per page."},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","description":"The page number of the results to return."},{"schema":{"type":"string","default":"2024-12-01","example":"2024-12-01"},"in":"header","name":"x-shiftkeeper-api-version","description":"Shiftkeeper API version"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["users","meta"]}}}}}}},"/users/{user_id}":{"get":{"summary":"Get a user","tags":["Users"],"description":"Get a user by their ID.","parameters":[{"schema":{"type":"string"},"examples":{"usr_bq7CmsOKLmkMeZkUUu1hy":{"value":"usr_bq7CmsOKLmkMeZkUUu1hy"},"usr_C0GwCFdk0I4pBMRny4qYV":{"value":"usr_C0GwCFdk0I4pBMRny4qYV"},"usr_YlxrjoB1JqUsollScfFYT":{"value":"usr_YlxrjoB1JqUsollScfFYT"}},"in":"path","name":"user_id","required":true,"description":"The ID of the user."},{"schema":{"type":"string","default":"2024-12-01","example":"2024-12-01"},"in":"header","name":"x-shiftkeeper-api-version","description":"Shiftkeeper API version"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}},"required":["user"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundError"}},"required":["error"]}}}}}}}},"servers":[{"url":"https://api.shiftkeeper.io"}],"security":[{"apiKey":[]}],"externalDocs":{"url":"https://docs.shiftkeeper.io","description":"Learn more about Shiftkeeper"}}