{
  "openapi": "3.0.3",
  "info": {
    "title": "RotaTree Workforce API",
    "version": "1.3.0",
    "description": "RotaCloud compatibility API. Shift start_date/end_date query names are ignored. Unix start/end match either endpoint inclusively, not interval overlap. Unfiltered administrator shift lists include deleted/draft/open records; explicit flags narrow results. Offset pagination; X-Total-Count and Link only when total exceeds limit. Timestamps stay Unix seconds. Attendance mutations retain migration-006 MFA protections; complete 129-operation behavioural parity is not claimed. Additive version and external_ids fields are available on shifts, users and locations. Existing field types and webhook signature remain unchanged. Additive lifecycle fields retain Unix-integer timestamps: lifecycle_state, attendance_method, clocked_in_at, clocked_out_at, approved_at, cancelled_at and handover. Existing v1 query, pagination, mutation, event names and signature behaviour remain unchanged. Use v2 for attendance actions and rota validation."
  },
  "servers": [
    {
      "url": "https://api.rotatree.com/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/accounts": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/attendance": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "approved": {
                        "type": "boolean"
                      },
                      "in_time": {
                        "type": "number"
                      },
                      "out_time": {
                        "type": "number"
                      },
                      "minutes_break": {
                        "type": "number"
                      },
                      "user": {
                        "type": "number"
                      },
                      "location": {
                        "type": "number"
                      },
                      "role": {
                        "type": "number"
                      },
                      "minutes_late": {
                        "type": "number"
                      },
                      "hours": {
                        "type": "number"
                      },
                      "hours_auto": {
                        "type": "number"
                      },
                      "hours_is_auto": {
                        "type": "boolean"
                      },
                      "notes": {
                        "type": "string"
                      },
                      "shift": {
                        "type": "number"
                      },
                      "in_method": {
                        "type": "string"
                      },
                      "out_method": {
                        "type": "string"
                      },
                      "in_location": {
                        "type": "object",
                        "properties": {
                          "lat": {
                            "type": "number"
                          },
                          "lng": {
                            "type": "number"
                          },
                          "accuracy": {
                            "type": "number"
                          }
                        }
                      },
                      "out_location": {
                        "type": "object",
                        "properties": {
                          "lat": {
                            "type": "number"
                          },
                          "lng": {
                            "type": "number"
                          },
                          "accuracy": {
                            "type": "number"
                          }
                        }
                      },
                      "in_device": {
                        "type": "number"
                      },
                      "out_device": {
                        "type": "number"
                      },
                      "in_terminal": {
                        "nullable": true
                      },
                      "out_terminal": {
                        "nullable": true
                      },
                      "clock_in_verified": {
                        "type": "boolean",
                        "description": "True only when arrival was verified using a live QR and workplace network."
                      },
                      "clock_out_verified": {
                        "type": "boolean",
                        "description": "True only when departure was verified using a live QR and workplace network."
                      },
                      "voided": {
                        "type": "boolean",
                        "description": "Voided attendance is excluded from paid hours."
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "users",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "locations",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "roles",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "approved",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "approved": {
                      "type": "boolean"
                    },
                    "in_time": {
                      "type": "number"
                    },
                    "out_time": {
                      "type": "number"
                    },
                    "minutes_break": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "location": {
                      "type": "number"
                    },
                    "role": {
                      "type": "number"
                    },
                    "minutes_late": {
                      "type": "number"
                    },
                    "hours": {
                      "type": "number"
                    },
                    "hours_auto": {
                      "type": "number"
                    },
                    "hours_is_auto": {
                      "type": "boolean"
                    },
                    "notes": {
                      "nullable": true
                    },
                    "shift": {
                      "nullable": true
                    },
                    "in_photo": {
                      "type": "string"
                    },
                    "out_photo": {
                      "type": "string"
                    },
                    "in_time_clocked": {
                      "type": "number"
                    },
                    "out_time_clocked": {
                      "type": "number"
                    },
                    "breaks_clocked": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "start_time": {
                            "type": "number"
                          },
                          "start_location": {
                            "type": "object",
                            "properties": {
                              "lat": {
                                "type": "number"
                              },
                              "lng": {
                                "type": "number"
                              },
                              "accuracy": {
                                "type": "number"
                              }
                            }
                          },
                          "start_photo": {
                            "type": "string"
                          },
                          "end_time": {
                            "type": "number"
                          },
                          "end_location": {
                            "type": "object",
                            "properties": {
                              "lat": {
                                "type": "number"
                              },
                              "lng": {
                                "type": "number"
                              },
                              "accuracy": {
                                "type": "number"
                              }
                            }
                          },
                          "end_photo": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "clock_in_verified": {
                      "type": "boolean",
                      "description": "True only when arrival was verified using a live QR and workplace network."
                    },
                    "clock_out_verified": {
                      "type": "boolean",
                      "description": "True only when departure was verified using a live QR and workplace network."
                    },
                    "voided": {
                      "type": "boolean",
                      "description": "Voided attendance is excluded from paid hours."
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "number"
                  },
                  "in_time": {
                    "type": "number"
                  },
                  "out_time": {
                    "type": "number"
                  },
                  "minutes_break": {
                    "type": "number"
                  },
                  "in_photo": {
                    "type": "string"
                  },
                  "out_photo": {
                    "type": "string"
                  },
                  "in_time_clocked": {
                    "type": "number"
                  },
                  "out_time_clocked": {
                    "type": "number"
                  },
                  "breaks_clocked": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "start_time": {
                          "type": "number"
                        },
                        "start_location": {
                          "type": "object",
                          "properties": {
                            "lat": {
                              "type": "number"
                            },
                            "lng": {
                              "type": "number"
                            },
                            "accuracy": {
                              "type": "number"
                            }
                          }
                        },
                        "start_photo": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "number"
                        },
                        "end_location": {
                          "type": "object",
                          "properties": {
                            "lat": {
                              "type": "number"
                            },
                            "lng": {
                              "type": "number"
                            },
                            "accuracy": {
                              "type": "number"
                            }
                          }
                        },
                        "end_photo": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/attendance/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "approved": {
                      "type": "boolean"
                    },
                    "in_time": {
                      "type": "number"
                    },
                    "out_time": {
                      "type": "number"
                    },
                    "minutes_break": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "location": {
                      "type": "number"
                    },
                    "role": {
                      "type": "number"
                    },
                    "minutes_late": {
                      "type": "number"
                    },
                    "hours": {
                      "type": "number"
                    },
                    "hours_auto": {
                      "type": "number"
                    },
                    "hours_is_auto": {
                      "type": "boolean"
                    },
                    "notes": {
                      "type": "string"
                    },
                    "shift": {
                      "type": "number"
                    },
                    "in_method": {
                      "type": "string"
                    },
                    "out_method": {
                      "type": "string"
                    },
                    "in_location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    },
                    "out_location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    },
                    "in_device": {
                      "type": "number"
                    },
                    "out_device": {
                      "type": "number"
                    },
                    "in_terminal": {
                      "nullable": true
                    },
                    "out_terminal": {
                      "nullable": true
                    },
                    "in_photo": {
                      "type": "string"
                    },
                    "out_photo": {
                      "type": "string"
                    },
                    "in_time_clocked": {
                      "type": "number"
                    },
                    "out_time_clocked": {
                      "type": "number"
                    },
                    "breaks_clocked": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "start_time": {
                            "type": "number"
                          },
                          "start_location": {
                            "type": "object",
                            "properties": {
                              "lat": {
                                "type": "number"
                              },
                              "lng": {
                                "type": "number"
                              },
                              "accuracy": {
                                "type": "number"
                              }
                            }
                          },
                          "start_photo": {
                            "type": "string"
                          },
                          "end_time": {
                            "type": "number"
                          },
                          "end_location": {
                            "type": "object",
                            "properties": {
                              "lat": {
                                "type": "number"
                              },
                              "lng": {
                                "type": "number"
                              },
                              "accuracy": {
                                "type": "number"
                              }
                            }
                          },
                          "end_photo": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "clock_in_verified": {
                      "type": "boolean",
                      "description": "True only when arrival was verified using a live QR and workplace network."
                    },
                    "clock_out_verified": {
                      "type": "boolean",
                      "description": "True only when departure was verified using a live QR and workplace network."
                    },
                    "voided": {
                      "type": "boolean",
                      "description": "Voided attendance is excluded from paid hours."
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "approved": {
                      "type": "boolean"
                    },
                    "in_time": {
                      "type": "number"
                    },
                    "out_time": {
                      "type": "number"
                    },
                    "minutes_break": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "location": {
                      "type": "number"
                    },
                    "role": {
                      "type": "number"
                    },
                    "minutes_late": {
                      "type": "number"
                    },
                    "hours": {
                      "type": "number"
                    },
                    "hours_auto": {
                      "type": "number"
                    },
                    "hours_is_auto": {
                      "type": "boolean"
                    },
                    "notes": {
                      "nullable": true
                    },
                    "shift": {
                      "nullable": true
                    },
                    "in_photo": {
                      "type": "string"
                    },
                    "out_photo": {
                      "type": "string"
                    },
                    "in_time_clocked": {
                      "type": "number"
                    },
                    "out_time_clocked": {
                      "type": "number"
                    },
                    "breaks_clocked": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "start_time": {
                            "type": "number"
                          },
                          "start_location": {
                            "type": "object",
                            "properties": {
                              "lat": {
                                "type": "number"
                              },
                              "lng": {
                                "type": "number"
                              },
                              "accuracy": {
                                "type": "number"
                              }
                            }
                          },
                          "start_photo": {
                            "type": "string"
                          },
                          "end_time": {
                            "type": "number"
                          },
                          "end_location": {
                            "type": "object",
                            "properties": {
                              "lat": {
                                "type": "number"
                              },
                              "lng": {
                                "type": "number"
                              },
                              "accuracy": {
                                "type": "number"
                              }
                            }
                          },
                          "end_photo": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "clock_in_verified": {
                      "type": "boolean",
                      "description": "True only when arrival was verified using a live QR and workplace network."
                    },
                    "clock_out_verified": {
                      "type": "boolean",
                      "description": "True only when departure was verified using a live QR and workplace network."
                    },
                    "voided": {
                      "type": "boolean",
                      "description": "Voided attendance is excluded from paid hours."
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hours": {
                    "type": "number"
                  },
                  "hours_is_auto": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/attendance_approved": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "attendance"
                ],
                "properties": {
                  "attendance": {
                    "type": "array",
                    "items": {}
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "attendance"
                ],
                "properties": {
                  "attendance": {
                    "type": "array",
                    "items": {}
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/availability": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "user": {
                        "type": "number"
                      },
                      "dates": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "available": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "start_time": {
                                    "type": "string"
                                  },
                                  "end_time": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "unavailable": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "start_time": {
                                    "type": "string"
                                  },
                                  "end_time": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "required": [
                            "date",
                            "available",
                            "unavailable"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "users",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "number"
                  },
                  "dates": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "date": {
                          "type": "string"
                        },
                        "available": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string"
                              },
                              "start_time": {
                                "type": "string"
                              },
                              "end_time": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "status",
                              "start_time",
                              "end_time"
                            ]
                          }
                        },
                        "unavailable": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string"
                              },
                              "start_time": {
                                "type": "string"
                              },
                              "end_time": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "status",
                              "start_time",
                              "end_time"
                            ]
                          }
                        }
                      },
                      "required": [
                        "date",
                        "available",
                        "unavailable"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/day_notes": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "start_date": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "locations": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      },
                      "title": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      },
                      "visible_employees": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "id",
                      "start_date",
                      "end_date",
                      "locations",
                      "title",
                      "message",
                      "visible_employees"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "title": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "visible_employees": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "type": "string"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "title": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "visible_employees": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/day_notes/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "title": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "visible_employees": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "title": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "visible_employees": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "type": "string"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "title": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "visible_employees": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/days_off": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "user": {
                        "type": "number"
                      },
                      "dates": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "day_off": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "date",
                            "day_off"
                          ]
                        }
                      }
                    },
                    "required": [
                      "user",
                      "dates"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "users",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "dates",
                  "users"
                ],
                "properties": {
                  "dates": {
                    "type": "array",
                    "items": {}
                  },
                  "users": {
                    "type": "array",
                    "items": {}
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "dates",
                  "users"
                ],
                "properties": {
                  "dates": {
                    "type": "array",
                    "items": {}
                  },
                  "users": {
                    "type": "array",
                    "items": {}
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/days_off_patterns": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "user": {
                        "type": "number"
                      },
                      "start_date": {
                        "type": "string"
                      },
                      "end_date": {
                        "nullable": true,
                        "type": "string"
                      },
                      "mon_day_off": {
                        "type": "boolean"
                      },
                      "tue_day_off": {
                        "type": "boolean"
                      },
                      "wed_day_off": {
                        "type": "boolean"
                      },
                      "thu_day_off": {
                        "type": "boolean"
                      },
                      "fri_day_off": {
                        "type": "boolean"
                      },
                      "sat_day_off": {
                        "type": "boolean"
                      },
                      "sun_day_off": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "id",
                      "user",
                      "start_date",
                      "end_date",
                      "mon_day_off",
                      "tue_day_off",
                      "wed_day_off",
                      "thu_day_off",
                      "fri_day_off",
                      "sat_day_off",
                      "sun_day_off"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "users",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "nullable": true
                    },
                    "mon_day_off": {
                      "type": "boolean"
                    },
                    "tue_day_off": {
                      "type": "boolean"
                    },
                    "wed_day_off": {
                      "type": "boolean"
                    },
                    "thu_day_off": {
                      "type": "boolean"
                    },
                    "fri_day_off": {
                      "type": "boolean"
                    },
                    "sat_day_off": {
                      "type": "boolean"
                    },
                    "sun_day_off": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "number"
                  },
                  "start_date": {
                    "type": "string"
                  },
                  "mon_day_off": {
                    "type": "boolean"
                  },
                  "tue_day_off": {
                    "type": "boolean"
                  },
                  "wed_day_off": {
                    "type": "boolean"
                  },
                  "thu_day_off": {
                    "type": "boolean"
                  },
                  "fri_day_off": {
                    "type": "boolean"
                  },
                  "sat_day_off": {
                    "type": "boolean"
                  },
                  "sun_day_off": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/days_off_patterns/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "nullable": true
                    },
                    "mon_day_off": {
                      "type": "boolean"
                    },
                    "tue_day_off": {
                      "type": "boolean"
                    },
                    "wed_day_off": {
                      "type": "boolean"
                    },
                    "thu_day_off": {
                      "type": "boolean"
                    },
                    "fri_day_off": {
                      "type": "boolean"
                    },
                    "sat_day_off": {
                      "type": "boolean"
                    },
                    "sun_day_off": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "nullable": true
                    },
                    "mon_day_off": {
                      "type": "boolean"
                    },
                    "tue_day_off": {
                      "type": "boolean"
                    },
                    "wed_day_off": {
                      "type": "boolean"
                    },
                    "thu_day_off": {
                      "type": "boolean"
                    },
                    "fri_day_off": {
                      "type": "boolean"
                    },
                    "sat_day_off": {
                      "type": "boolean"
                    },
                    "sun_day_off": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mon_day_off": {
                    "type": "boolean"
                  },
                  "tue_day_off": {
                    "type": "boolean"
                  },
                  "wed_day_off": {
                    "type": "boolean"
                  },
                  "thu_day_off": {
                    "type": "boolean"
                  },
                  "fri_day_off": {
                    "type": "boolean"
                  },
                  "sat_day_off": {
                    "type": "boolean"
                  },
                  "sun_day_off": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/documents": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "bucket": {
                        "enum": [
                          "",
                          null
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "key": {
                        "enum": [
                          "",
                          null
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "user": {
                        "enum": [
                          0,
                          null
                        ],
                        "nullable": true,
                        "type": "number"
                      },
                      "folder_id": {
                        "enum": [
                          0,
                          null
                        ],
                        "nullable": true,
                        "type": "number"
                      },
                      "expires": {
                        "enum": [
                          "1653473811",
                          null
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "public": {
                        "type": "boolean",
                        "enum": [
                          false
                        ]
                      },
                      "created_by": {
                        "enum": [
                          0,
                          null
                        ],
                        "nullable": true,
                        "type": "number"
                      },
                      "created_at": {
                        "type": "number",
                        "enum": [
                          0
                        ]
                      },
                      "deleted": {
                        "type": "boolean",
                        "enum": [
                          false
                        ]
                      },
                      "deleted_by": {
                        "enum": [
                          0,
                          null
                        ],
                        "nullable": true,
                        "type": "number"
                      },
                      "sizeKb": {
                        "enum": [
                          0,
                          null
                        ],
                        "nullable": true,
                        "type": "number"
                      },
                      "name": {
                        "enum": [
                          "",
                          null
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "extension": {
                        "enum": [
                          "",
                          null
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "",
                          null
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "users": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "enum": [
                            0
                          ]
                        }
                      },
                      "acknowledgements": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "user": {
                              "type": "number",
                              "enum": [
                                0
                              ]
                            },
                            "acknowledged_at": {
                              "type": "string",
                              "enum": [
                                ""
                              ]
                            }
                          },
                          "required": [
                            "user",
                            "acknowledged_at"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "signature": {
                        "properties": {},
                        "additionalProperties": false,
                        "nullable": true,
                        "type": "object"
                      }
                    },
                    "required": [
                      "public",
                      "created_at",
                      "deleted",
                      "users",
                      "acknowledgements",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bucket": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "key": {
                    "type": "string"
                  },
                  "users": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "public": {
                    "type": "boolean"
                  },
                  "requires_acknowledgement": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/documents/{id}": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "user": {
                      "nullable": true,
                      "type": "number"
                    },
                    "folder_id": {
                      "nullable": true,
                      "type": "number"
                    },
                    "expires": {
                      "nullable": true,
                      "type": "number"
                    },
                    "public": {
                      "type": "boolean"
                    },
                    "created_by": {
                      "nullable": true,
                      "type": "number"
                    },
                    "created_at": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "deleted_by": {
                      "nullable": true,
                      "type": "number"
                    },
                    "sizeKb": {
                      "nullable": true,
                      "type": "number"
                    },
                    "name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "extension": {
                      "nullable": true,
                      "type": "string"
                    },
                    "type": {
                      "nullable": true,
                      "type": "string"
                    },
                    "requires_acknowledgement": {
                      "type": "boolean"
                    },
                    "requires_signing": {
                      "type": "boolean"
                    },
                    "users": {
                      "type": "array",
                      "items": {}
                    },
                    "acknowledgements": {
                      "type": "array",
                      "items": {}
                    },
                    "signature": {
                      "properties": {},
                      "nullable": true,
                      "type": "object"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "public": {
                    "type": "boolean"
                  },
                  "user": {
                    "type": "number"
                  },
                  "users": {
                    "type": "array",
                    "items": {}
                  },
                  "requires_acknowledgement": {
                    "type": "boolean"
                  },
                  "requires_signing": {
                    "type": "boolean"
                  },
                  "shared": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/documents/{id}/acknowledgements": {
      "put": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/documents/{id}/signature": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          },
          "501": {
            "description": "Signing payload unspecified; not implemented"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/groups": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      },
                      "users": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "users"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "users": {
                      "type": "array",
                      "items": {}
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/groups/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/holiday_allowances/{year}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "user": {
                        "type": "number"
                      },
                      "default_holiday_allowance": {
                        "type": "number"
                      },
                      "default_holiday_allowance_unit": {
                        "type": "string"
                      },
                      "custom_holiday_allowance": {
                        "nullable": true
                      },
                      "custom_holiday_allowance_unit": {
                        "nullable": true
                      },
                      "adjusted_start_date": {
                        "type": "boolean"
                      },
                      "adjusted_final_working_date": {
                        "type": "boolean"
                      },
                      "holiday_allowance": {
                        "type": "number"
                      },
                      "holiday_allowance_unit": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "user",
                      "default_holiday_allowance",
                      "default_holiday_allowance_unit",
                      "custom_holiday_allowance",
                      "custom_holiday_allowance_unit",
                      "adjusted_start_date",
                      "adjusted_final_working_date",
                      "holiday_allowance",
                      "holiday_allowance_unit"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/holiday_allowances/{year}/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "number"
                    },
                    "default_holiday_allowance": {
                      "type": "number"
                    },
                    "default_holiday_allowance_unit": {
                      "type": "string"
                    },
                    "custom_holiday_allowance": {
                      "nullable": true
                    },
                    "custom_holiday_allowance_unit": {
                      "nullable": true
                    },
                    "adjusted_start_date": {
                      "type": "boolean"
                    },
                    "adjusted_final_working_date": {
                      "type": "boolean"
                    },
                    "holiday_allowance": {
                      "type": "number"
                    },
                    "holiday_allowance_unit": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/holiday_allowances_custom/{year}": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "number"
                    },
                    "holiday_allowance": {
                      "type": "number"
                    },
                    "holiday_allowance_unit": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "number"
                  },
                  "holiday_allowance": {
                    "type": "number"
                  },
                  "holiday_allowance_unit": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/holiday_allowances_custom/{year}/{id}": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "number"
                    },
                    "holiday_allowance": {
                      "type": "number"
                    },
                    "holiday_allowance_unit": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "holiday_allowance": {
                    "type": "number"
                  },
                  "holiday_allowance_unit": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/leave": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "number"
                      },
                      "user": {
                        "type": "number"
                      },
                      "admin": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "requested": {
                        "type": "boolean"
                      },
                      "user_message": {
                        "nullable": true,
                        "type": "string"
                      },
                      "admin_message": {
                        "type": "string"
                      },
                      "start_date": {
                        "type": "string"
                      },
                      "start_am_pm": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "end_am_pm": {
                        "type": "string"
                      },
                      "hours": {
                        "type": "object",
                        "properties": {
                          "2016": {
                            "nullable": true,
                            "type": "number"
                          },
                          "2017": {
                            "type": "number"
                          }
                        }
                      },
                      "hours_method": {
                        "type": "string"
                      },
                      "hours_set": {
                        "type": "boolean"
                      },
                      "dates": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "year": {
                              "type": "string"
                            },
                            "days": {
                              "type": "number"
                            },
                            "hours": {
                              "nullable": true,
                              "type": "number"
                            },
                            "day_off": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "date",
                            "year",
                            "days",
                            "hours",
                            "day_off"
                          ]
                        }
                      }
                    },
                    "required": [
                      "id",
                      "deleted",
                      "type",
                      "user",
                      "admin",
                      "status",
                      "requested",
                      "user_message",
                      "admin_message",
                      "start_date",
                      "start_am_pm",
                      "end_date",
                      "end_am_pm",
                      "hours",
                      "hours_method",
                      "hours_set",
                      "dates"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "users",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_denied",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "x-s2o-warning": "Operation List leave has multiple requestBodies"
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "number"
                      },
                      "user": {
                        "type": "number"
                      },
                      "admin": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "requested": {
                        "type": "boolean"
                      },
                      "user_message": {
                        "nullable": true
                      },
                      "admin_message": {
                        "type": "string"
                      },
                      "start_date": {
                        "type": "string"
                      },
                      "start_am_pm": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "end_am_pm": {
                        "type": "string"
                      },
                      "hours": {
                        "type": "object",
                        "properties": {
                          "2016": {
                            "type": "number"
                          },
                          "2017": {
                            "type": "number"
                          }
                        }
                      },
                      "hours_method": {
                        "type": "string"
                      },
                      "hours_set": {
                        "type": "boolean"
                      },
                      "dates": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "year": {
                              "type": "string"
                            },
                            "days": {
                              "type": "number"
                            },
                            "hours": {
                              "type": "number"
                            },
                            "day_off": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "date",
                            "year",
                            "days",
                            "hours",
                            "day_off"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "users": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "type": {
                    "type": "number"
                  },
                  "start_date": {
                    "type": "string"
                  },
                  "start_am_pm": {
                    "type": "string"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "end_am_pm": {
                    "type": "string"
                  },
                  "hours": {
                    "type": "object",
                    "properties": {
                      "2016": {
                        "type": "number"
                      },
                      "2017": {
                        "type": "number"
                      }
                    }
                  },
                  "admin_message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/leave/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "type": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "admin": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string"
                    },
                    "requested": {
                      "type": "boolean"
                    },
                    "user_message": {
                      "type": "string"
                    },
                    "admin_message": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "start_am_pm": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "end_am_pm": {
                      "type": "string"
                    },
                    "hours": {
                      "type": "object",
                      "properties": {
                        "2016": {
                          "nullable": true
                        }
                      }
                    },
                    "hours_method": {
                      "type": "string"
                    },
                    "hours_set": {
                      "type": "boolean"
                    },
                    "dates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "year": {
                            "type": "string"
                          },
                          "days": {
                            "type": "number"
                          },
                          "hours": {
                            "nullable": true
                          },
                          "day_off": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "date",
                          "year",
                          "days",
                          "hours",
                          "day_off"
                        ]
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "type": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "admin": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string"
                    },
                    "requested": {
                      "type": "boolean"
                    },
                    "user_message": {
                      "type": "string"
                    },
                    "admin_message": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "start_am_pm": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "end_am_pm": {
                      "type": "string"
                    },
                    "hours": {
                      "type": "object",
                      "properties": {
                        "2016": {
                          "nullable": true
                        }
                      }
                    },
                    "hours_method": {
                      "type": "string"
                    },
                    "hours_set": {
                      "type": "boolean"
                    },
                    "dates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "year": {
                            "type": "string"
                          },
                          "days": {
                            "type": "number"
                          },
                          "hours": {
                            "nullable": true
                          },
                          "day_off": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "date",
                          "year",
                          "days",
                          "hours",
                          "day_off"
                        ]
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "type": "string"
                  },
                  "start_am_pm": {
                    "type": "string"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "end_am_pm": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/leave_embargoes": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "start_date": {
                        "type": "string"
                      },
                      "start_am_pm": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "end_am_pm": {
                        "type": "string"
                      },
                      "everyone": {
                        "type": "boolean"
                      },
                      "users": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "start_date",
                      "start_am_pm",
                      "end_date",
                      "end_am_pm",
                      "everyone",
                      "users",
                      "message"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "users",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "start_am_pm": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "end_am_pm": {
                      "type": "string"
                    },
                    "everyone": {
                      "type": "boolean"
                    },
                    "users": {
                      "type": "array",
                      "items": {}
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "type": "string"
                  },
                  "start_am_pm": {
                    "type": "string"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "end_am_pm": {
                    "type": "string"
                  },
                  "everyone": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/leave_embargoes/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "start_am_pm": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "end_am_pm": {
                      "type": "string"
                    },
                    "everyone": {
                      "type": "boolean"
                    },
                    "users": {
                      "type": "array",
                      "items": {}
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "start_am_pm": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "end_am_pm": {
                      "type": "string"
                    },
                    "everyone": {
                      "type": "boolean"
                    },
                    "users": {
                      "type": "array",
                      "items": {}
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "type": "string"
                  },
                  "start_am_pm": {
                    "type": "string"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "end_am_pm": {
                    "type": "string"
                  },
                  "everyone": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/leave_requests": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "type": {
                        "type": "number"
                      },
                      "user": {
                        "type": "number"
                      },
                      "user_message": {
                        "type": "string"
                      },
                      "start_date": {
                        "type": "string"
                      },
                      "start_am_pm": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "end_am_pm": {
                        "type": "string"
                      },
                      "dates": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "year": {
                              "type": "string"
                            },
                            "days": {
                              "type": "number"
                            },
                            "day_off": {
                              "type": "boolean"
                            },
                            "hours": {
                              "nullable": true
                            }
                          },
                          "required": [
                            "date",
                            "year",
                            "days",
                            "hours",
                            "day_off"
                          ]
                        }
                      }
                    },
                    "required": [
                      "id",
                      "deleted",
                      "type",
                      "user",
                      "user_message",
                      "start_date",
                      "start_am_pm",
                      "end_date",
                      "end_am_pm",
                      "dates"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "type": {
                      "type": "number"
                    },
                    "requested_at": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "start_am_pm": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "end_am_pm": {
                      "type": "string"
                    },
                    "years": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "days": {
                      "type": "object",
                      "properties": {
                        "2016": {
                          "type": "object",
                          "properties": {
                            "days": {
                              "type": "number"
                            },
                            "workdays": {
                              "type": "number"
                            },
                            "days_off": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "user_message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "number"
                  },
                  "start_date": {
                    "type": "string"
                  },
                  "start_am_pm": {
                    "type": "string"
                  },
                  "end_date": {
                    "type": "string"
                  },
                  "end_am_pm": {
                    "type": "string"
                  },
                  "user_message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/leave_requests/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "type": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "user_message": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "start_am_pm": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "end_am_pm": {
                      "type": "string"
                    },
                    "dates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "year": {
                            "type": "string"
                          },
                          "days": {
                            "type": "number"
                          },
                          "day_off": {
                            "type": "boolean"
                          },
                          "hours": {
                            "nullable": true
                          }
                        },
                        "required": [
                          "date",
                          "year",
                          "days",
                          "hours"
                        ]
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/leave_requests/{id}/approve": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "admin_message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/leave_requests/{id}/deny": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "admin_message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/leave_types": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      },
                      "short_name": {
                        "type": "string"
                      },
                      "can_request": {
                        "type": "boolean"
                      },
                      "colour": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "short_name",
                      "can_request",
                      "colour"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/locations": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "name": {
                        "type": "string"
                      },
                      "address": {
                        "type": "string"
                      },
                      "location": {
                        "type": "object",
                        "properties": {
                          "lat": {
                            "type": "number"
                          },
                          "lng": {
                            "type": "number"
                          },
                          "radius": {
                            "type": "number"
                          }
                        }
                      },
                      "timezone": {
                        "type": "number"
                      },
                      "users": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      }
                    },
                    "required": [
                      "id",
                      "deleted",
                      "name",
                      "address",
                      "location",
                      "timezone",
                      "users"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "only_visible",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "radius": {
                          "type": "number"
                        }
                      }
                    },
                    "timezone": {
                      "type": "number"
                    },
                    "users": {
                      "type": "array",
                      "items": {}
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string"
                  },
                  "location": {
                    "type": "object",
                    "properties": {
                      "lat": {
                        "type": "number"
                      },
                      "lng": {
                        "type": "number"
                      },
                      "radius": {
                        "type": "number"
                      }
                    }
                  },
                  "timezone": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/locations/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "radius": {
                          "type": "number"
                        }
                      }
                    },
                    "timezone": {
                      "type": "number"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "radius": {
                          "type": "number"
                        }
                      }
                    },
                    "timezone": {
                      "type": "number"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string"
                  },
                  "location": {
                    "type": "object",
                    "properties": {
                      "lat": {
                        "type": "number"
                      },
                      "lng": {
                        "type": "number"
                      },
                      "radius": {
                        "type": "number"
                      }
                    }
                  },
                  "timezone": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/logbook_categories": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/logbook_categories/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/logbook_events": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "created_at": {
                        "type": "number"
                      },
                      "created_by": {
                        "type": "number"
                      },
                      "updated_at": {
                        "nullable": true
                      },
                      "updated_by": {
                        "nullable": true
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "deleted_at": {
                        "nullable": true
                      },
                      "deleted_by": {
                        "nullable": true
                      },
                      "user": {
                        "type": "number"
                      },
                      "category": {
                        "type": "number"
                      },
                      "date": {
                        "type": "string"
                      },
                      "time": {
                        "nullable": true,
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "created_at",
                      "created_by",
                      "updated_at",
                      "updated_by",
                      "deleted",
                      "deleted_at",
                      "deleted_by",
                      "user",
                      "category",
                      "date",
                      "time",
                      "name",
                      "description"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "number"
                    },
                    "created_by": {
                      "type": "number"
                    },
                    "updated_at": {
                      "nullable": true
                    },
                    "updated_by": {
                      "nullable": true
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "deleted_at": {
                      "nullable": true
                    },
                    "deleted_by": {
                      "nullable": true
                    },
                    "user": {
                      "type": "number"
                    },
                    "category": {
                      "type": "number"
                    },
                    "date": {
                      "type": "string"
                    },
                    "time": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "number"
                  },
                  "category": {
                    "type": "number"
                  },
                  "date": {
                    "type": "string"
                  },
                  "time": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/logbook_events/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "number"
                    },
                    "created_by": {
                      "type": "number"
                    },
                    "updated_at": {
                      "nullable": true
                    },
                    "updated_by": {
                      "nullable": true
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "deleted_at": {
                      "nullable": true
                    },
                    "deleted_by": {
                      "nullable": true
                    },
                    "user": {
                      "type": "number"
                    },
                    "category": {
                      "type": "number"
                    },
                    "date": {
                      "type": "string"
                    },
                    "time": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "number"
                    },
                    "created_by": {
                      "type": "number"
                    },
                    "updated_at": {
                      "type": "number"
                    },
                    "updated_by": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "deleted_at": {
                      "nullable": true
                    },
                    "deleted_by": {
                      "nullable": true
                    },
                    "user": {
                      "type": "number"
                    },
                    "category": {
                      "type": "number"
                    },
                    "date": {
                      "type": "string"
                    },
                    "time": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "number"
                  },
                  "date": {
                    "type": "string"
                  },
                  "time": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/me": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "level": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "photo": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "group": {
                      "type": "number"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "default_role": {
                      "type": "number"
                    },
                    "dob": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "final_working_date": {
                      "nullable": true
                    },
                    "weekly_hours": {
                      "type": "number"
                    },
                    "holiday_allowance": {
                      "type": "number"
                    },
                    "holiday_allowance_unit": {
                      "type": "string"
                    },
                    "payroll_id": {
                      "type": "string"
                    },
                    "salary": {
                      "type": "number"
                    },
                    "salary_type": {
                      "type": "string"
                    },
                    "overtime_rate": {
                      "type": "number"
                    },
                    "role_rates": {
                      "type": "object",
                      "properties": {
                        "3": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        },
                        "7": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "leave_rates": {
                      "type": "object",
                      "properties": {
                        "1": {
                          "type": "number"
                        },
                        "2": {
                          "type": "number"
                        }
                      }
                    },
                    "leave_rates_unit": {
                      "type": "string"
                    },
                    "leave_rates_type": {
                      "type": "string"
                    },
                    "notes": {
                      "type": "string"
                    },
                    "preferences": {
                      "type": "object",
                      "properties": {
                        "setup_steps_hidden": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/me/ip": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ip": {
                      "type": "string",
                      "enum": [
                        "267.43.300.126"
                      ]
                    }
                  },
                  "required": [
                    "ip"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/messages": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number",
                        "enum": [
                          0
                        ]
                      },
                      "sent_by": {
                        "type": "number",
                        "enum": [
                          0
                        ]
                      },
                      "sent_at": {
                        "enum": [
                          0,
                          null
                        ],
                        "nullable": true,
                        "type": "number"
                      },
                      "subject": {
                        "type": "string",
                        "enum": [
                          ""
                        ]
                      },
                      "message": {
                        "type": "string",
                        "enum": [
                          ""
                        ]
                      },
                      "users": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "user": {
                              "type": "number",
                              "enum": [
                                1
                              ]
                            },
                            "sent": {
                              "type": "boolean",
                              "enum": [
                                true
                              ]
                            },
                            "opened": {
                              "type": "boolean",
                              "enum": [
                                true
                              ]
                            },
                            "opened_at": {
                              "enum": [
                                0,
                                null
                              ],
                              "nullable": true,
                              "type": "number"
                            },
                            "error": {
                              "enum": [
                                "",
                                null
                              ],
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "required": [
                            "user",
                            "sent",
                            "opened",
                            "opened_at",
                            "error"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "enum": [
                                ""
                              ]
                            },
                            "extension": {
                              "type": "string",
                              "enum": [
                                ""
                              ]
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                ""
                              ]
                            },
                            "size_kb": {
                              "type": "number",
                              "enum": [
                                0
                              ]
                            },
                            "bucket": {
                              "type": "string",
                              "enum": [
                                ""
                              ]
                            },
                            "key": {
                              "type": "string",
                              "enum": [
                                "temp/1001/123/gfgrfewd5y5ygwe4gjvdnvo"
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "extension",
                            "type",
                            "size_kb",
                            "bucket",
                            "key"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "id",
                      "sent_by",
                      "sent_at",
                      "subject",
                      "message",
                      "users",
                      "attachments"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "sent_by": {
                      "type": "number"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "sent_at": {
                      "nullable": true,
                      "type": "number"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "user": {
                            "type": "number",
                            "enum": [
                              0
                            ]
                          },
                          "sent": {
                            "type": "boolean",
                            "enum": [
                              true
                            ]
                          },
                          "opened": {
                            "type": "boolean",
                            "enum": [
                              true
                            ]
                          },
                          "opened_at": {
                            "enum": [
                              1650963596,
                              null
                            ],
                            "nullable": true,
                            "type": "number"
                          },
                          "error": {
                            "enum": [
                              "",
                              null
                            ],
                            "nullable": true,
                            "type": "string"
                          }
                        },
                        "required": [
                          "user",
                          "sent",
                          "opened",
                          "opened_at",
                          "error"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "users"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "subject",
                  "message",
                  "users"
                ],
                "properties": {
                  "subject": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "users": {
                    "type": "array",
                    "items": {}
                  },
                  "attachments": {
                    "type": "array",
                    "items": {}
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/pay_periods": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "start_date": {
                        "type": "string"
                      },
                      "end_date": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "locked": {
                        "type": "boolean"
                      },
                      "locked_at": {
                        "nullable": true,
                        "type": "number"
                      },
                      "locked_by": {
                        "nullable": true,
                        "type": "number"
                      },
                      "unlocked_at": {
                        "nullable": true,
                        "type": "number"
                      },
                      "unlocked_by": {
                        "nullable": true,
                        "type": "number"
                      },
                      "finalised": {
                        "type": "boolean"
                      },
                      "finalised_at": {
                        "nullable": true,
                        "type": "number"
                      },
                      "finalised_by": {
                        "nullable": true,
                        "type": "number"
                      },
                      "unfinalised_at": {
                        "nullable": true,
                        "type": "number"
                      },
                      "unfinalised_by": {
                        "nullable": true,
                        "type": "number"
                      }
                    },
                    "required": [
                      "id",
                      "start_date",
                      "end_date",
                      "name",
                      "locked",
                      "locked_at",
                      "locked_by",
                      "unlocked_at",
                      "unlocked_by",
                      "finalised",
                      "finalised_at",
                      "finalised_by",
                      "unfinalised_at",
                      "unfinalised_by"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/pay_periods/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "end_date": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "locked": {
                      "type": "boolean"
                    },
                    "locked_at": {
                      "type": "number"
                    },
                    "locked_by": {
                      "type": "number"
                    },
                    "unlocked_at": {
                      "nullable": true
                    },
                    "unlocked_by": {
                      "nullable": true
                    },
                    "finalised": {
                      "type": "boolean"
                    },
                    "finalised_at": {
                      "type": "number"
                    },
                    "finalised_by": {
                      "type": "number"
                    },
                    "unfinalised_at": {
                      "nullable": true
                    },
                    "unfinalised_by": {
                      "nullable": true
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/pay_periods/{id}/payroll": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "user": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "deleted": {
                            "type": "boolean"
                          },
                          "first_name": {
                            "type": "string"
                          },
                          "last_name": {
                            "type": "string"
                          },
                          "group": {
                            "nullable": true
                          },
                          "dob": {
                            "nullable": true
                          },
                          "start_date": {
                            "nullable": true
                          },
                          "final_working_date": {
                            "nullable": true
                          },
                          "weekly_hours": {
                            "nullable": true
                          },
                          "holiday_allowance": {
                            "nullable": true
                          },
                          "holiday_allowance_unit": {
                            "type": "string"
                          },
                          "payroll_id": {
                            "nullable": true
                          },
                          "salary": {
                            "type": "number"
                          },
                          "salary_type": {
                            "type": "string"
                          },
                          "overtime_rate": {
                            "nullable": true
                          },
                          "role_rates": {
                            "nullable": true
                          },
                          "leave_rates": {
                            "nullable": true
                          },
                          "leave_rates_unit": {
                            "type": "string"
                          },
                          "leave_rates_type": {
                            "type": "string"
                          }
                        }
                      },
                      "totals": {
                        "type": "object",
                        "properties": {
                          "overtime": {
                            "type": "number"
                          },
                          "overtime_is_auto": {
                            "type": "boolean"
                          },
                          "pay": {
                            "type": "number"
                          },
                          "pay_is_auto": {
                            "type": "boolean"
                          }
                        }
                      },
                      "attendance": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "number"
                            },
                            "location": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "number"
                                },
                                "name": {
                                  "type": "string"
                                }
                              }
                            },
                            "role": {
                              "nullable": true
                            },
                            "in_time": {
                              "type": "number"
                            },
                            "out_time": {
                              "type": "number"
                            },
                            "minutes_break": {
                              "type": "number"
                            },
                            "minutes_late": {
                              "type": "number"
                            },
                            "hours": {
                              "type": "number"
                            },
                            "clock_in_verified": {
                              "type": "boolean",
                              "description": "True only when arrival was verified using a live QR and workplace network."
                            },
                            "clock_out_verified": {
                              "type": "boolean",
                              "description": "True only when departure was verified using a live QR and workplace network."
                            },
                            "voided": {
                              "type": "boolean",
                              "description": "Voided attendance is excluded from paid hours."
                            }
                          }
                        }
                      },
                      "leave": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "number"
                            },
                            "type": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "number"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "short_name": {
                                  "type": "string"
                                }
                              }
                            },
                            "paid": {
                              "type": "boolean"
                            },
                            "dates": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "date": {
                                    "type": "string"
                                  },
                                  "hours": {
                                    "nullable": true,
                                    "type": "number"
                                  },
                                  "days": {
                                    "type": "number"
                                  },
                                  "day_off": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "date",
                                  "hours",
                                  "days",
                                  "day_off"
                                ]
                              }
                            }
                          },
                          "required": [
                            "id",
                            "type",
                            "paid",
                            "dates"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          },
          "501": {
            "description": "Payroll calculation parity is not implemented"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/pins/{pin}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "level": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "photo": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "group": {
                      "type": "number"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "default_role": {
                      "type": "number"
                    },
                    "dob": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "final_working_date": {
                      "nullable": true
                    },
                    "weekly_hours": {
                      "type": "number"
                    },
                    "holiday_allowance": {
                      "type": "number"
                    },
                    "holiday_allowance_unit": {
                      "type": "string"
                    },
                    "payroll_id": {
                      "type": "string"
                    },
                    "salary": {
                      "type": "number"
                    },
                    "salary_type": {
                      "type": "string"
                    },
                    "overtime_rate": {
                      "type": "number"
                    },
                    "role_rates": {
                      "type": "object",
                      "properties": {
                        "3": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        },
                        "7": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "leave_rates": {
                      "type": "object",
                      "properties": {
                        "1": {
                          "type": "number"
                        },
                        "2": {
                          "type": "number"
                        }
                      }
                    },
                    "leave_rates_unit": {
                      "type": "string"
                    },
                    "leave_rates_type": {
                      "type": "string"
                    },
                    "notes": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "pin",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/roles": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "name": {
                        "type": "string"
                      },
                      "colour": {
                        "type": "string"
                      },
                      "default_break": {
                        "type": "number"
                      },
                      "users": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      }
                    },
                    "required": [
                      "id",
                      "deleted",
                      "name",
                      "colour",
                      "default_break",
                      "users"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "colour": {
                      "type": "string"
                    },
                    "default_break": {
                      "type": "number"
                    },
                    "users": {
                      "type": "array",
                      "items": {}
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "colour": {
                    "type": "string"
                  },
                  "default_break": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/roles/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "colour": {
                      "type": "string"
                    },
                    "default_break": {
                      "type": "number"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "colour": {
                      "type": "string"
                    },
                    "default_break": {
                      "type": "number"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "colour": {
                    "type": "string"
                  },
                  "default_break": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/settings": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "attendance_record_breaks": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "string"
                        },
                        "values": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "clockin_without_shift_allowed": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "string"
                        },
                        "values": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "early_clockin_minutes": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "number"
                        },
                        "values": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "mobile_clocking_enabled": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "boolean"
                        },
                        "values": {
                          "type": "array",
                          "items": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/shifts": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "published": {
                        "type": "boolean"
                      },
                      "open": {
                        "type": "boolean"
                      },
                      "start_time": {
                        "type": "number"
                      },
                      "end_time": {
                        "type": "number"
                      },
                      "minutes_break": {
                        "type": "number"
                      },
                      "user": {
                        "nullable": true,
                        "type": "number"
                      },
                      "location": {
                        "type": "number"
                      },
                      "role": {
                        "type": "number",
                        "nullable": true
                      },
                      "notes": {
                        "nullable": true,
                        "type": "string"
                      },
                      "created_by": {
                        "type": "number"
                      },
                      "created_at": {
                        "type": "number"
                      },
                      "updated_at": {
                        "nullable": true,
                        "type": "number"
                      },
                      "claimed": {
                        "type": "boolean"
                      },
                      "claimed_at": {
                        "nullable": true,
                        "type": "number"
                      },
                      "acknowledged": {
                        "type": "boolean"
                      },
                      "acknowledged_at": {
                        "nullable": true,
                        "type": "number"
                      },
                      "shift_type": {
                        "type": "string",
                        "description": "Shift kind, separate from numeric job role. Built-ins: day, night, sleep_in, waking_night, on_call, handover_overlap; tenant custom codes are supported."
                      },
                      "shift_category": {
                        "type": "string",
                        "enum": [
                          "day",
                          "night"
                        ]
                      },
                      "rota_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Operational date using the location timezone and rota-day boundary captured for this shift."
                      },
                      "type_source": {
                        "type": "string",
                        "enum": [
                          "inferred",
                          "template",
                          "manual"
                        ]
                      },
                      "duration_minutes": {
                        "type": "number",
                        "description": "Actual elapsed UTC duration, before deducting breaks."
                      },
                      "disturbed_minutes": {
                        "type": "number",
                        "description": "Total non-overlapping sleep-in disturbance minutes."
                      },
                      "deleted_at": {
                        "type": "number",
                        "nullable": true
                      },
                      "deleted_by": {
                        "type": "number",
                        "nullable": true
                      },
                      "updated_by": {
                        "type": "number",
                        "nullable": true
                      },
                      "claim_open_shift_approval_required": {
                        "type": "boolean"
                      },
                      "unavailability_requests": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "swap_requests": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    },
                    "required": [
                      "id",
                      "deleted",
                      "published",
                      "open",
                      "start_time",
                      "end_time",
                      "minutes_break",
                      "user",
                      "location",
                      "role",
                      "notes",
                      "created_by",
                      "created_at",
                      "updated_at",
                      "claimed",
                      "claimed_at",
                      "acknowledged",
                      "acknowledged_at"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "users",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "locations",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "roles",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "open",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "published",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "description": "start and end are optional Unix seconds. A shift matches if either its start_time or end_time lies within the supplied inclusive bounds. A window wholly inside a shift returns no match. start_date/end_date are silently ignored. Use published=true&open=false&include_deleted=false for live assigned shifts."
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "published": {
                      "type": "boolean"
                    },
                    "open": {
                      "type": "boolean"
                    },
                    "start_time": {
                      "type": "number"
                    },
                    "end_time": {
                      "type": "number"
                    },
                    "minutes_break": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "location": {
                      "type": "number"
                    },
                    "role": {
                      "type": "number",
                      "nullable": true
                    },
                    "notes": {
                      "type": "string"
                    },
                    "created_by": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "number"
                    },
                    "updated_at": {
                      "nullable": true
                    },
                    "claimed": {
                      "type": "boolean"
                    },
                    "claimed_at": {
                      "nullable": true
                    },
                    "acknowledged": {
                      "type": "boolean"
                    },
                    "acknowledged_at": {
                      "type": "number"
                    },
                    "shift_type": {
                      "type": "string",
                      "description": "Shift kind, separate from numeric job role. Built-ins: day, night, sleep_in, waking_night, on_call, handover_overlap; tenant custom codes are supported."
                    },
                    "shift_category": {
                      "type": "string",
                      "enum": [
                        "day",
                        "night"
                      ]
                    },
                    "rota_date": {
                      "type": "string",
                      "format": "date",
                      "description": "Operational date using the location timezone and rota-day boundary captured for this shift."
                    },
                    "type_source": {
                      "type": "string",
                      "enum": [
                        "inferred",
                        "template",
                        "manual"
                      ]
                    },
                    "duration_minutes": {
                      "type": "number",
                      "description": "Actual elapsed UTC duration, before deducting breaks."
                    },
                    "disturbed_minutes": {
                      "type": "number",
                      "description": "Total non-overlapping sleep-in disturbance minutes."
                    },
                    "deleted_at": {
                      "type": "number",
                      "nullable": true
                    },
                    "deleted_by": {
                      "type": "number",
                      "nullable": true
                    },
                    "updated_by": {
                      "type": "number",
                      "nullable": true
                    },
                    "claim_open_shift_approval_required": {
                      "type": "boolean"
                    },
                    "unavailability_requests": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "swap_requests": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "published": {
                    "type": "boolean"
                  },
                  "start_time": {
                    "type": "number"
                  },
                  "end_time": {
                    "type": "number"
                  },
                  "minutes_break": {
                    "type": "number"
                  },
                  "user": {
                    "type": "number"
                  },
                  "location": {
                    "type": "number"
                  },
                  "role": {
                    "type": "number"
                  },
                  "notes": {
                    "type": "string"
                  },
                  "shift_type": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/shifts/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "published": {
                      "type": "boolean"
                    },
                    "open": {
                      "type": "boolean"
                    },
                    "start_time": {
                      "type": "number"
                    },
                    "end_time": {
                      "type": "number"
                    },
                    "minutes_break": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "location": {
                      "type": "number"
                    },
                    "role": {
                      "type": "number",
                      "nullable": true
                    },
                    "notes": {
                      "type": "string"
                    },
                    "created_by": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "number"
                    },
                    "updated_at": {
                      "nullable": true
                    },
                    "claimed": {
                      "type": "boolean"
                    },
                    "claimed_at": {
                      "nullable": true
                    },
                    "acknowledged": {
                      "type": "boolean"
                    },
                    "acknowledged_at": {
                      "type": "number"
                    },
                    "shift_type": {
                      "type": "string",
                      "description": "Shift kind, separate from numeric job role. Built-ins: day, night, sleep_in, waking_night, on_call, handover_overlap; tenant custom codes are supported."
                    },
                    "shift_category": {
                      "type": "string",
                      "enum": [
                        "day",
                        "night"
                      ]
                    },
                    "rota_date": {
                      "type": "string",
                      "format": "date",
                      "description": "Operational date using the location timezone and rota-day boundary captured for this shift."
                    },
                    "type_source": {
                      "type": "string",
                      "enum": [
                        "inferred",
                        "template",
                        "manual"
                      ]
                    },
                    "duration_minutes": {
                      "type": "number",
                      "description": "Actual elapsed UTC duration, before deducting breaks."
                    },
                    "disturbed_minutes": {
                      "type": "number",
                      "description": "Total non-overlapping sleep-in disturbance minutes."
                    },
                    "deleted_at": {
                      "type": "number",
                      "nullable": true
                    },
                    "deleted_by": {
                      "type": "number",
                      "nullable": true
                    },
                    "updated_by": {
                      "type": "number",
                      "nullable": true
                    },
                    "claim_open_shift_approval_required": {
                      "type": "boolean"
                    },
                    "unavailability_requests": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "swap_requests": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "published": {
                      "type": "boolean"
                    },
                    "open": {
                      "type": "boolean"
                    },
                    "start_time": {
                      "type": "number"
                    },
                    "end_time": {
                      "type": "number"
                    },
                    "minutes_break": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "location": {
                      "type": "number"
                    },
                    "role": {
                      "type": "number",
                      "nullable": true
                    },
                    "notes": {
                      "type": "string"
                    },
                    "created_by": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "number"
                    },
                    "updated_at": {
                      "nullable": true
                    },
                    "claimed": {
                      "type": "boolean"
                    },
                    "claimed_at": {
                      "nullable": true
                    },
                    "acknowledged": {
                      "type": "boolean"
                    },
                    "acknowledged_at": {
                      "type": "number"
                    },
                    "shift_type": {
                      "type": "string",
                      "description": "Shift kind, separate from numeric job role. Built-ins: day, night, sleep_in, waking_night, on_call, handover_overlap; tenant custom codes are supported."
                    },
                    "shift_category": {
                      "type": "string",
                      "enum": [
                        "day",
                        "night"
                      ]
                    },
                    "rota_date": {
                      "type": "string",
                      "format": "date",
                      "description": "Operational date using the location timezone and rota-day boundary captured for this shift."
                    },
                    "type_source": {
                      "type": "string",
                      "enum": [
                        "inferred",
                        "template",
                        "manual"
                      ]
                    },
                    "duration_minutes": {
                      "type": "number",
                      "description": "Actual elapsed UTC duration, before deducting breaks."
                    },
                    "disturbed_minutes": {
                      "type": "number",
                      "description": "Total non-overlapping sleep-in disturbance minutes."
                    },
                    "deleted_at": {
                      "type": "number",
                      "nullable": true
                    },
                    "deleted_by": {
                      "type": "number",
                      "nullable": true
                    },
                    "updated_by": {
                      "type": "number",
                      "nullable": true
                    },
                    "claim_open_shift_approval_required": {
                      "type": "boolean"
                    },
                    "unavailability_requests": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "swap_requests": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "published": {
                    "type": "boolean"
                  },
                  "start_time": {
                    "type": "number"
                  },
                  "end_time": {
                    "type": "number"
                  },
                  "minutes_break": {
                    "type": "number"
                  },
                  "user": {
                    "type": "number"
                  },
                  "location": {
                    "type": "number"
                  },
                  "role": {
                    "type": "number"
                  },
                  "notes": {
                    "type": "string"
                  },
                  "shift_type": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/shifts_acknowledged": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "shifts"
                ],
                "properties": {
                  "shifts": {
                    "type": "array",
                    "items": {}
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/shifts_published": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "shifts"
                ],
                "properties": {
                  "shifts": {
                    "type": "array",
                    "items": {}
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "shifts"
                ],
                "properties": {
                  "shifts": {
                    "type": "array",
                    "items": {}
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/swap_requests": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "status": {
                        "type": "string"
                      },
                      "requested_at": {
                        "type": "number"
                      },
                      "old_user": {
                        "type": "number"
                      },
                      "new_user": {
                        "type": "number"
                      },
                      "user_approved": {
                        "type": "boolean"
                      },
                      "user_replied_at": {
                        "type": "number"
                      },
                      "admin_approved": {
                        "nullable": true,
                        "type": "boolean"
                      },
                      "admin_replied_at": {
                        "nullable": true,
                        "type": "number"
                      },
                      "shift": {
                        "type": "number"
                      },
                      "swapped_shift": {
                        "nullable": true
                      }
                    },
                    "required": [
                      "id",
                      "deleted",
                      "status",
                      "requested_at",
                      "old_user",
                      "new_user",
                      "user_approved",
                      "user_replied_at",
                      "admin_approved",
                      "admin_replied_at",
                      "shift",
                      "swapped_shift"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "number"
                    },
                    "old_user": {
                      "type": "number"
                    },
                    "new_user": {
                      "type": "number"
                    },
                    "user_approved": {
                      "nullable": true
                    },
                    "user_replied_at": {
                      "nullable": true
                    },
                    "admin_approved": {
                      "nullable": true
                    },
                    "admin_replied_at": {
                      "nullable": true
                    },
                    "shift": {
                      "type": "number"
                    },
                    "swapped_shift": {
                      "nullable": true
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shift": {
                    "type": "number"
                  },
                  "new_user": {
                    "type": "number"
                  },
                  "swapped_shift": {
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/swap_requests/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "number"
                    },
                    "old_user": {
                      "type": "number"
                    },
                    "new_user": {
                      "type": "number"
                    },
                    "user_approved": {
                      "type": "boolean"
                    },
                    "user_replied_at": {
                      "type": "number"
                    },
                    "admin_approved": {
                      "nullable": true
                    },
                    "admin_replied_at": {
                      "nullable": true
                    },
                    "shift": {
                      "type": "number"
                    },
                    "swapped_shift": {
                      "nullable": true
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "number"
                    },
                    "old_user": {
                      "type": "number"
                    },
                    "new_user": {
                      "type": "number"
                    },
                    "user_approved": {
                      "type": "boolean"
                    },
                    "user_replied_at": {
                      "type": "number"
                    },
                    "admin_approved": {
                      "nullable": true
                    },
                    "admin_replied_at": {
                      "type": "number"
                    },
                    "shift": {
                      "type": "number"
                    },
                    "swapped_shift": {
                      "nullable": true
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "admin_approved": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/terminals": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "name": {
                        "type": "string"
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "platform": {
                        "nullable": true,
                        "type": "string"
                      },
                      "device": {
                        "nullable": true,
                        "type": "string"
                      },
                      "version": {
                        "nullable": true,
                        "type": "string"
                      },
                      "ip": {
                        "nullable": true,
                        "type": "string"
                      },
                      "location": {
                        "properties": {
                          "lat": {
                            "type": "number"
                          },
                          "lng": {
                            "type": "number"
                          },
                          "accuracy": {
                            "type": "number"
                          }
                        },
                        "nullable": true,
                        "type": "object"
                      },
                      "timezone": {
                        "type": "number"
                      },
                      "require_photo": {
                        "type": "boolean"
                      },
                      "require_photo_breaks": {
                        "type": "boolean"
                      },
                      "default_location": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "id",
                      "deleted",
                      "name",
                      "active",
                      "platform",
                      "device",
                      "version",
                      "ip",
                      "location",
                      "timezone",
                      "require_photo",
                      "require_photo_breaks",
                      "default_location"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "platform": {
                      "nullable": true
                    },
                    "device": {
                      "nullable": true
                    },
                    "version": {
                      "nullable": true
                    },
                    "ip": {
                      "nullable": true
                    },
                    "location": {
                      "nullable": true
                    },
                    "timezone": {
                      "type": "number"
                    },
                    "require_photo": {
                      "type": "boolean"
                    },
                    "require_photo_breaks": {
                      "type": "boolean"
                    },
                    "default_location": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "number"
                  },
                  "default_location": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/terminals/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "device": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "ip": {
                      "type": "string"
                    },
                    "location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    },
                    "timezone": {
                      "type": "number"
                    },
                    "require_photo": {
                      "type": "boolean"
                    },
                    "require_photo_breaks": {
                      "type": "boolean"
                    },
                    "default_location": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "platform": {
                      "nullable": true
                    },
                    "device": {
                      "nullable": true
                    },
                    "version": {
                      "nullable": true
                    },
                    "ip": {
                      "nullable": true
                    },
                    "location": {
                      "nullable": true
                    },
                    "timezone": {
                      "type": "number"
                    },
                    "require_photo": {
                      "type": "boolean"
                    },
                    "require_photo_breaks": {
                      "type": "boolean"
                    },
                    "default_location": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "number"
                  },
                  "default_location": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/terminals_active": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "name": {
                        "type": "string"
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "platform": {
                        "type": "string"
                      },
                      "device": {
                        "type": "string"
                      },
                      "version": {
                        "type": "string"
                      },
                      "ip": {
                        "type": "string"
                      },
                      "location": {
                        "type": "object",
                        "properties": {
                          "lat": {
                            "type": "number"
                          },
                          "lng": {
                            "type": "number"
                          },
                          "accuracy": {
                            "type": "number"
                          }
                        }
                      },
                      "timezone": {
                        "type": "number"
                      },
                      "require_photo": {
                        "type": "boolean"
                      },
                      "require_photo_breaks": {
                        "type": "boolean"
                      },
                      "default_location": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "device": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "ip": {
                      "type": "string"
                    },
                    "location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    },
                    "timezone": {
                      "type": "number"
                    },
                    "require_photo": {
                      "type": "boolean"
                    },
                    "require_photo_breaks": {
                      "type": "boolean"
                    },
                    "default_location": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "terminal": {
                    "type": "number"
                  },
                  "device": {
                    "type": "string"
                  },
                  "location": {
                    "type": "object",
                    "properties": {
                      "lat": {
                        "type": "number"
                      },
                      "lng": {
                        "type": "number"
                      },
                      "accuracy": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/terminals_active/{id}": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string"
                  },
                  "device": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/timezones": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      },
                      "continent": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "sub": {
                        "nullable": true
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "continent",
                      "city",
                      "sub"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/timezones/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "continent": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "sub": {
                      "nullable": true
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/toil_accruals": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "created_at": {
                        "type": "number"
                      },
                      "created_by": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "deleted_at": {
                        "nullable": true,
                        "type": "number"
                      },
                      "deleted_by": {
                        "nullable": true,
                        "type": "number"
                      },
                      "leave_year": {
                        "type": "number"
                      },
                      "comments": {
                        "type": "string"
                      },
                      "location_id": {
                        "type": "number"
                      },
                      "duration_hours": {
                        "type": "number"
                      },
                      "date": {
                        "type": "string"
                      },
                      "user_id": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "id",
                      "created_at",
                      "created_by",
                      "deleted",
                      "deleted_at",
                      "deleted_by",
                      "leave_year",
                      "comments",
                      "location_id",
                      "duration_hours",
                      "date",
                      "user_id"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "number"
                    },
                    "created_by": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "deleted_at": {
                      "nullable": true
                    },
                    "deleted_by": {
                      "nullable": true
                    },
                    "leave_year": {
                      "type": "number"
                    },
                    "comments": {
                      "type": "string"
                    },
                    "location_id": {
                      "type": "number"
                    },
                    "duration_hours": {
                      "type": "number"
                    },
                    "date": {
                      "type": "string"
                    },
                    "user_id": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "duration_hours": {
                    "type": "number"
                  },
                  "date": {
                    "type": "string"
                  },
                  "leave_year": {
                    "type": "number"
                  },
                  "location_id": {
                    "type": "number"
                  },
                  "comments": {
                    "type": "string"
                  },
                  "user_id": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/toil_accruals/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": "number"
                    },
                    "created_by": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "leave_year": {
                      "type": "number"
                    },
                    "comments": {
                      "type": "string"
                    },
                    "location_id": {
                      "type": "number"
                    },
                    "duration_hours": {
                      "type": "number"
                    },
                    "date": {
                      "type": "string"
                    },
                    "user_id": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/toil_allowance": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "users",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/unavailability_requests": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "status": {
                        "type": "string"
                      },
                      "requested_at": {
                        "type": "number"
                      },
                      "shift": {
                        "type": "number"
                      },
                      "user": {
                        "type": "number"
                      },
                      "user_message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "deleted",
                      "status",
                      "requested_at",
                      "shift",
                      "user",
                      "user_message"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "shift_start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "shift_end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "number"
                    },
                    "shift": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "user_message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shift": {
                    "type": "number"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/unavailability_requests/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "number"
                    },
                    "shift": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "user_message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/unavailability_requests/{id}/approve": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "number"
                    },
                    "shift": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "admin": {
                      "type": "number"
                    },
                    "user_message": {
                      "type": "string"
                    },
                    "admin_message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/unavailability_requests/{id}/deny": {
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "requested_at": {
                      "type": "number"
                    },
                    "shift": {
                      "type": "number"
                    },
                    "user": {
                      "type": "number"
                    },
                    "admin": {
                      "type": "number"
                    },
                    "user_message": {
                      "type": "string"
                    },
                    "admin_message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "deleted": {
                        "type": "boolean"
                      },
                      "level": {
                        "type": "string"
                      },
                      "first_name": {
                        "type": "string"
                      },
                      "last_name": {
                        "type": "string"
                      },
                      "photo": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "group": {
                        "nullable": true,
                        "type": "number"
                      },
                      "locations": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      },
                      "roles": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      },
                      "default_role": {
                        "type": "number"
                      },
                      "dob": {
                        "type": "string"
                      },
                      "start_date": {
                        "nullable": true,
                        "type": "string"
                      },
                      "final_working_date": {
                        "nullable": true
                      },
                      "weekly_hours": {
                        "type": "number"
                      },
                      "holiday_allowance": {
                        "type": "number"
                      },
                      "holiday_allowance_unit": {
                        "type": "string"
                      },
                      "payroll_id": {
                        "type": "string"
                      },
                      "salary": {
                        "type": "number"
                      },
                      "salary_type": {
                        "type": "string"
                      },
                      "overtime_rate": {
                        "nullable": true,
                        "type": "number"
                      },
                      "role_rates": {
                        "type": "object",
                        "properties": {
                          "3": {
                            "type": "object",
                            "properties": {
                              "per_hour": {
                                "type": "number"
                              },
                              "per_shift": {
                                "type": "number"
                              }
                            }
                          },
                          "7": {
                            "type": "object",
                            "properties": {
                              "per_hour": {
                                "type": "number"
                              },
                              "per_shift": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      },
                      "leave_rates": {
                        "type": "object",
                        "properties": {
                          "1": {
                            "type": "number"
                          },
                          "2": {
                            "type": "number"
                          }
                        }
                      },
                      "leave_rates_unit": {
                        "type": "string"
                      },
                      "leave_rates_type": {
                        "type": "string"
                      },
                      "notes": {
                        "nullable": true,
                        "type": "string"
                      },
                      "preferences": {
                        "type": "object",
                        "properties": {
                          "setup_steps_hidden": {
                            "type": "boolean"
                          }
                        }
                      },
                      "permissions": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "locations_manager": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      },
                      "locations_cover": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      }
                    },
                    "required": [
                      "id",
                      "deleted",
                      "level",
                      "first_name",
                      "last_name",
                      "photo",
                      "email",
                      "group",
                      "locations",
                      "roles",
                      "default_role",
                      "dob",
                      "start_date",
                      "final_working_date",
                      "weekly_hours",
                      "holiday_allowance",
                      "holiday_allowance_unit",
                      "payroll_id",
                      "salary",
                      "salary_type",
                      "overtime_rate",
                      "role_rates",
                      "leave_rates",
                      "leave_rates_unit",
                      "leave_rates_type",
                      "notes",
                      "preferences"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "items": {}
            }
          },
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "only_managed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_self",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "level": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "photo": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "group": {
                      "type": "number"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "default_role": {
                      "type": "number"
                    },
                    "dob": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "final_working_date": {
                      "nullable": true
                    },
                    "weekly_hours": {
                      "type": "number"
                    },
                    "holiday_allowance": {
                      "type": "number"
                    },
                    "holiday_allowance_unit": {
                      "type": "string"
                    },
                    "payroll_id": {
                      "type": "string"
                    },
                    "salary": {
                      "type": "number"
                    },
                    "salary_type": {
                      "type": "string"
                    },
                    "overtime_rate": {
                      "type": "number"
                    },
                    "role_rates": {
                      "type": "object",
                      "properties": {
                        "3": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        },
                        "7": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "leave_rates": {
                      "type": "object",
                      "properties": {
                        "1": {
                          "type": "number"
                        },
                        "2": {
                          "type": "number"
                        }
                      }
                    },
                    "leave_rates_unit": {
                      "type": "string"
                    },
                    "leave_rates_type": {
                      "type": "string"
                    },
                    "notes": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "level": {
                    "type": "string"
                  },
                  "send_invite": {
                    "type": "boolean"
                  },
                  "first_name": {
                    "type": "string"
                  },
                  "last_name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "roles": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "default_role": {
                    "type": "number"
                  },
                  "dob": {
                    "type": "string"
                  },
                  "start_date": {
                    "type": "string"
                  },
                  "final_working_date": {
                    "nullable": true
                  },
                  "weekly_hours": {
                    "type": "number"
                  },
                  "holiday_allowance": {
                    "type": "number"
                  },
                  "holiday_allowance_unit": {
                    "type": "string"
                  },
                  "payroll_id": {
                    "type": "string"
                  },
                  "salary": {
                    "type": "number"
                  },
                  "salary_type": {
                    "type": "string"
                  },
                  "overtime_rate": {
                    "type": "number"
                  },
                  "role_rates": {
                    "type": "object",
                    "properties": {
                      "3": {
                        "type": "object",
                        "properties": {
                          "per_hour": {
                            "type": "number"
                          },
                          "per_shift": {
                            "type": "number"
                          }
                        }
                      },
                      "7": {
                        "type": "object",
                        "properties": {
                          "per_hour": {
                            "type": "number"
                          },
                          "per_shift": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "leave_rates": {
                    "type": "object",
                    "properties": {
                      "1": {
                        "type": "number"
                      },
                      "2": {
                        "type": "number"
                      }
                    }
                  },
                  "notes": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 128,
                    "writeOnly": true
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/users/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "level": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "photo": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "group": {
                      "type": "number"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "default_role": {
                      "type": "number"
                    },
                    "dob": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "final_working_date": {
                      "nullable": true
                    },
                    "weekly_hours": {
                      "type": "number"
                    },
                    "holiday_allowance": {
                      "type": "number"
                    },
                    "holiday_allowance_unit": {
                      "type": "string"
                    },
                    "payroll_id": {
                      "type": "string"
                    },
                    "salary": {
                      "type": "number"
                    },
                    "salary_type": {
                      "type": "string"
                    },
                    "overtime_rate": {
                      "type": "number"
                    },
                    "role_rates": {
                      "type": "object",
                      "properties": {
                        "3": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        },
                        "7": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "leave_rates": {
                      "type": "object",
                      "properties": {
                        "1": {
                          "type": "number"
                        },
                        "2": {
                          "type": "number"
                        }
                      }
                    },
                    "leave_rates_unit": {
                      "type": "string"
                    },
                    "leave_rates_type": {
                      "type": "string"
                    },
                    "notes": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "level": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "photo": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "group": {
                      "type": "number"
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "default_role": {
                      "type": "number"
                    },
                    "dob": {
                      "type": "string"
                    },
                    "start_date": {
                      "type": "string"
                    },
                    "final_working_date": {
                      "nullable": true
                    },
                    "weekly_hours": {
                      "type": "number"
                    },
                    "holiday_allowance": {
                      "type": "number"
                    },
                    "holiday_allowance_unit": {
                      "type": "string"
                    },
                    "payroll_id": {
                      "type": "string"
                    },
                    "salary": {
                      "type": "number"
                    },
                    "salary_type": {
                      "type": "string"
                    },
                    "overtime_rate": {
                      "type": "number"
                    },
                    "role_rates": {
                      "type": "object",
                      "properties": {
                        "3": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        },
                        "7": {
                          "type": "object",
                          "properties": {
                            "per_hour": {
                              "type": "number"
                            },
                            "per_shift": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "leave_rates": {
                      "type": "object",
                      "properties": {
                        "1": {
                          "type": "number"
                        },
                        "2": {
                          "type": "number"
                        }
                      }
                    },
                    "leave_rates_unit": {
                      "type": "string"
                    },
                    "leave_rates_type": {
                      "type": "string"
                    },
                    "notes": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deleted": {
                    "type": "boolean"
                  },
                  "level": {
                    "type": "string"
                  },
                  "first_name": {
                    "type": "string"
                  },
                  "last_name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "group": {
                    "type": "number"
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "roles": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "default_role": {
                    "type": "number"
                  },
                  "dob": {
                    "type": "string"
                  },
                  "start_date": {
                    "type": "string"
                  },
                  "final_working_date": {
                    "nullable": true
                  },
                  "weekly_hours": {
                    "type": "number"
                  },
                  "holiday_allowance": {
                    "type": "number"
                  },
                  "holiday_allowance_unit": {
                    "type": "string"
                  },
                  "payroll_id": {
                    "type": "string"
                  },
                  "salary": {
                    "type": "number"
                  },
                  "salary_type": {
                    "type": "string"
                  },
                  "overtime_rate": {
                    "type": "number"
                  },
                  "role_rates": {
                    "type": "object",
                    "properties": {
                      "3": {
                        "type": "object",
                        "properties": {
                          "per_hour": {
                            "type": "number"
                          },
                          "per_shift": {
                            "type": "number"
                          }
                        }
                      },
                      "7": {
                        "type": "object",
                        "properties": {
                          "per_hour": {
                            "type": "number"
                          },
                          "per_shift": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "leave_rates": {
                    "type": "object",
                    "properties": {
                      "1": {
                        "type": "number"
                      },
                      "2": {
                        "type": "number"
                      }
                    }
                  },
                  "notes": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/users_clocked_in": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "user": {
                        "type": "number"
                      },
                      "location": {
                        "type": "number"
                      },
                      "role": {
                        "type": "number"
                      },
                      "in_time": {
                        "type": "number"
                      },
                      "minutes_late": {
                        "type": "number"
                      },
                      "shift": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "start_time": {
                            "type": "number"
                          },
                          "end_time": {
                            "type": "number"
                          },
                          "minutes_break": {
                            "type": "number"
                          },
                          "location": {
                            "type": "number"
                          },
                          "role": {
                            "type": "number"
                          }
                        }
                      },
                      "in_method": {
                        "type": "string"
                      },
                      "in_location": {
                        "type": "object",
                        "properties": {
                          "lat": {
                            "type": "number"
                          },
                          "lng": {
                            "type": "number"
                          },
                          "accuracy": {
                            "type": "number"
                          }
                        }
                      },
                      "in_device": {
                        "nullable": true
                      },
                      "in_terminal": {
                        "nullable": true
                      }
                    },
                    "required": [
                      "user",
                      "location",
                      "role",
                      "in_time",
                      "minutes_late",
                      "shift",
                      "in_method",
                      "in_location",
                      "in_device",
                      "in_terminal"
                    ]
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "number"
                    },
                    "location": {
                      "type": "number"
                    },
                    "role": {
                      "type": "number"
                    },
                    "in_time": {
                      "type": "number"
                    },
                    "minutes_late": {
                      "type": "number"
                    },
                    "shift": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "start_time": {
                          "type": "number"
                        },
                        "end_time": {
                          "type": "number"
                        },
                        "minutes_break": {
                          "type": "number"
                        },
                        "location": {
                          "type": "number"
                        },
                        "role": {
                          "type": "number"
                        }
                      }
                    },
                    "in_method": {
                      "type": "string"
                    },
                    "in_location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    },
                    "in_device": {
                      "nullable": true
                    },
                    "in_terminal": {
                      "nullable": true
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "method"
                ],
                "properties": {
                  "method": {
                    "type": "string"
                  },
                  "shift": {
                    "type": "number"
                  },
                  "terminal": {
                    "type": "number"
                  },
                  "user": {
                    "type": "number"
                  },
                  "photo": {
                    "type": "string"
                  },
                  "location": {
                    "type": "object",
                    "required": [
                      "lat",
                      "lng",
                      "accuracy"
                    ],
                    "properties": {
                      "lat": {
                        "type": "number"
                      },
                      "lng": {
                        "type": "number"
                      },
                      "accuracy": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      }
    },
    "/users_clocked_in/{id}": {
      "get": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "number"
                    },
                    "location": {
                      "type": "number"
                    },
                    "role": {
                      "type": "number"
                    },
                    "in_time": {
                      "type": "number"
                    },
                    "minutes_late": {
                      "type": "number"
                    },
                    "shift": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "start_time": {
                          "type": "number"
                        },
                        "end_time": {
                          "type": "number"
                        },
                        "minutes_break": {
                          "type": "number"
                        },
                        "location": {
                          "type": "number"
                        },
                        "role": {
                          "type": "number"
                        }
                      }
                    },
                    "in_method": {
                      "type": "string"
                    },
                    "in_location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    },
                    "in_device": {
                      "nullable": true
                    },
                    "in_terminal": {
                      "nullable": true
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ]
      },
      "post": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "start_time": {
                      "type": "number"
                    },
                    "start_location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    },
                    "end_time": {
                      "type": "number"
                    },
                    "end_location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "method",
                  "action"
                ],
                "properties": {
                  "method": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string"
                  },
                  "terminal": {
                    "type": "number"
                  },
                  "photo": {
                    "type": "string"
                  },
                  "location": {
                    "type": "object",
                    "required": [
                      "lat",
                      "lng",
                      "accuracy"
                    ],
                    "properties": {
                      "lat": {
                        "type": "number"
                      },
                      "lng": {
                        "type": "number"
                      },
                      "accuracy": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "responses": {
          "200": {
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "approved": {
                      "type": "boolean"
                    },
                    "user": {
                      "type": "number"
                    },
                    "location": {
                      "type": "number"
                    },
                    "role": {
                      "type": "number"
                    },
                    "in_time": {
                      "type": "number"
                    },
                    "out_time": {
                      "type": "number"
                    },
                    "minutes_break": {
                      "type": "number"
                    },
                    "minutes_late": {
                      "type": "number"
                    },
                    "hours": {
                      "type": "number"
                    },
                    "hours_auto": {
                      "type": "number"
                    },
                    "hours_is_auto": {
                      "type": "boolean"
                    },
                    "notes": {
                      "nullable": true
                    },
                    "shift": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "start_time": {
                          "type": "number"
                        },
                        "end_time": {
                          "type": "number"
                        },
                        "minutes_break": {
                          "type": "number"
                        },
                        "location": {
                          "type": "number"
                        },
                        "role": {
                          "type": "number"
                        }
                      }
                    },
                    "in_method": {
                      "type": "string"
                    },
                    "in_location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    },
                    "in_device": {
                      "nullable": true
                    },
                    "in_terminal": {
                      "nullable": true
                    },
                    "out_method": {
                      "type": "string"
                    },
                    "out_location": {
                      "type": "object",
                      "properties": {
                        "lat": {
                          "type": "number"
                        },
                        "lng": {
                          "type": "number"
                        },
                        "accuracy": {
                          "type": "number"
                        }
                      }
                    },
                    "out_device": {
                      "nullable": true
                    },
                    "out_terminal": {
                      "nullable": true
                    },
                    "clock_in_verified": {
                      "type": "boolean",
                      "description": "True only when arrival was verified using a live QR and workplace network."
                    },
                    "clock_out_verified": {
                      "type": "boolean",
                      "description": "True only when departure was verified using a live QR and workplace network."
                    },
                    "voided": {
                      "type": "boolean",
                      "description": "Voided attendance is excluded from paid hours."
                    }
                  }
                }
              }
            },
            "description": "Successful response"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "User",
            "in": "header",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional RotaTree numeric user ID for scoped impersonation."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "method"
                ],
                "properties": {
                  "method": {
                    "type": "string"
                  },
                  "terminal": {
                    "type": "number"
                  },
                  "photo": {
                    "type": "string"
                  },
                  "location": {
                    "type": "object",
                    "required": [
                      "lat",
                      "lng",
                      "accuracy"
                    ],
                    "properties": {
                      "lat": {
                        "type": "number"
                      },
                      "lng": {
                        "type": "number"
                      },
                      "accuracy": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
