{
  "openapi": "3.1.0",
  "info": {
    "title": "AveeCare API",
    "version": "1.0.0",
    "description": "The AveeCare API gives your own programs access to your agency's data in AveeCare: patients, caregivers, visits, care documentation, billing records and messages.\n\n**Authentication.** Create an API key in AveeCare under Settings → API Keys, then send it on every request as `Authorization: Bearer ak_...`. A key acts as the person who created it: it can see and change exactly what that person can in AveeCare, in their agency only. Keys are either read-only or read & write. Keep keys on your server; never put one in a web page or mobile app.\n\n**Pagination.** List endpoints return `{ \"object\": \"list\", \"data\": [...], \"next_cursor\": \"...\", \"has_more\": true }`. Pass `next_cursor` back as `cursor`, with the same filters, to get the next page. `limit` is 1 to 100 (default 25). Cursors are opaque; do not build or change them.\n\n**Errors.** Every error is `{ \"error\": { \"type\", \"code\", \"message\", \"request_id\" } }` with a fixed `code`: `invalid_request`, `unknown_field`, `unauthorized`, `forbidden`, `insufficient_scope`, `not_found`, `rate_limited`, `idempotency_conflict` or `internal_error`. Fields a resource does not have are refused with `unknown_field` rather than ignored.\n\n**Retries.** Send an `Idempotency-Key` header (a UUID works well) on `POST` requests. Retrying with the same key within 24 hours returns the first result instead of creating a duplicate.\n\n**Rate limits.** Each key may make 60 requests a minute. Every response carries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`; when you are over the limit you get `429` with `Retry-After`.\n\n**Conventions.** Field names are camelCase. Times are ISO 8601 in UTC; dates are `YYYY-MM-DD`. Money is in cents. Every response has a `Request-Id` header; quote it when contacting support.",
    "contact": {
      "name": "AveeCare",
      "url": "https://www.aveecare.com"
    }
  },
  "servers": [
    {
      "url": "https://api.aveecare.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Patients",
      "description": "Patients are the clients your agency provides care to, including prospective clients you have not yet admitted.",
      "x-aveecare-group": "Patients"
    },
    {
      "name": "Contacts",
      "description": "Contacts are family members and other people connected to a patient, such as an emergency contact.",
      "x-aveecare-group": "Patients"
    },
    {
      "name": "Allergies",
      "description": "Allergies recorded on a patient's profile.",
      "x-aveecare-group": "Patients"
    },
    {
      "name": "Medications",
      "description": "Medications on a patient's medication list, with the schedule caregivers follow when they give or assist with them.",
      "x-aveecare-group": "Patients"
    },
    {
      "name": "Care Goals",
      "description": "Goals of care set for a patient, such as walking to the mailbox unaided.",
      "x-aveecare-group": "Patients"
    },
    {
      "name": "Patient Notes",
      "description": "Notes your staff and caregivers keep on a patient's profile.",
      "x-aveecare-group": "Patients"
    },
    {
      "name": "Medication Administrations",
      "description": "The medication administration record (MAR): each dose a caregiver gave, or the reason it was not given. Read-only.",
      "x-aveecare-group": "Care"
    },
    {
      "name": "OASIS Assessments",
      "description": "OASIS assessments recorded for Medicare home health patients. This lists each assessment and its status; the item-level answers are not included. Read-only.",
      "x-aveecare-group": "Care"
    },
    {
      "name": "Caregivers",
      "description": "Caregivers are the aides, nurses and therapists your agency schedules to visit patients.",
      "x-aveecare-group": "Caregivers"
    },
    {
      "name": "Caregiver Notes",
      "description": "Notes your staff keep on a caregiver's profile.",
      "x-aveecare-group": "Caregivers"
    },
    {
      "name": "Certifications",
      "description": "Certifications, licenses and background checks on a caregiver's profile, with their expiry dates.",
      "x-aveecare-group": "Caregivers"
    },
    {
      "name": "Availability",
      "description": "When a caregiver can or cannot work. A window is either a weekly recurring time on one weekday, or a one-off date range such as time off.",
      "x-aveecare-group": "Caregivers"
    },
    {
      "name": "Specializations",
      "description": "Skills and specialties on a caregiver's profile, such as dementia care or Hoyer lift transfers.",
      "x-aveecare-group": "Caregivers"
    },
    {
      "name": "Applicants",
      "description": "People who applied to work for your agency, tracked through your hiring stages until they are hired as caregivers.",
      "x-aveecare-group": "Caregivers"
    },
    {
      "name": "Visits",
      "description": "Visits are scheduled or completed caregiver shifts at a patient's home. A visit's patient, caregiver, times and status are set when it is created; reschedule or reassign a visit in AveeCare.",
      "x-aveecare-group": "Scheduling"
    },
    {
      "name": "Visit Notes",
      "description": "Notes written about a visit by the caregiver or office staff.",
      "x-aveecare-group": "Scheduling"
    },
    {
      "name": "Visit Requests",
      "description": "Requests from caregivers to pick up visits with a patient, which office staff approve or deny.",
      "x-aveecare-group": "Scheduling"
    },
    {
      "name": "Open Shifts",
      "description": "Open shifts are unassigned visits offered to caregivers so one of them can claim it.",
      "x-aveecare-group": "Scheduling"
    },
    {
      "name": "Shift Swaps",
      "description": "Requests from one caregiver to hand a visit to another, which the other caregiver and then the office approve.",
      "x-aveecare-group": "Scheduling"
    },
    {
      "name": "Care Plans",
      "description": "Care plans describe the services a patient receives, how often, and when the plan is next reviewed. The plan's goals and task lists are managed in AveeCare and are not included here.",
      "x-aveecare-group": "Care"
    },
    {
      "name": "Progress Notes",
      "description": "Progress notes are the clinical summaries caregivers write after a visit.",
      "x-aveecare-group": "Care"
    },
    {
      "name": "Authorizations",
      "description": "Payer authorizations: how many units of a service a payer has approved for a patient, and over what dates.",
      "x-aveecare-group": "Care"
    },
    {
      "name": "Incidents",
      "description": "Incident reports: falls, injuries, medication errors and other events that need follow-up, often for regulatory reporting.",
      "x-aveecare-group": "Care"
    },
    {
      "name": "Events",
      "description": "Events your agency documents about a patient, caregiver or visit, such as a complaint, a compliment or an attendance issue.",
      "x-aveecare-group": "Care"
    },
    {
      "name": "Referral Sources",
      "description": "Hospitals, physicians, case managers and other organizations that refer clients to your agency.",
      "x-aveecare-group": "Referrals"
    },
    {
      "name": "Referrals",
      "description": "Individual referrals of a prospective client, tracked from first contact to admission.",
      "x-aveecare-group": "Referrals"
    },
    {
      "name": "Invoices",
      "description": "Invoices billed to patients and their families for private-pay care. Read-only.",
      "x-aveecare-group": "Billing"
    },
    {
      "name": "Invoice Line Items",
      "description": "The individual charges on an invoice. Read-only.",
      "x-aveecare-group": "Billing"
    },
    {
      "name": "Claims",
      "description": "Insurance claims billed to Medicaid, Medicare and other payers, with their adjudication status. Read-only.",
      "x-aveecare-group": "Billing"
    },
    {
      "name": "Payroll Entries",
      "description": "One caregiver's hours and pay for one pay period. Read-only.",
      "x-aveecare-group": "Billing"
    },
    {
      "name": "Conversations",
      "description": "In-app message threads between people at your agency: one-to-one chats and named group chats. Read-only; start conversations in AveeCare.",
      "x-aveecare-group": "Messaging"
    },
    {
      "name": "Messages",
      "description": "Messages in a conversation. Messages you send through the API are sent as the API key's user.",
      "x-aveecare-group": "Messaging"
    },
    {
      "name": "Alerts",
      "description": "Alerts on your agency's alert board, such as a credential about to expire or a missed clock-in, and announcements staff post for caregivers.",
      "x-aveecare-group": "Messaging"
    },
    {
      "name": "Offices",
      "description": "Your agency's offices (branches). Patients, caregivers and applicants can each belong to one office. There is always exactly one default office.",
      "x-aveecare-group": "Account"
    },
    {
      "name": "Me",
      "description": "The API key making the request: its scopes, its user's role and its agency.",
      "x-aveecare-group": "Account"
    }
  ],
  "x-tagGroups": [
    {
      "name": "Patients",
      "tags": [
        "Patients",
        "Contacts",
        "Allergies",
        "Medications",
        "Care Goals",
        "Patient Notes"
      ]
    },
    {
      "name": "Caregivers",
      "tags": [
        "Caregivers",
        "Caregiver Notes",
        "Certifications",
        "Availability",
        "Specializations",
        "Applicants"
      ]
    },
    {
      "name": "Scheduling",
      "tags": [
        "Visits",
        "Visit Notes",
        "Visit Requests",
        "Open Shifts",
        "Shift Swaps"
      ]
    },
    {
      "name": "Care",
      "tags": [
        "Medication Administrations",
        "OASIS Assessments",
        "Care Plans",
        "Progress Notes",
        "Authorizations",
        "Incidents",
        "Events"
      ]
    },
    {
      "name": "Referrals",
      "tags": [
        "Referral Sources",
        "Referrals"
      ]
    },
    {
      "name": "Billing",
      "tags": [
        "Invoices",
        "Invoice Line Items",
        "Claims",
        "Payroll Entries"
      ]
    },
    {
      "name": "Messaging",
      "tags": [
        "Conversations",
        "Messages",
        "Alerts"
      ]
    },
    {
      "name": "Account",
      "tags": [
        "Me",
        "Offices"
      ]
    }
  ],
  "paths": {
    "/v1/patients": {
      "get": {
        "operationId": "patients.list",
        "tags": [
          "Patients"
        ],
        "summary": "List patients",
        "description": "Returns a page of patients. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return patients with this status.",
            "schema": {
              "type": "string"
            },
            "example": "Active"
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "Only return active (`true`) or inactive (`false`) patients.",
            "schema": {
              "type": "boolean"
            },
            "example": true
          },
          {
            "name": "lifecycle_stage",
            "in": "query",
            "required": false,
            "description": "Only return prospects or clients.",
            "schema": {
              "type": "string",
              "enum": [
                "Prospect",
                "Client"
              ]
            },
            "example": "Prospect"
          },
          {
            "name": "office_id",
            "in": "query",
            "required": false,
            "description": "Only return patients served by this office.",
            "schema": {
              "type": "string"
            },
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "patients.create",
        "tags": [
          "Patients"
        ],
        "summary": "Create a patient",
        "description": "Creates a patient and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatientCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new patient.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Patient"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/patients/{id}": {
      "get": {
        "operationId": "patients.retrieve",
        "tags": [
          "Patients"
        ],
        "summary": "Retrieve a patient",
        "description": "Returns one patient by ID.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the patient.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The patient.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Patient"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "patients.update",
        "tags": [
          "Patients"
        ],
        "summary": "Update a patient",
        "description": "Changes the fields you send and returns the updated patient. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the patient.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatientUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated patient.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Patient"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "patients.delete",
        "tags": [
          "Patients"
        ],
        "summary": "Delete a patient",
        "description": "Deletes a patient. The patient's visits, notes and other related records are not deleted. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the patient.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The patient was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/contacts": {
      "get": {
        "operationId": "contacts.list",
        "tags": [
          "Contacts"
        ],
        "summary": "List contacts",
        "description": "Returns a page of contacts. Filters combine with AND. Use `next_cursor` to fetch the next page.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return contacts of this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "contacts.create",
        "tags": [
          "Contacts"
        ],
        "summary": "Create a contact",
        "description": "Creates a contact and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new contact.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/contacts/{id}": {
      "get": {
        "operationId": "contacts.retrieve",
        "tags": [
          "Contacts"
        ],
        "summary": "Retrieve a contact",
        "description": "Returns one contact by ID.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the contact.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The contact.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "contacts.update",
        "tags": [
          "Contacts"
        ],
        "summary": "Update a contact",
        "description": "Changes the fields you send and returns the updated contact. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the contact.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated contact.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "contacts.delete",
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact",
        "description": "Deletes a contact. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the contact.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The contact was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/allergies": {
      "get": {
        "operationId": "allergies.list",
        "tags": [
          "Allergies"
        ],
        "summary": "List allergies",
        "description": "Returns a page of allergies. Filters combine with AND. Use `next_cursor` to fetch the next page.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return allergies of this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllergyList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "allergies.create",
        "tags": [
          "Allergies"
        ],
        "summary": "Create an allergy",
        "description": "Creates an allergy and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllergyCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new allergy.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Allergy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/allergies/{id}": {
      "get": {
        "operationId": "allergies.retrieve",
        "tags": [
          "Allergies"
        ],
        "summary": "Retrieve an allergy",
        "description": "Returns one allergy by ID.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the allergy.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The allergy.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Allergy"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "allergies.update",
        "tags": [
          "Allergies"
        ],
        "summary": "Update an allergy",
        "description": "Changes the fields you send and returns the updated allergy. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the allergy.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllergyUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated allergy.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Allergy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "allergies.delete",
        "tags": [
          "Allergies"
        ],
        "summary": "Delete an allergy",
        "description": "Deletes an allergy. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the allergy.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The allergy was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllergyDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/medications": {
      "get": {
        "operationId": "medications.list",
        "tags": [
          "Medications"
        ],
        "summary": "List medications",
        "description": "Returns a page of medications. Filters combine with AND. Use `next_cursor` to fetch the next page.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return medications of this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return medications with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Active",
                "OnHold",
                "Discontinued"
              ]
            },
            "example": "Active"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "medications.create",
        "tags": [
          "Medications"
        ],
        "summary": "Create a medication",
        "description": "Creates a medication and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MedicationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new medication.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Medication"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/medications/{id}": {
      "get": {
        "operationId": "medications.retrieve",
        "tags": [
          "Medications"
        ],
        "summary": "Retrieve a medication",
        "description": "Returns one medication by ID.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the medication.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The medication.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Medication"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "medications.update",
        "tags": [
          "Medications"
        ],
        "summary": "Update a medication",
        "description": "Changes the fields you send and returns the updated medication. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the medication.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MedicationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated medication.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Medication"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "medications.delete",
        "tags": [
          "Medications"
        ],
        "summary": "Delete a medication",
        "description": "Deletes a medication. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the medication.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The medication was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/care-goals": {
      "get": {
        "operationId": "careGoals.list",
        "tags": [
          "Care Goals"
        ],
        "summary": "List care goals",
        "description": "Returns a page of care goals. Filters combine with AND. Use `next_cursor` to fetch the next page.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return goals of this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CareGoalList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "careGoals.create",
        "tags": [
          "Care Goals"
        ],
        "summary": "Create a care goal",
        "description": "Creates a care goal and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CareGoalCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new care goal.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CareGoal"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/care-goals/{id}": {
      "get": {
        "operationId": "careGoals.retrieve",
        "tags": [
          "Care Goals"
        ],
        "summary": "Retrieve a care goal",
        "description": "Returns one care goal by ID.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the care goal.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The care goal.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CareGoal"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "careGoals.update",
        "tags": [
          "Care Goals"
        ],
        "summary": "Update a care goal",
        "description": "Changes the fields you send and returns the updated care goal. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the care goal.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CareGoalUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated care goal.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CareGoal"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "careGoals.delete",
        "tags": [
          "Care Goals"
        ],
        "summary": "Delete a care goal",
        "description": "Deletes a care goal. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the care goal.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The care goal was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CareGoalDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/patient-notes": {
      "get": {
        "operationId": "patientNotes.list",
        "tags": [
          "Patient Notes"
        ],
        "summary": "List patient notes",
        "description": "Returns a page of patient notes. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return notes about this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientNoteList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "patientNotes.create",
        "tags": [
          "Patient Notes"
        ],
        "summary": "Create a patient note",
        "description": "Creates a patient note and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatientNoteCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new patient note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientNote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/patient-notes/{id}": {
      "get": {
        "operationId": "patientNotes.retrieve",
        "tags": [
          "Patient Notes"
        ],
        "summary": "Retrieve a patient note",
        "description": "Returns one patient note by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the patient note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The patient note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientNote"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "patientNotes.update",
        "tags": [
          "Patient Notes"
        ],
        "summary": "Update a patient note",
        "description": "Changes the fields you send and returns the updated patient note. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the patient note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatientNoteUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated patient note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientNote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "patientNotes.delete",
        "tags": [
          "Patient Notes"
        ],
        "summary": "Delete a patient note",
        "description": "Deletes a patient note. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the patient note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The patient note was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientNoteDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/medication-administrations": {
      "get": {
        "operationId": "medicationAdministrations.list",
        "tags": [
          "Medication Administrations"
        ],
        "summary": "List medication administrations",
        "description": "Returns a page of medication administrations. Filters combine with AND. Use `next_cursor` to fetch the next page.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return doses for this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "medication_id",
            "in": "query",
            "required": false,
            "description": "Only return doses of this medication.",
            "schema": {
              "type": "string"
            },
            "example": "0a9d7c3e-5b2f-4f18-a6e4-7c1b9d2e8f50"
          },
          {
            "name": "scheduled_date",
            "in": "query",
            "required": false,
            "description": "Only return doses due on this date.",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-10-05"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationAdministrationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/medication-administrations/{id}": {
      "get": {
        "operationId": "medicationAdministrations.retrieve",
        "tags": [
          "Medication Administrations"
        ],
        "summary": "Retrieve a medication administration",
        "description": "Returns one medication administration by ID.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the medication administration.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The medication administration.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicationAdministration"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/oasis-assessments": {
      "get": {
        "operationId": "oasisAssessments.list",
        "tags": [
          "OASIS Assessments"
        ],
        "summary": "List OASIS assessments",
        "description": "Returns a page of OASIS assessments. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return assessments of this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return assessments with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Draft",
                "Completed",
                "Exported",
                "Accepted",
                "Rejected",
                "Inactivated"
              ]
            },
            "example": "Completed"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OasisAssessmentList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/oasis-assessments/{id}": {
      "get": {
        "operationId": "oasisAssessments.retrieve",
        "tags": [
          "OASIS Assessments"
        ],
        "summary": "Retrieve an OASIS assessment",
        "description": "Returns one OASIS assessment by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the OASIS assessment.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The OASIS assessment.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OasisAssessment"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/caregivers": {
      "get": {
        "operationId": "caregivers.list",
        "tags": [
          "Caregivers"
        ],
        "summary": "List caregivers",
        "description": "Returns a page of caregivers. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return caregivers with this employment status.",
            "schema": {
              "type": "string",
              "enum": [
                "Active",
                "OnLeave",
                "Inactive"
              ]
            },
            "example": "Active"
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "Only return caregivers who can (`true`) or cannot (`false`) be scheduled.",
            "schema": {
              "type": "boolean"
            },
            "example": true
          },
          {
            "name": "office_id",
            "in": "query",
            "required": false,
            "description": "Only return caregivers from this office.",
            "schema": {
              "type": "string"
            },
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaregiverList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "caregivers.create",
        "tags": [
          "Caregivers"
        ],
        "summary": "Create a caregiver",
        "description": "Creates a caregiver and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaregiverCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new caregiver.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Caregiver"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/caregivers/{id}": {
      "get": {
        "operationId": "caregivers.retrieve",
        "tags": [
          "Caregivers"
        ],
        "summary": "Retrieve a caregiver",
        "description": "Returns one caregiver by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The caregiver.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Caregiver"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "caregivers.update",
        "tags": [
          "Caregivers"
        ],
        "summary": "Update a caregiver",
        "description": "Changes the fields you send and returns the updated caregiver. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaregiverUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated caregiver.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Caregiver"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "caregivers.delete",
        "tags": [
          "Caregivers"
        ],
        "summary": "Delete a caregiver",
        "description": "Deletes a caregiver. The caregiver's past visits and other related records are not deleted. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The caregiver was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaregiverDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/caregiver-notes": {
      "get": {
        "operationId": "caregiverNotes.list",
        "tags": [
          "Caregiver Notes"
        ],
        "summary": "List caregiver notes",
        "description": "Returns a page of caregiver notes. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return notes about this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaregiverNoteList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "caregiverNotes.create",
        "tags": [
          "Caregiver Notes"
        ],
        "summary": "Create a caregiver note",
        "description": "Creates a caregiver note and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaregiverNoteCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new caregiver note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaregiverNote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/caregiver-notes/{id}": {
      "get": {
        "operationId": "caregiverNotes.retrieve",
        "tags": [
          "Caregiver Notes"
        ],
        "summary": "Retrieve a caregiver note",
        "description": "Returns one caregiver note by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the caregiver note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The caregiver note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaregiverNote"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "caregiverNotes.update",
        "tags": [
          "Caregiver Notes"
        ],
        "summary": "Update a caregiver note",
        "description": "Changes the fields you send and returns the updated caregiver note. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the caregiver note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaregiverNoteUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated caregiver note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaregiverNote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "caregiverNotes.delete",
        "tags": [
          "Caregiver Notes"
        ],
        "summary": "Delete a caregiver note",
        "description": "Deletes a caregiver note. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the caregiver note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The caregiver note was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaregiverNoteDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/certifications": {
      "get": {
        "operationId": "certifications.list",
        "tags": [
          "Certifications"
        ],
        "summary": "List certifications",
        "description": "Returns a page of certifications. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return certifications of this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertificationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "certifications.create",
        "tags": [
          "Certifications"
        ],
        "summary": "Create a certification",
        "description": "Creates a certification and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CertificationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new certification.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Certification"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/certifications/{id}": {
      "get": {
        "operationId": "certifications.retrieve",
        "tags": [
          "Certifications"
        ],
        "summary": "Retrieve a certification",
        "description": "Returns one certification by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the certification.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The certification.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Certification"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "certifications.update",
        "tags": [
          "Certifications"
        ],
        "summary": "Update a certification",
        "description": "Changes the fields you send and returns the updated certification. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the certification.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CertificationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated certification.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Certification"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "certifications.delete",
        "tags": [
          "Certifications"
        ],
        "summary": "Delete a certification",
        "description": "Deletes a certification. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the certification.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The certification was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertificationDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/availability": {
      "get": {
        "operationId": "availability.list",
        "tags": [
          "Availability"
        ],
        "summary": "List availability windows",
        "description": "Returns a page of availability windows. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return windows of this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "availability.create",
        "tags": [
          "Availability"
        ],
        "summary": "Create an availability window",
        "description": "Creates an availability window and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvailabilityCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new availability window.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Availability"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/availability/{id}": {
      "get": {
        "operationId": "availability.retrieve",
        "tags": [
          "Availability"
        ],
        "summary": "Retrieve an availability window",
        "description": "Returns one availability window by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the availability window.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The availability window.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Availability"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "availability.update",
        "tags": [
          "Availability"
        ],
        "summary": "Update an availability window",
        "description": "Changes the fields you send and returns the updated availability window. Send `null` to clear an optional field. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the availability window.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvailabilityUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated availability window.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Availability"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "availability.delete",
        "tags": [
          "Availability"
        ],
        "summary": "Delete an availability window",
        "description": "Deletes an availability window. Available to keys belonging to office staff and caregivers. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the availability window.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The availability window was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/specializations": {
      "get": {
        "operationId": "specializations.list",
        "tags": [
          "Specializations"
        ],
        "summary": "List specializations",
        "description": "Returns a page of specializations. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return specializations of this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpecializationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "specializations.create",
        "tags": [
          "Specializations"
        ],
        "summary": "Create a specialization",
        "description": "Creates a specialization and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpecializationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new specialization.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Specialization"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/specializations/{id}": {
      "get": {
        "operationId": "specializations.retrieve",
        "tags": [
          "Specializations"
        ],
        "summary": "Retrieve a specialization",
        "description": "Returns one specialization by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the specialization.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The specialization.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Specialization"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "specializations.update",
        "tags": [
          "Specializations"
        ],
        "summary": "Update a specialization",
        "description": "Changes the fields you send and returns the updated specialization. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the specialization.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpecializationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated specialization.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Specialization"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "specializations.delete",
        "tags": [
          "Specializations"
        ],
        "summary": "Delete a specialization",
        "description": "Deletes a specialization. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the specialization.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The specialization was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpecializationDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/applicants": {
      "get": {
        "operationId": "applicants.list",
        "tags": [
          "Applicants"
        ],
        "summary": "List applicants",
        "description": "Returns a page of applicants. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "Only return applicants in this hiring stage.",
            "schema": {
              "type": "string"
            },
            "example": "Interview"
          },
          {
            "name": "office_id",
            "in": "query",
            "required": false,
            "description": "Only return applicants to this office.",
            "schema": {
              "type": "string"
            },
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicantList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "applicants.create",
        "tags": [
          "Applicants"
        ],
        "summary": "Create an applicant",
        "description": "Creates an applicant and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicantCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new applicant.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Applicant"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/applicants/{id}": {
      "get": {
        "operationId": "applicants.retrieve",
        "tags": [
          "Applicants"
        ],
        "summary": "Retrieve an applicant",
        "description": "Returns one applicant by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the applicant.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The applicant.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Applicant"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "applicants.update",
        "tags": [
          "Applicants"
        ],
        "summary": "Update an applicant",
        "description": "Changes the fields you send and returns the updated applicant. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the applicant.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicantUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated applicant.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Applicant"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "applicants.delete",
        "tags": [
          "Applicants"
        ],
        "summary": "Delete an applicant",
        "description": "Deletes an applicant. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the applicant.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The applicant was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicantDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/visits": {
      "get": {
        "operationId": "visits.list",
        "tags": [
          "Visits"
        ],
        "summary": "List visits",
        "description": "Returns a page of visits, ordered by scheduled start, earliest first. Filters combine with AND. Use `next_cursor` to fetch the next page.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "start_from",
            "in": "query",
            "required": true,
            "description": "Start of the window (inclusive), ISO 8601 with a time zone. Visits are listed by scheduled start. Both `start_from` and `start_to` are required, and the window can be at most 93 days.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "start_to",
            "in": "query",
            "required": true,
            "description": "End of the window (exclusive), ISO 8601 with a time zone. At most 93 days after `start_from`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return visits for this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return visits assigned to this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return visits with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Scheduled",
                "InProgress",
                "Cancelled",
                "Completed",
                "Late",
                "OverTime",
                "Incomplete"
              ]
            },
            "example": "Completed"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "visits.create",
        "tags": [
          "Visits"
        ],
        "summary": "Create a visit",
        "description": "Creates a visit and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new visit.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Visit"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/visits/{id}": {
      "get": {
        "operationId": "visits.retrieve",
        "tags": [
          "Visits"
        ],
        "summary": "Retrieve a visit",
        "description": "Returns one visit by ID.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the visit.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The visit.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Visit"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "visits.update",
        "tags": [
          "Visits"
        ],
        "summary": "Update a visit",
        "description": "Changes the fields you send and returns the updated visit. Send `null` to clear an optional field. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the visit.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated visit.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Visit"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "visits.delete",
        "tags": [
          "Visits"
        ],
        "summary": "Delete a visit",
        "description": "Deletes a visit. The visit moves to the schedule's recycle bin in AveeCare, where staff can restore it. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the visit.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The visit was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/visit-notes": {
      "get": {
        "operationId": "visitNotes.list",
        "tags": [
          "Visit Notes"
        ],
        "summary": "List visit notes",
        "description": "Returns a page of visit notes. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "visit_id",
            "in": "query",
            "required": false,
            "description": "Only return notes about this visit.",
            "schema": {
              "type": "string"
            },
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitNoteList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "visitNotes.create",
        "tags": [
          "Visit Notes"
        ],
        "summary": "Create a visit note",
        "description": "Creates a visit note and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitNoteCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new visit note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitNote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/visit-notes/{id}": {
      "get": {
        "operationId": "visitNotes.retrieve",
        "tags": [
          "Visit Notes"
        ],
        "summary": "Retrieve a visit note",
        "description": "Returns one visit note by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the visit note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The visit note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitNote"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "visitNotes.update",
        "tags": [
          "Visit Notes"
        ],
        "summary": "Update a visit note",
        "description": "Changes the fields you send and returns the updated visit note. Send `null` to clear an optional field. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the visit note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitNoteUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated visit note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitNote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "visitNotes.delete",
        "tags": [
          "Visit Notes"
        ],
        "summary": "Delete a visit note",
        "description": "Deletes a visit note. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the visit note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The visit note was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitNoteDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/visit-requests": {
      "get": {
        "operationId": "visitRequests.list",
        "tags": [
          "Visit Requests"
        ],
        "summary": "List visit requests",
        "description": "Returns a page of visit requests. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return requests from this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return requests with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Pending",
                "Approved",
                "Denied",
                "Cancelled"
              ]
            },
            "example": "Pending"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitRequestList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "visitRequests.create",
        "tags": [
          "Visit Requests"
        ],
        "summary": "Create a visit request",
        "description": "Creates a visit request and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitRequestCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new visit request.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitRequest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/visit-requests/{id}": {
      "get": {
        "operationId": "visitRequests.retrieve",
        "tags": [
          "Visit Requests"
        ],
        "summary": "Retrieve a visit request",
        "description": "Returns one visit request by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the visit request.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The visit request.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitRequest"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "visitRequests.update",
        "tags": [
          "Visit Requests"
        ],
        "summary": "Update a visit request",
        "description": "Changes the fields you send and returns the updated visit request. Send `null` to clear an optional field. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the visit request.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitRequestUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated visit request.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitRequest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "visitRequests.delete",
        "tags": [
          "Visit Requests"
        ],
        "summary": "Delete a visit request",
        "description": "Deletes a visit request. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the visit request.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The visit request was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitRequestDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/open-shifts": {
      "get": {
        "operationId": "openShifts.list",
        "tags": [
          "Open Shifts"
        ],
        "summary": "List open shifts",
        "description": "Returns a page of open shifts. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return offers with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Active",
                "Filled",
                "Cancelled"
              ]
            },
            "example": "Active"
          },
          {
            "name": "visit_id",
            "in": "query",
            "required": false,
            "description": "Only return offers for this visit.",
            "schema": {
              "type": "string"
            },
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenShiftList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "openShifts.create",
        "tags": [
          "Open Shifts"
        ],
        "summary": "Create an open shift",
        "description": "Creates an open shift and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenShiftCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new open shift.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenShift"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/open-shifts/{id}": {
      "get": {
        "operationId": "openShifts.retrieve",
        "tags": [
          "Open Shifts"
        ],
        "summary": "Retrieve an open shift",
        "description": "Returns one open shift by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the open shift.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The open shift.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenShift"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "openShifts.update",
        "tags": [
          "Open Shifts"
        ],
        "summary": "Update an open shift",
        "description": "Changes the fields you send and returns the updated open shift. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the open shift.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenShiftUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated open shift.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenShift"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "openShifts.delete",
        "tags": [
          "Open Shifts"
        ],
        "summary": "Delete an open shift",
        "description": "Deletes an open shift. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the open shift.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The open shift was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenShiftDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/shift-swaps": {
      "get": {
        "operationId": "shiftSwaps.list",
        "tags": [
          "Shift Swaps"
        ],
        "summary": "List shift swaps",
        "description": "Returns a page of shift swaps. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return swaps with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Pending",
                "Accepted",
                "Declined",
                "Cancelled",
                "AdminApproved",
                "AdminDenied"
              ]
            },
            "example": "Pending"
          },
          {
            "name": "visit_id",
            "in": "query",
            "required": false,
            "description": "Only return swaps for this visit.",
            "schema": {
              "type": "string"
            },
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "shiftSwaps.create",
        "tags": [
          "Shift Swaps"
        ],
        "summary": "Create a shift swap",
        "description": "Creates a shift swap and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShiftSwapCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new shift swap.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/shift-swaps/{id}": {
      "get": {
        "operationId": "shiftSwaps.retrieve",
        "tags": [
          "Shift Swaps"
        ],
        "summary": "Retrieve a shift swap",
        "description": "Returns one shift swap by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the shift swap.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The shift swap.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwap"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "shiftSwaps.update",
        "tags": [
          "Shift Swaps"
        ],
        "summary": "Update a shift swap",
        "description": "Changes the fields you send and returns the updated shift swap. Send `null` to clear an optional field. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the shift swap.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShiftSwapUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated shift swap.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "shiftSwaps.delete",
        "tags": [
          "Shift Swaps"
        ],
        "summary": "Delete a shift swap",
        "description": "Deletes a shift swap. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the shift swap.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The shift swap was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftSwapDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/care-plans": {
      "get": {
        "operationId": "carePlans.list",
        "tags": [
          "Care Plans"
        ],
        "summary": "List care plans",
        "description": "Returns a page of care plans. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return plans for this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return plans with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Active",
                "Draft",
                "Archived",
                "UnderReview",
                "Completed",
                "Discontinued"
              ]
            },
            "example": "Active"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarePlanList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "carePlans.create",
        "tags": [
          "Care Plans"
        ],
        "summary": "Create a care plan",
        "description": "Creates a care plan and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CarePlanCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new care plan.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarePlan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/care-plans/{id}": {
      "get": {
        "operationId": "carePlans.retrieve",
        "tags": [
          "Care Plans"
        ],
        "summary": "Retrieve a care plan",
        "description": "Returns one care plan by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the care plan.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The care plan.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarePlan"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "carePlans.update",
        "tags": [
          "Care Plans"
        ],
        "summary": "Update a care plan",
        "description": "Changes the fields you send and returns the updated care plan. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the care plan.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CarePlanUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated care plan.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarePlan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "carePlans.delete",
        "tags": [
          "Care Plans"
        ],
        "summary": "Delete a care plan",
        "description": "Deletes a care plan. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the care plan.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The care plan was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarePlanDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/progress-notes": {
      "get": {
        "operationId": "progressNotes.list",
        "tags": [
          "Progress Notes"
        ],
        "summary": "List progress notes",
        "description": "Returns a page of progress notes. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return notes for this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "visit_id",
            "in": "query",
            "required": false,
            "description": "Only return notes for this visit.",
            "schema": {
              "type": "string"
            },
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return notes by this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgressNoteList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "progressNotes.create",
        "tags": [
          "Progress Notes"
        ],
        "summary": "Create a progress note",
        "description": "Creates a progress note and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProgressNoteCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new progress note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgressNote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/progress-notes/{id}": {
      "get": {
        "operationId": "progressNotes.retrieve",
        "tags": [
          "Progress Notes"
        ],
        "summary": "Retrieve a progress note",
        "description": "Returns one progress note by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the progress note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The progress note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgressNote"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "progressNotes.update",
        "tags": [
          "Progress Notes"
        ],
        "summary": "Update a progress note",
        "description": "Changes the fields you send and returns the updated progress note. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the progress note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProgressNoteUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated progress note.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgressNote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "progressNotes.delete",
        "tags": [
          "Progress Notes"
        ],
        "summary": "Delete a progress note",
        "description": "Deletes a progress note. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the progress note.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The progress note was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProgressNoteDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/authorizations": {
      "get": {
        "operationId": "authorizations.list",
        "tags": [
          "Authorizations"
        ],
        "summary": "List authorizations",
        "description": "Returns a page of authorizations. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return authorizations for this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return authorizations with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Active",
                "Expired",
                "PendingRenewal"
              ]
            },
            "example": "Active"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "authorizations.create",
        "tags": [
          "Authorizations"
        ],
        "summary": "Create an authorization",
        "description": "Creates an authorization and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new authorization.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Authorization"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/authorizations/{id}": {
      "get": {
        "operationId": "authorizations.retrieve",
        "tags": [
          "Authorizations"
        ],
        "summary": "Retrieve an authorization",
        "description": "Returns one authorization by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the authorization.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The authorization.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Authorization"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "authorizations.update",
        "tags": [
          "Authorizations"
        ],
        "summary": "Update an authorization",
        "description": "Changes the fields you send and returns the updated authorization. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the authorization.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizationUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated authorization.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Authorization"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "authorizations.delete",
        "tags": [
          "Authorizations"
        ],
        "summary": "Delete an authorization",
        "description": "Deletes an authorization. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the authorization.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The authorization was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/incidents": {
      "get": {
        "operationId": "incidents.list",
        "tags": [
          "Incidents"
        ],
        "summary": "List incidents",
        "description": "Returns a page of incidents. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return incidents with this follow-up status.",
            "schema": {
              "type": "string",
              "enum": [
                "Open",
                "Monitoring",
                "AwaitingFollowUp",
                "Resolved",
                "Closed"
              ]
            },
            "example": "Open"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return incidents involving this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return incidents involving this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "resolved",
            "in": "query",
            "required": false,
            "description": "Only return resolved (`true`) or unresolved (`false`) incidents.",
            "schema": {
              "type": "boolean"
            },
            "example": false
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "incidents.create",
        "tags": [
          "Incidents"
        ],
        "summary": "Create an incident",
        "description": "Creates an incident and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new incident.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Incident"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/incidents/{id}": {
      "get": {
        "operationId": "incidents.retrieve",
        "tags": [
          "Incidents"
        ],
        "summary": "Retrieve an incident",
        "description": "Returns one incident by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the incident.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The incident.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Incident"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "incidents.update",
        "tags": [
          "Incidents"
        ],
        "summary": "Update an incident",
        "description": "Changes the fields you send and returns the updated incident. Send `null` to clear an optional field. Available to keys belonging to office staff and caregivers. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the incident.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated incident.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Incident"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "incidents.delete",
        "tags": [
          "Incidents"
        ],
        "summary": "Delete an incident",
        "description": "Deletes an incident. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the incident.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The incident was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "events.list",
        "tags": [
          "Events"
        ],
        "summary": "List events",
        "description": "Returns a page of events. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return events with this follow-up status.",
            "schema": {
              "type": "string",
              "enum": [
                "Open",
                "Monitoring",
                "AwaitingFollowUp",
                "Resolved",
                "Closed"
              ]
            },
            "example": "Open"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return events involving this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return events involving this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "events.create",
        "tags": [
          "Events"
        ],
        "summary": "Create an event",
        "description": "Creates an event and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new event.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/events/{id}": {
      "get": {
        "operationId": "events.retrieve",
        "tags": [
          "Events"
        ],
        "summary": "Retrieve an event",
        "description": "Returns one event by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the event.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The event.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "events.update",
        "tags": [
          "Events"
        ],
        "summary": "Update an event",
        "description": "Changes the fields you send and returns the updated event. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the event.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated event.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "events.delete",
        "tags": [
          "Events"
        ],
        "summary": "Delete an event",
        "description": "Deletes an event. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the event.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The event was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/referral-sources": {
      "get": {
        "operationId": "referralSources.list",
        "tags": [
          "Referral Sources"
        ],
        "summary": "List referral sources",
        "description": "Returns a page of referral sources. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "description": "Only return active (`true`) or inactive (`false`) sources.",
            "schema": {
              "type": "boolean"
            },
            "example": true
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralSourceList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "referralSources.create",
        "tags": [
          "Referral Sources"
        ],
        "summary": "Create a referral source",
        "description": "Creates a referral source and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralSourceCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new referral source.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralSource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/referral-sources/{id}": {
      "get": {
        "operationId": "referralSources.retrieve",
        "tags": [
          "Referral Sources"
        ],
        "summary": "Retrieve a referral source",
        "description": "Returns one referral source by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the referral source.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The referral source.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralSource"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "referralSources.update",
        "tags": [
          "Referral Sources"
        ],
        "summary": "Update a referral source",
        "description": "Changes the fields you send and returns the updated referral source. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the referral source.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralSourceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated referral source.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralSource"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "referralSources.delete",
        "tags": [
          "Referral Sources"
        ],
        "summary": "Delete a referral source",
        "description": "Deletes a referral source. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the referral source.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The referral source was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralSourceDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/referrals": {
      "get": {
        "operationId": "referrals.list",
        "tags": [
          "Referrals"
        ],
        "summary": "List referrals",
        "description": "Returns a page of referrals. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return referrals with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "New",
                "Contacted",
                "AssessmentScheduled",
                "AssessmentCompleted",
                "ServiceAgreementSent",
                "Admitted",
                "Declined",
                "Lost"
              ]
            },
            "example": "New"
          },
          {
            "name": "referral_source_id",
            "in": "query",
            "required": false,
            "description": "Only return referrals from this source.",
            "schema": {
              "type": "string"
            },
            "example": "9c3a1e7d-4b2f-4d86-a0c5-1e8f6b3d2a97"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "referrals.create",
        "tags": [
          "Referrals"
        ],
        "summary": "Create a referral",
        "description": "Creates a referral and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new referral.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Referral"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/referrals/{id}": {
      "get": {
        "operationId": "referrals.retrieve",
        "tags": [
          "Referrals"
        ],
        "summary": "Retrieve a referral",
        "description": "Returns one referral by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the referral.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The referral.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Referral"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "referrals.update",
        "tags": [
          "Referrals"
        ],
        "summary": "Update a referral",
        "description": "Changes the fields you send and returns the updated referral. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the referral.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated referral.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Referral"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "referrals.delete",
        "tags": [
          "Referrals"
        ],
        "summary": "Delete a referral",
        "description": "Deletes a referral. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the referral.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The referral was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/invoices": {
      "get": {
        "operationId": "invoices.list",
        "tags": [
          "Invoices"
        ],
        "summary": "List invoices",
        "description": "Returns a page of invoices. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return invoices for this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return invoices with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Draft",
                "Pending",
                "Processing",
                "Paid",
                "PartiallyPaid",
                "Overdue",
                "Cancelled",
                "Refunded",
                "Failed"
              ]
            },
            "example": "Overdue"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/invoices/{id}": {
      "get": {
        "operationId": "invoices.retrieve",
        "tags": [
          "Invoices"
        ],
        "summary": "Retrieve an invoice",
        "description": "Returns one invoice by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the invoice.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The invoice.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/invoice-line-items": {
      "get": {
        "operationId": "invoiceLineItems.list",
        "tags": [
          "Invoice Line Items"
        ],
        "summary": "List invoice line items",
        "description": "Returns a page of invoice line items. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "invoice_id",
            "in": "query",
            "required": false,
            "description": "Only return lines of this invoice.",
            "schema": {
              "type": "string"
            },
            "example": "7d2f9b4c-1e6a-4c83-9f05-b8a3e2d1c6f7"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItemList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/invoice-line-items/{id}": {
      "get": {
        "operationId": "invoiceLineItems.retrieve",
        "tags": [
          "Invoice Line Items"
        ],
        "summary": "Retrieve an invoice line item",
        "description": "Returns one invoice line item by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the invoice line item.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The invoice line item.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceLineItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/claims": {
      "get": {
        "operationId": "claims.list",
        "tags": [
          "Claims"
        ],
        "summary": "List claims",
        "description": "Returns a page of claims. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "patient_id",
            "in": "query",
            "required": false,
            "description": "Only return claims for this patient.",
            "schema": {
              "type": "string"
            },
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return claims with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Draft",
                "Validated",
                "ValidationFailed",
                "Submitted",
                "Acknowledged",
                "Accepted",
                "Rejected",
                "InAdjudication",
                "Paid",
                "PartiallyPaid",
                "Denied",
                "Appealed",
                "Voided"
              ]
            },
            "example": "Denied"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/claims/{id}": {
      "get": {
        "operationId": "claims.retrieve",
        "tags": [
          "Claims"
        ],
        "summary": "Retrieve a claim",
        "description": "Returns one claim by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the claim.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The claim.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Claim"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/payroll-entries": {
      "get": {
        "operationId": "payrollEntries.list",
        "tags": [
          "Payroll Entries"
        ],
        "summary": "List payroll entries",
        "description": "Returns a page of payroll entries. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "caregiver_id",
            "in": "query",
            "required": false,
            "description": "Only return entries for this caregiver.",
            "schema": {
              "type": "string"
            },
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return entries with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "Pending",
                "Approved",
                "Processed",
                "Paid",
                "Cancelled",
                "Failed",
                "HoursSubmitted",
                "CheckCreated",
                "PaidConfirmed",
                "PaidExternally",
                "Voided"
              ]
            },
            "example": "Approved"
          },
          {
            "name": "pay_period_start",
            "in": "query",
            "required": false,
            "description": "Only return entries for the pay period starting on this date.",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-09-16"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayrollEntryList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/payroll-entries/{id}": {
      "get": {
        "operationId": "payrollEntries.retrieve",
        "tags": [
          "Payroll Entries"
        ],
        "summary": "Retrieve a payroll entry",
        "description": "Returns one payroll entry by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the payroll entry.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The payroll entry.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayrollEntry"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/conversations": {
      "get": {
        "operationId": "conversations.list",
        "tags": [
          "Conversations"
        ],
        "summary": "List conversations",
        "description": "Returns a page of conversations. Filters combine with AND. Use `next_cursor` to fetch the next page.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/conversations/{id}": {
      "get": {
        "operationId": "conversations.retrieve",
        "tags": [
          "Conversations"
        ],
        "summary": "Retrieve a conversation",
        "description": "Returns one conversation by ID.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the conversation.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The conversation.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/messages": {
      "get": {
        "operationId": "messages.list",
        "tags": [
          "Messages"
        ],
        "summary": "List messages",
        "description": "Returns a page of messages. Filters combine with AND. Use `next_cursor` to fetch the next page.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "conversation_id",
            "in": "query",
            "required": true,
            "description": "The conversation to list messages from.",
            "schema": {
              "type": "string"
            },
            "example": "e3c7a1f9-6d2b-4a58-8e14-0b9f5c2d7a36"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "messages.create",
        "tags": [
          "Messages"
        ],
        "summary": "Create a message",
        "description": "Creates a message and returns it. Send an `Idempotency-Key` header to make the request safe to retry. With a caregiver's or patient's key, a saved record that key cannot read back is answered with only `object` and `id`. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new message.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/messages/{id}": {
      "get": {
        "operationId": "messages.retrieve",
        "tags": [
          "Messages"
        ],
        "summary": "Retrieve a message",
        "description": "Returns one message by ID.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the message.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The message.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/alerts": {
      "get": {
        "operationId": "alerts.list",
        "tags": [
          "Alerts"
        ],
        "summary": "List alerts",
        "description": "Returns a page of alerts. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only return alerts of this type.",
            "schema": {
              "type": "string",
              "enum": [
                "Critical",
                "Important",
                "Notice"
              ]
            },
            "example": "Critical"
          },
          {
            "name": "audience",
            "in": "query",
            "required": false,
            "description": "Only return alerts for this audience.",
            "schema": {
              "type": "string",
              "enum": [
                "CompanyWide",
                "StaffOnly",
                "CaregiversAll",
                "PatientsAll",
                "Caregiver",
                "Patient",
                "Visit",
                "PatientCareTeam"
              ]
            },
            "example": "CompanyWide"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "alerts.create",
        "tags": [
          "Alerts"
        ],
        "summary": "Create an alert",
        "description": "Creates an alert and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new alert.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/alerts/{id}": {
      "get": {
        "operationId": "alerts.retrieve",
        "tags": [
          "Alerts"
        ],
        "summary": "Retrieve an alert",
        "description": "Returns one alert by ID. Available to keys belonging to office staff and caregivers.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the alert.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The alert.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "alerts.update",
        "tags": [
          "Alerts"
        ],
        "summary": "Update an alert",
        "description": "Changes the fields you send and returns the updated alert. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the alert.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated alert.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "alerts.delete",
        "tags": [
          "Alerts"
        ],
        "summary": "Delete an alert",
        "description": "Deletes an alert. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the alert.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The alert was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/offices": {
      "get": {
        "operationId": "offices.list",
        "tags": [
          "Offices"
        ],
        "summary": "List offices",
        "description": "Returns a page of offices. Filters combine with AND. Use `next_cursor` to fetch the next page. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Only return objects created after this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Only return objects created before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          },
          {
            "name": "updated_after",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed after this time (exclusive). ISO 8601 with a time zone. Use it for incremental sync: pass the newest `updatedAt` you already have.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "updated_before",
            "in": "query",
            "required": false,
            "description": "Only return objects last changed before this time (exclusive). ISO 8601 with a time zone.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-08T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfficeList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "post": {
        "operationId": "offices.create",
        "tags": [
          "Offices"
        ],
        "summary": "Create an office",
        "description": "Creates an office and returns it. Send an `Idempotency-Key` header to make the request safe to retry. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfficeCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new office.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Office"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/offices/{id}": {
      "get": {
        "operationId": "offices.retrieve",
        "tags": [
          "Offices"
        ],
        "summary": "Retrieve an office",
        "description": "Returns one office by ID. Available to keys belonging to office staff.",
        "x-aveecare-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the office.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The office.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Office"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "patch": {
        "operationId": "offices.update",
        "tags": [
          "Offices"
        ],
        "summary": "Update an office",
        "description": "Changes the fields you send and returns the updated office. Send `null` to clear an optional field. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the office.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfficeUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated office.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Office"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      },
      "delete": {
        "operationId": "offices.delete",
        "tags": [
          "Offices"
        ],
        "summary": "Delete an office",
        "description": "Deletes an office. The default office, and an agency's only office, cannot be deleted. Available to keys belonging to office staff. Requires a key with `write` scope.",
        "x-aveecare-scope": "write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the office.",
            "schema": {
              "type": "string"
            },
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          }
        ],
        "responses": {
          "200": {
            "description": "The office was deleted.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfficeDeleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "me.retrieve",
        "tags": [
          "Me"
        ],
        "summary": "Retrieve the current API key",
        "description": "Returns the API key making the request, its scopes, the role of the user it belongs to, and its agency. Useful to check a key works.",
        "x-aveecare-scope": "read",
        "responses": {
          "200": {
            "description": "The API key.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ak_<keyId>_<secret>",
        "description": "Send `Authorization: Bearer ak_<keyId>_<secret>`. Create keys in AveeCare under Settings → API Keys."
      }
    },
    "parameters": {
      "Limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Number of objects to return, from 1 to 100.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 25
        },
        "example": 25
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "description": "The `next_cursor` from the previous page. Send the same filters with it.",
        "schema": {
          "type": "string"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "A unique value (a UUID works well) that makes this request safe to retry for 24 hours. A retry with the same key and body returns the first result; the same key with a different body is refused with `idempotency_conflict`.",
        "schema": {
          "type": "string",
          "maxLength": 255
        },
        "example": "5f0c8a2e-7d4b-4e19-9a63-1b2c3d4e5f60"
      }
    },
    "headers": {
      "RequestId": {
        "description": "Unique ID of this request. Quote it when contacting support.",
        "schema": {
          "type": "string"
        },
        "example": "req_3f9a1c7e5b2d4a6c8e0f1a2b"
      },
      "RateLimitLimit": {
        "description": "Requests allowed in the current window.",
        "schema": {
          "type": "integer"
        },
        "example": 60
      },
      "RateLimitRemaining": {
        "description": "Requests left in the current window.",
        "schema": {
          "type": "integer"
        },
        "example": 59
      },
      "RateLimitReset": {
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer"
        },
        "example": 42
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer"
        },
        "example": 30
      },
      "IdempotentReplayed": {
        "description": "Present and `true` when this response is the stored result of an earlier request with the same `Idempotency-Key`.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      }
    },
    "responses": {
      "E400": {
        "description": "The request was malformed, a value was invalid, or it contained an unknown field (`invalid_request`, `unknown_field`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E401": {
        "description": "The API key is missing, malformed, expired or revoked (`unauthorized`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E403": {
        "description": "The key is read-only (`insufficient_scope`), or its user's role cannot do this (`forbidden`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E404": {
        "description": "No such object, or it is not visible to this key (`not_found`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E409": {
        "description": "The `Idempotency-Key` was already used with a different request, or that request is still running (`idempotency_conflict`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E429": {
        "description": "Too many requests (`rate_limited`). Wait for `Retry-After` seconds.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E500": {
        "description": "Something went wrong on our side (`internal_error`). Retry, and quote the request ID if it persists.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Patient": {
        "type": "object",
        "description": "Patients are the clients your agency provides care to, including prospective clients you have not yet admitted. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "firstName",
          "middleName",
          "lastName",
          "goesByName",
          "dateOfBirth",
          "gender",
          "primaryLanguage",
          "email",
          "active",
          "status",
          "lifecycleStage",
          "serviceType",
          "address",
          "city",
          "state",
          "zipCode",
          "officeId",
          "referralSourceId",
          "primaryDiagnosisDescription",
          "fallRisk",
          "preferredCaregiverGender",
          "schedulingNotes",
          "responsiblePartyName",
          "medicaidId",
          "medicareId",
          "insuranceProvider",
          "insuranceId",
          "insuranceGroupNumber",
          "billingContactName",
          "billingContactEmail",
          "billingContactPhone",
          "statementDelivery",
          "paymentMethodPreference",
          "outstandingBalanceCents",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "patient"
            ],
            "description": "String representing the object's type. Always `patient`.",
            "example": "patient",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the patient.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "firstName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Given name.",
            "example": "Eleanor"
          },
          "middleName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Middle name.",
            "example": "Ann"
          },
          "lastName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Family name.",
            "example": "Vance"
          },
          "goesByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The name the patient prefers to be called.",
            "example": "Peggy"
          },
          "dateOfBirth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of birth.",
            "example": "1941-03-14"
          },
          "gender": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Gender as recorded by the agency.",
            "example": "Female"
          },
          "primaryLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Language the patient is most comfortable speaking.",
            "example": "Spanish"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Contact email address.",
            "example": "eleanor.vance@example.com"
          },
          "active": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient is an active client. Only active clients are scheduled and billed. A prospective client is always inactive. If you leave it out on create, it is `false` for a prospect or an `Inactive` or `Discharged` status and `true` otherwise.",
            "example": true
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's status as shown in AveeCare. `Inactive` and `Discharged` mean the person is no longer receiving care. A prospective client (`lifecycleStage: Prospect`) reads `Prospect` even if you send `Active`. Creating a patient with `Prospect` makes them a prospective client. Defaults to `Active`. Usually one of `Active`, `Inactive`, `Prospect`, `Discharged`; records imported from another system can hold other values.",
            "example": "Active"
          },
          "lifecycleStage": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Prospect",
              "Client",
              null
            ],
            "description": "Whether this person is a prospective client or an admitted client. `null` means client. Prospects appear in the prospective-patient pool in AveeCare, not on the patient roster.",
            "example": "Client"
          },
          "serviceType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "SkilledNursing",
              "PhysicalTherapy",
              "Hospice",
              "StandardCare",
              null
            ],
            "description": "The main type of service the patient receives.",
            "example": "StandardCare"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Street address where care is delivered.",
            "example": "1458 Mesquite Lane"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City of the service address.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State of the service address, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code of the service address.",
            "example": "85016"
          },
          "officeId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The office (branch) that serves this patient.",
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          "referralSourceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The referral source that sent this patient to you.",
            "example": "9c3a1e7d-4b2f-4d86-a0c5-1e8f6b3d2a97"
          },
          "primaryDiagnosisDescription": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Primary diagnosis, in plain words.",
            "example": "Type 2 diabetes with neuropathy"
          },
          "fallRisk": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient is a fall risk.",
            "example": true
          },
          "preferredCaregiverGender": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Caregiver gender the patient prefers, if any.",
            "example": "Female"
          },
          "schedulingNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes schedulers see when booking visits for this patient.",
            "example": "Prefers morning visits before 11am."
          },
          "responsiblePartyName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Person legally responsible for the patient, if not the patient.",
            "example": "Susan Vance-Mitchell"
          },
          "medicaidId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Medicaid member ID.",
            "example": "A12345678"
          },
          "medicareId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Medicare beneficiary identifier.",
            "example": "1EG4-TE5-MK73"
          },
          "insuranceProvider": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Primary insurance company name.",
            "example": "Mercy Care"
          },
          "insuranceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Member ID with the primary insurance.",
            "example": "MC00981234"
          },
          "insuranceGroupNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Group number with the primary insurance.",
            "example": "GRP-4410"
          },
          "billingContactName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Who receives the bills.",
            "example": "Susan Vance-Mitchell"
          },
          "billingContactEmail": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address bills are sent to.",
            "example": "susan.mitchell@example.com"
          },
          "billingContactPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number of the billing contact.",
            "example": "+16025550142"
          },
          "statementDelivery": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Email",
              "Mail",
              "EmailAndMail",
              "NoStatement",
              null
            ],
            "description": "How statements are delivered.",
            "example": "Email"
          },
          "paymentMethodPreference": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ACH",
              "Card",
              "Check",
              "Cash",
              "PayerOnly",
              "Other",
              null
            ],
            "description": "How the patient usually pays.",
            "example": "Card"
          },
          "outstandingBalanceCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Balance the patient currently owes. In cents.",
            "example": 12500,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the patient was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the patient was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "PatientList": {
        "type": "object",
        "description": "A page of patients.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Patient"
            },
            "description": "The patients on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "PatientCreate": {
        "type": "object",
        "description": "Fields for a new patient. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "description": "Given name.",
            "example": "Eleanor"
          },
          "middleName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Middle name.",
            "example": "Ann"
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "description": "Family name.",
            "example": "Vance"
          },
          "goesByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The name the patient prefers to be called.",
            "example": "Peggy"
          },
          "dateOfBirth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of birth.",
            "example": "1941-03-14"
          },
          "gender": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Gender as recorded by the agency.",
            "example": "Female"
          },
          "primaryLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Language the patient is most comfortable speaking.",
            "example": "Spanish"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Contact email address.",
            "example": "eleanor.vance@example.com"
          },
          "active": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient is an active client. Only active clients are scheduled and billed. A prospective client is always inactive. If you leave it out on create, it is `false` for a prospect or an `Inactive` or `Discharged` status and `true` otherwise.",
            "example": true
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Inactive",
              "Prospect",
              "Discharged",
              null
            ],
            "description": "The client's status as shown in AveeCare. `Inactive` and `Discharged` mean the person is no longer receiving care. A prospective client (`lifecycleStage: Prospect`) reads `Prospect` even if you send `Active`. Creating a patient with `Prospect` makes them a prospective client. Defaults to `Active`.",
            "example": "Active"
          },
          "lifecycleStage": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Prospect",
              "Client",
              null
            ],
            "description": "Whether this person is a prospective client or an admitted client. `null` means client. Prospects appear in the prospective-patient pool in AveeCare, not on the patient roster.",
            "example": "Client"
          },
          "serviceType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "SkilledNursing",
              "PhysicalTherapy",
              "Hospice",
              "StandardCare",
              null
            ],
            "description": "The main type of service the patient receives.",
            "example": "StandardCare"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Street address where care is delivered.",
            "example": "1458 Mesquite Lane"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City of the service address.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State of the service address, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code of the service address.",
            "example": "85016"
          },
          "officeId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The office (branch) that serves this patient.",
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          "referralSourceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The referral source that sent this patient to you.",
            "example": "9c3a1e7d-4b2f-4d86-a0c5-1e8f6b3d2a97"
          },
          "primaryDiagnosisDescription": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Primary diagnosis, in plain words.",
            "example": "Type 2 diabetes with neuropathy"
          },
          "fallRisk": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient is a fall risk.",
            "example": true
          },
          "preferredCaregiverGender": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Caregiver gender the patient prefers, if any.",
            "example": "Female"
          },
          "schedulingNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes schedulers see when booking visits for this patient.",
            "example": "Prefers morning visits before 11am."
          },
          "responsiblePartyName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Person legally responsible for the patient, if not the patient.",
            "example": "Susan Vance-Mitchell"
          },
          "medicaidId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Medicaid member ID.",
            "example": "A12345678"
          },
          "medicareId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Medicare beneficiary identifier.",
            "example": "1EG4-TE5-MK73"
          },
          "insuranceProvider": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Primary insurance company name.",
            "example": "Mercy Care"
          },
          "insuranceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Member ID with the primary insurance.",
            "example": "MC00981234"
          },
          "insuranceGroupNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Group number with the primary insurance.",
            "example": "GRP-4410"
          },
          "billingContactName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Who receives the bills.",
            "example": "Susan Vance-Mitchell"
          },
          "billingContactEmail": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address bills are sent to.",
            "example": "susan.mitchell@example.com"
          },
          "billingContactPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number of the billing contact.",
            "example": "+16025550142"
          },
          "statementDelivery": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Email",
              "Mail",
              "EmailAndMail",
              "NoStatement",
              null
            ],
            "description": "How statements are delivered.",
            "example": "Email"
          },
          "paymentMethodPreference": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ACH",
              "Card",
              "Check",
              "Cash",
              "PayerOnly",
              "Other",
              null
            ],
            "description": "How the patient usually pays.",
            "example": "Card"
          }
        },
        "required": [
          "firstName",
          "lastName"
        ]
      },
      "PatientUpdate": {
        "type": "object",
        "description": "Fields to change on a patient. Send only the fields to change; any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "description": "Given name.",
            "example": "Eleanor"
          },
          "middleName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Middle name.",
            "example": "Ann"
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "description": "Family name.",
            "example": "Vance"
          },
          "goesByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The name the patient prefers to be called.",
            "example": "Peggy"
          },
          "dateOfBirth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of birth.",
            "example": "1941-03-14"
          },
          "gender": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Gender as recorded by the agency.",
            "example": "Female"
          },
          "primaryLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Language the patient is most comfortable speaking.",
            "example": "Spanish"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Contact email address.",
            "example": "eleanor.vance@example.com"
          },
          "active": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient is an active client. Only active clients are scheduled and billed. A prospective client is always inactive. If you leave it out on create, it is `false` for a prospect or an `Inactive` or `Discharged` status and `true` otherwise.",
            "example": true
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Inactive",
              "Prospect",
              "Discharged",
              null
            ],
            "description": "The client's status as shown in AveeCare. `Inactive` and `Discharged` mean the person is no longer receiving care. A prospective client (`lifecycleStage: Prospect`) reads `Prospect` even if you send `Active`. Creating a patient with `Prospect` makes them a prospective client. Defaults to `Active`.",
            "example": "Active"
          },
          "lifecycleStage": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Prospect",
              "Client",
              null
            ],
            "description": "Whether this person is a prospective client or an admitted client. `null` means client. Prospects appear in the prospective-patient pool in AveeCare, not on the patient roster.",
            "example": "Client"
          },
          "serviceType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "SkilledNursing",
              "PhysicalTherapy",
              "Hospice",
              "StandardCare",
              null
            ],
            "description": "The main type of service the patient receives.",
            "example": "StandardCare"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Street address where care is delivered.",
            "example": "1458 Mesquite Lane"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City of the service address.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State of the service address, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code of the service address.",
            "example": "85016"
          },
          "officeId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The office (branch) that serves this patient.",
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          "referralSourceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The referral source that sent this patient to you.",
            "example": "9c3a1e7d-4b2f-4d86-a0c5-1e8f6b3d2a97"
          },
          "primaryDiagnosisDescription": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Primary diagnosis, in plain words.",
            "example": "Type 2 diabetes with neuropathy"
          },
          "fallRisk": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient is a fall risk.",
            "example": true
          },
          "preferredCaregiverGender": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Caregiver gender the patient prefers, if any.",
            "example": "Female"
          },
          "schedulingNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes schedulers see when booking visits for this patient.",
            "example": "Prefers morning visits before 11am."
          },
          "responsiblePartyName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Person legally responsible for the patient, if not the patient.",
            "example": "Susan Vance-Mitchell"
          },
          "medicaidId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Medicaid member ID.",
            "example": "A12345678"
          },
          "medicareId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Medicare beneficiary identifier.",
            "example": "1EG4-TE5-MK73"
          },
          "insuranceProvider": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Primary insurance company name.",
            "example": "Mercy Care"
          },
          "insuranceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Member ID with the primary insurance.",
            "example": "MC00981234"
          },
          "insuranceGroupNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Group number with the primary insurance.",
            "example": "GRP-4410"
          },
          "billingContactName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Who receives the bills.",
            "example": "Susan Vance-Mitchell"
          },
          "billingContactEmail": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address bills are sent to.",
            "example": "susan.mitchell@example.com"
          },
          "billingContactPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number of the billing contact.",
            "example": "+16025550142"
          },
          "statementDelivery": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Email",
              "Mail",
              "EmailAndMail",
              "NoStatement",
              null
            ],
            "description": "How statements are delivered.",
            "example": "Email"
          },
          "paymentMethodPreference": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ACH",
              "Card",
              "Check",
              "Cash",
              "PayerOnly",
              "Other",
              null
            ],
            "description": "How the patient usually pays.",
            "example": "Card"
          }
        },
        "minProperties": 1
      },
      "PatientDeleted": {
        "type": "object",
        "description": "Confirmation that a patient was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "patient"
            ],
            "description": "Always `patient`.",
            "example": "patient"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted patient.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Contact": {
        "type": "object",
        "description": "Contacts are family members and other people connected to a patient, such as an emergency contact. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "name",
          "relationship",
          "phoneNumber",
          "email",
          "preferEmail",
          "emergencyContact",
          "notificationPolicy",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "contact"
            ],
            "description": "String representing the object's type. Always `contact`.",
            "example": "contact",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the contact.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient this contact belongs to.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Full name.",
            "example": "Susan Vance-Mitchell"
          },
          "relationship": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Relationship to the patient.",
            "example": "Son"
          },
          "phoneNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number.",
            "example": "+16025550142"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address.",
            "example": "susan.mitchell@example.com"
          },
          "preferEmail": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the contact prefers email over phone.",
            "example": false
          },
          "emergencyContact": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this person is an emergency contact.",
            "example": true
          },
          "notificationPolicy": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "All",
              "Emergencies",
              null
            ],
            "description": "Which updates the contact is notified about.",
            "example": "Emergencies"
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the contact was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the contact was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "ContactList": {
        "type": "object",
        "description": "A page of contacts.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            },
            "description": "The contacts on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "ContactCreate": {
        "type": "object",
        "description": "Fields for a new contact. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "patientId": {
            "type": "string",
            "maxLength": 64,
            "description": "The patient this contact belongs to.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Full name.",
            "example": "Susan Vance-Mitchell"
          },
          "relationship": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Relationship to the patient.",
            "example": "Son"
          },
          "phoneNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number.",
            "example": "+16025550142"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address.",
            "example": "susan.mitchell@example.com"
          },
          "preferEmail": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the contact prefers email over phone.",
            "example": false
          },
          "emergencyContact": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this person is an emergency contact.",
            "example": true
          },
          "notificationPolicy": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "All",
              "Emergencies",
              null
            ],
            "description": "Which updates the contact is notified about.",
            "example": "Emergencies"
          }
        },
        "required": [
          "patientId",
          "name"
        ]
      },
      "ContactUpdate": {
        "type": "object",
        "description": "Fields to change on a contact. Send only the fields to change; any other field is refused with `unknown_field`. `patientId` is set when the contact is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Full name.",
            "example": "Susan Vance-Mitchell"
          },
          "relationship": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Relationship to the patient.",
            "example": "Son"
          },
          "phoneNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number.",
            "example": "+16025550142"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address.",
            "example": "susan.mitchell@example.com"
          },
          "preferEmail": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the contact prefers email over phone.",
            "example": false
          },
          "emergencyContact": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this person is an emergency contact.",
            "example": true
          },
          "notificationPolicy": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "All",
              "Emergencies",
              null
            ],
            "description": "Which updates the contact is notified about.",
            "example": "Emergencies"
          }
        },
        "minProperties": 1
      },
      "ContactDeleted": {
        "type": "object",
        "description": "Confirmation that a contact was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "contact"
            ],
            "description": "Always `contact`.",
            "example": "contact"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted contact.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Allergy": {
        "type": "object",
        "description": "Allergies recorded on a patient's profile. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "name",
          "description",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "allergy"
            ],
            "description": "String representing the object's type. Always `allergy`.",
            "example": "allergy",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the allergy.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient who has this allergy.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "What the patient is allergic to.",
            "example": "Penicillin"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Reaction and other details.",
            "example": "Hives and swelling within an hour."
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the allergy was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the allergy was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "AllergyList": {
        "type": "object",
        "description": "A page of allergies.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Allergy"
            },
            "description": "The allergies on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "AllergyCreate": {
        "type": "object",
        "description": "Fields for a new allergy. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "patientId": {
            "type": "string",
            "maxLength": 64,
            "description": "The patient who has this allergy.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "What the patient is allergic to.",
            "example": "Penicillin"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Reaction and other details.",
            "example": "Hives and swelling within an hour."
          }
        },
        "required": [
          "patientId",
          "name"
        ]
      },
      "AllergyUpdate": {
        "type": "object",
        "description": "Fields to change on an allergy. Send only the fields to change; any other field is refused with `unknown_field`. `patientId` is set when the allergy is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "What the patient is allergic to.",
            "example": "Penicillin"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Reaction and other details.",
            "example": "Hives and swelling within an hour."
          }
        },
        "minProperties": 1
      },
      "AllergyDeleted": {
        "type": "object",
        "description": "Confirmation that an allergy was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "allergy"
            ],
            "description": "Always `allergy`.",
            "example": "allergy"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted allergy.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Medication": {
        "type": "object",
        "description": "Medications on a patient's medication list, with the schedule caregivers follow when they give or assist with them. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "name",
          "strength",
          "form",
          "route",
          "directions",
          "indication",
          "scheduleType",
          "prnReason",
          "prnMaxDailyDoses",
          "prnMinIntervalHours",
          "startDate",
          "status",
          "discontinuedDate",
          "discontinuedReason",
          "prescriber",
          "prescriberPhone",
          "pharmacy",
          "pharmacyPhone",
          "requiresWitness",
          "quantityOnHand",
          "refillsRemaining",
          "notes",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "medication"
            ],
            "description": "String representing the object's type. Always `medication`.",
            "example": "medication",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the medication.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient who takes this medication.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Drug name, without the strength.",
            "example": "Metformin"
          },
          "strength": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Strength per dose unit.",
            "example": "500 mg"
          },
          "form": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Dose form.",
            "example": "Tablet"
          },
          "route": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "How it is taken.",
            "example": "By mouth"
          },
          "directions": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Directions as written on the prescription.",
            "example": "Take 1 tablet twice daily with meals."
          },
          "indication": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "What the medication is for.",
            "example": "Diabetes"
          },
          "scheduleType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Scheduled",
              "PRN",
              null
            ],
            "description": "`Scheduled` for regular doses, `PRN` for as-needed.",
            "example": "Scheduled"
          },
          "prnReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "For as-needed medications, when to give it.",
            "example": "Pain above 5 out of 10"
          },
          "prnMaxDailyDoses": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "For as-needed medications, the most doses allowed in a day.",
            "example": 4
          },
          "prnMinIntervalHours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "For as-needed medications, the minimum hours between doses.",
            "example": 6
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the patient started the medication.",
            "example": "2026-01-15"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "OnHold",
              "Discontinued",
              null
            ],
            "description": "Whether the medication is currently given.",
            "example": "Active"
          },
          "discontinuedDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the medication was stopped.",
            "example": null
          },
          "discontinuedReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Why the medication was stopped.",
            "example": null
          },
          "prescriber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Prescribing clinician.",
            "example": "Dr. Lena Ortiz"
          },
          "prescriberPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Prescriber's phone number.",
            "example": "+16025550199"
          },
          "pharmacy": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Pharmacy that fills the prescription.",
            "example": "Camelback Pharmacy"
          },
          "pharmacyPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Pharmacy phone number.",
            "example": "+16025550111"
          },
          "requiresWitness": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether a second person must witness each dose.",
            "example": false
          },
          "quantityOnHand": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Doses currently on hand.",
            "example": 42
          },
          "refillsRemaining": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Refills left on the prescription.",
            "example": 2
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Other notes.",
            "example": null
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the medication was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the medication was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "MedicationList": {
        "type": "object",
        "description": "A page of medications.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Medication"
            },
            "description": "The medications on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "MedicationCreate": {
        "type": "object",
        "description": "Fields for a new medication. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "patientId": {
            "type": "string",
            "maxLength": 64,
            "description": "The patient who takes this medication.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Drug name, without the strength.",
            "example": "Metformin"
          },
          "strength": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Strength per dose unit.",
            "example": "500 mg"
          },
          "form": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Dose form.",
            "example": "Tablet"
          },
          "route": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "How it is taken.",
            "example": "By mouth"
          },
          "directions": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Directions as written on the prescription.",
            "example": "Take 1 tablet twice daily with meals."
          },
          "indication": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "What the medication is for.",
            "example": "Diabetes"
          },
          "scheduleType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Scheduled",
              "PRN",
              null
            ],
            "description": "`Scheduled` for regular doses, `PRN` for as-needed.",
            "example": "Scheduled"
          },
          "prnReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "For as-needed medications, when to give it.",
            "example": "Pain above 5 out of 10"
          },
          "prnMaxDailyDoses": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "For as-needed medications, the most doses allowed in a day.",
            "example": 4
          },
          "prnMinIntervalHours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "For as-needed medications, the minimum hours between doses.",
            "example": 6
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the patient started the medication.",
            "example": "2026-01-15"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "OnHold",
              "Discontinued",
              null
            ],
            "description": "Whether the medication is currently given.",
            "example": "Active"
          },
          "discontinuedDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the medication was stopped.",
            "example": null
          },
          "discontinuedReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Why the medication was stopped.",
            "example": null
          },
          "prescriber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Prescribing clinician.",
            "example": "Dr. Lena Ortiz"
          },
          "prescriberPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Prescriber's phone number.",
            "example": "+16025550199"
          },
          "pharmacy": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Pharmacy that fills the prescription.",
            "example": "Camelback Pharmacy"
          },
          "pharmacyPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Pharmacy phone number.",
            "example": "+16025550111"
          },
          "requiresWitness": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether a second person must witness each dose.",
            "example": false
          },
          "quantityOnHand": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Doses currently on hand.",
            "example": 42
          },
          "refillsRemaining": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Refills left on the prescription.",
            "example": 2
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Other notes.",
            "example": null
          }
        },
        "required": [
          "patientId",
          "name"
        ]
      },
      "MedicationUpdate": {
        "type": "object",
        "description": "Fields to change on a medication. Send only the fields to change; any other field is refused with `unknown_field`. `patientId` is set when the medication is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Drug name, without the strength.",
            "example": "Metformin"
          },
          "strength": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Strength per dose unit.",
            "example": "500 mg"
          },
          "form": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Dose form.",
            "example": "Tablet"
          },
          "route": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "How it is taken.",
            "example": "By mouth"
          },
          "directions": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Directions as written on the prescription.",
            "example": "Take 1 tablet twice daily with meals."
          },
          "indication": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "What the medication is for.",
            "example": "Diabetes"
          },
          "scheduleType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Scheduled",
              "PRN",
              null
            ],
            "description": "`Scheduled` for regular doses, `PRN` for as-needed.",
            "example": "Scheduled"
          },
          "prnReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "For as-needed medications, when to give it.",
            "example": "Pain above 5 out of 10"
          },
          "prnMaxDailyDoses": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "For as-needed medications, the most doses allowed in a day.",
            "example": 4
          },
          "prnMinIntervalHours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "For as-needed medications, the minimum hours between doses.",
            "example": 6
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the patient started the medication.",
            "example": "2026-01-15"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "OnHold",
              "Discontinued",
              null
            ],
            "description": "Whether the medication is currently given.",
            "example": "Active"
          },
          "discontinuedDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the medication was stopped.",
            "example": null
          },
          "discontinuedReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Why the medication was stopped.",
            "example": null
          },
          "prescriber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Prescribing clinician.",
            "example": "Dr. Lena Ortiz"
          },
          "prescriberPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Prescriber's phone number.",
            "example": "+16025550199"
          },
          "pharmacy": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Pharmacy that fills the prescription.",
            "example": "Camelback Pharmacy"
          },
          "pharmacyPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Pharmacy phone number.",
            "example": "+16025550111"
          },
          "requiresWitness": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether a second person must witness each dose.",
            "example": false
          },
          "quantityOnHand": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Doses currently on hand.",
            "example": 42
          },
          "refillsRemaining": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Refills left on the prescription.",
            "example": 2
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Other notes.",
            "example": null
          }
        },
        "minProperties": 1
      },
      "MedicationDeleted": {
        "type": "object",
        "description": "Confirmation that a medication was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "medication"
            ],
            "description": "Always `medication`.",
            "example": "medication"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted medication.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "CareGoal": {
        "type": "object",
        "description": "Goals of care set for a patient, such as walking to the mailbox unaided. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "name",
          "description",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "care_goal"
            ],
            "description": "String representing the object's type. Always `care_goal`.",
            "example": "care_goal",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the care goal.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient this goal is for.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Short name of the goal.",
            "example": "Walk to the mailbox"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What success looks like.",
            "example": "Walk to the mailbox and back with a cane, three times a week."
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the care goal was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the care goal was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "CareGoalList": {
        "type": "object",
        "description": "A page of care goals.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CareGoal"
            },
            "description": "The care goals on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "CareGoalCreate": {
        "type": "object",
        "description": "Fields for a new care goal. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "patientId": {
            "type": "string",
            "maxLength": 64,
            "description": "The patient this goal is for.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Short name of the goal.",
            "example": "Walk to the mailbox"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What success looks like.",
            "example": "Walk to the mailbox and back with a cane, three times a week."
          }
        },
        "required": [
          "patientId",
          "name"
        ]
      },
      "CareGoalUpdate": {
        "type": "object",
        "description": "Fields to change on a care goal. Send only the fields to change; any other field is refused with `unknown_field`. `patientId` is set when the care goal is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Short name of the goal.",
            "example": "Walk to the mailbox"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What success looks like.",
            "example": "Walk to the mailbox and back with a cane, three times a week."
          }
        },
        "minProperties": 1
      },
      "CareGoalDeleted": {
        "type": "object",
        "description": "Confirmation that a care goal was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "care_goal"
            ],
            "description": "Always `care_goal`.",
            "example": "care_goal"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted care goal.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "PatientNote": {
        "type": "object",
        "description": "Notes your staff and caregivers keep on a patient's profile. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "content",
          "authorId",
          "authorName",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "patient_note"
            ],
            "description": "String representing the object's type. Always `patient_note`.",
            "example": "patient_note",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the patient note.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient the note is about.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "content": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "The note.",
            "example": "Daughter visiting from out of state this week; prefers calls after 5pm."
          },
          "authorId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The person who wrote the note. Set to the API key's user.",
            "example": "d2b7e9a4-1c3f-4e58-b6a0-8f4c2e1d7b39",
            "readOnly": true
          },
          "authorName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Display name of the author.",
            "example": "Maria Santos",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the patient note was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the patient note was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "PatientNoteList": {
        "type": "object",
        "description": "A page of patient notes.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientNote"
            },
            "description": "The patient notes on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "PatientNoteCreate": {
        "type": "object",
        "description": "Fields for a new patient note. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "patientId": {
            "type": "string",
            "maxLength": 64,
            "description": "The patient the note is about.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "content": {
            "type": "string",
            "maxLength": 20000,
            "description": "The note.",
            "example": "Daughter visiting from out of state this week; prefers calls after 5pm."
          }
        },
        "required": [
          "patientId",
          "content"
        ]
      },
      "PatientNoteUpdate": {
        "type": "object",
        "description": "Fields to change on a patient note. Send only the fields to change; any other field is refused with `unknown_field`. `patientId` is set when the patient note is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string",
            "maxLength": 20000,
            "description": "The note.",
            "example": "Daughter visiting from out of state this week; prefers calls after 5pm."
          }
        },
        "minProperties": 1
      },
      "PatientNoteDeleted": {
        "type": "object",
        "description": "Confirmation that a patient note was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "patient_note"
            ],
            "description": "Always `patient_note`.",
            "example": "patient_note"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted patient note.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "MedicationAdministration": {
        "type": "object",
        "description": "The medication administration record (MAR): each dose a caregiver gave, or the reason it was not given. Read-only. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "medicationId",
          "patientId",
          "visitId",
          "scheduledDate",
          "scheduledSlot",
          "status",
          "administeredAt",
          "administeredByName",
          "reasonText",
          "note",
          "witnessName",
          "prnReason",
          "amended",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "medication_administration"
            ],
            "description": "String representing the object's type. Always `medication_administration`.",
            "example": "medication_administration",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the medication administration.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "medicationId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The medication this dose was for.",
            "example": "0a9d7c3e-5b2f-4f18-a6e4-7c1b9d2e8f50",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3",
            "readOnly": true
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit during which the dose was recorded.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75",
            "readOnly": true
          },
          "scheduledDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the dose was due.",
            "example": "2026-10-05",
            "readOnly": true
          },
          "scheduledSlot": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Time slot the dose was due, as `HH:MM`.",
            "example": "08:00",
            "readOnly": true
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Given",
              "Refused",
              "Held",
              "Missed",
              "SelfAdministered",
              null
            ],
            "description": "What happened to the dose.",
            "example": "Given",
            "readOnly": true
          },
          "administeredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the dose was given.",
            "example": "2026-10-05T15:04:00.000Z",
            "readOnly": true
          },
          "administeredByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Who gave or recorded the dose.",
            "example": "Maria Santos",
            "readOnly": true
          },
          "reasonText": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the dose was refused, held or missed.",
            "example": null,
            "readOnly": true
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Note recorded with the dose.",
            "example": null,
            "readOnly": true
          },
          "witnessName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Witness, for medications that require one.",
            "example": null,
            "readOnly": true
          },
          "prnReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "For as-needed doses, why it was given.",
            "example": null,
            "readOnly": true
          },
          "amended": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this entry was later corrected.",
            "example": false,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the medication administration was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the medication administration was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "MedicationAdministrationList": {
        "type": "object",
        "description": "A page of medication administrations.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MedicationAdministration"
            },
            "description": "The medication administrations on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "OasisAssessment": {
        "type": "object",
        "description": "OASIS assessments recorded for Medicare home health patients. This lists each assessment and its status; the item-level answers are not included. Read-only. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "timepoint",
          "specVersion",
          "status",
          "m0090CompletedDate",
          "episodeStartDate",
          "targetDate",
          "assessorName",
          "completedAt",
          "exportedAt",
          "correctionNumber",
          "notes",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "oasis_assessment"
            ],
            "description": "String representing the object's type. Always `oasis_assessment`.",
            "example": "oasis_assessment",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the OASIS assessment.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient assessed.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3",
            "readOnly": true
          },
          "timepoint": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "SOC",
              "ROC",
              "Recertification",
              "Transfer",
              "Discharge",
              "DeathAtHome",
              null
            ],
            "description": "Which OASIS time point this assessment covers.",
            "example": "SOC",
            "readOnly": true
          },
          "specVersion": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "OASIS data set version.",
            "example": "OASIS-E1",
            "readOnly": true
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Draft",
              "Completed",
              "Exported",
              "Accepted",
              "Rejected",
              "Inactivated",
              null
            ],
            "description": "Where the assessment is in its lifecycle.",
            "example": "Completed",
            "readOnly": true
          },
          "m0090CompletedDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the assessment was completed (OASIS item M0090).",
            "example": "2026-09-30",
            "readOnly": true
          },
          "episodeStartDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Start of the care episode.",
            "example": "2026-09-28",
            "readOnly": true
          },
          "targetDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the assessment is due.",
            "example": "2026-10-02",
            "readOnly": true
          },
          "assessorName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Clinician who performed the assessment.",
            "example": "Jordan Lee, RN",
            "readOnly": true
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the assessment was marked complete.",
            "example": "2026-09-30T21:12:00.000Z",
            "readOnly": true
          },
          "exportedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the assessment was exported for submission.",
            "example": null,
            "readOnly": true
          },
          "correctionNumber": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Correction number; 0 for the original.",
            "example": 0,
            "readOnly": true
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes on the assessment.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the OASIS assessment was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the OASIS assessment was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "OasisAssessmentList": {
        "type": "object",
        "description": "A page of OASIS assessments.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OasisAssessment"
            },
            "description": "The OASIS assessments on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "Caregiver": {
        "type": "object",
        "description": "Caregivers are the aides, nurses and therapists your agency schedules to visit patients. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "firstName",
          "middleName",
          "lastName",
          "goesByName",
          "email",
          "status",
          "active",
          "dateOfBirth",
          "gender",
          "primaryLanguage",
          "address",
          "city",
          "state",
          "zipCode",
          "officeId",
          "licenseType",
          "npiNumber",
          "stateLicenseNumber",
          "stateLicenseState",
          "stateLicenseExpiry",
          "isLiveInCaregiver",
          "schedulingNotes",
          "lastVisit",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "caregiver"
            ],
            "description": "String representing the object's type. Always `caregiver`.",
            "example": "caregiver",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the caregiver.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "firstName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Given name.",
            "example": "Maria"
          },
          "middleName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Middle name.",
            "example": null
          },
          "lastName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Family name.",
            "example": "Santos"
          },
          "goesByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The name the caregiver prefers to be called.",
            "example": null
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Work email address.",
            "example": "maria.santos@example.com"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "OnLeave",
              "Inactive",
              null
            ],
            "description": "Employment status.",
            "example": "Active"
          },
          "active": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the caregiver can be scheduled. If you leave it out on create, it is `false` for an `Inactive` status and `true` otherwise.",
            "example": true
          },
          "dateOfBirth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of birth.",
            "example": "1988-07-22"
          },
          "gender": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Gender as recorded by the agency.",
            "example": "Female"
          },
          "primaryLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Language the caregiver is most comfortable speaking.",
            "example": "Spanish"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Home street address.",
            "example": "220 W Indian School Rd"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85013"
          },
          "officeId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The office (branch) the caregiver works from.",
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          "licenseType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "License or credential type.",
            "example": "CNA"
          },
          "npiNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "National Provider Identifier, for licensed clinicians.",
            "example": null
          },
          "stateLicenseNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State license number.",
            "example": null
          },
          "stateLicenseState": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State that issued the license.",
            "example": null
          },
          "stateLicenseExpiry": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "License expiry date, as `YYYY-MM-DD`.",
            "example": null
          },
          "isLiveInCaregiver": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the caregiver works live-in shifts.",
            "example": false
          },
          "schedulingNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes schedulers see when booking this caregiver.",
            "example": "No cats - allergic."
          },
          "lastVisit": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of the caregiver's most recent visit.",
            "example": "2026-10-04",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the caregiver was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the caregiver was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "CaregiverList": {
        "type": "object",
        "description": "A page of caregivers.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Caregiver"
            },
            "description": "The caregivers on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "CaregiverCreate": {
        "type": "object",
        "description": "Fields for a new caregiver. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "description": "Given name.",
            "example": "Maria"
          },
          "middleName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Middle name.",
            "example": null
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "description": "Family name.",
            "example": "Santos"
          },
          "goesByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The name the caregiver prefers to be called.",
            "example": null
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Work email address.",
            "example": "maria.santos@example.com"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "OnLeave",
              "Inactive",
              null
            ],
            "description": "Employment status.",
            "example": "Active"
          },
          "active": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the caregiver can be scheduled. If you leave it out on create, it is `false` for an `Inactive` status and `true` otherwise.",
            "example": true
          },
          "dateOfBirth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of birth.",
            "example": "1988-07-22"
          },
          "gender": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Gender as recorded by the agency.",
            "example": "Female"
          },
          "primaryLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Language the caregiver is most comfortable speaking.",
            "example": "Spanish"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Home street address.",
            "example": "220 W Indian School Rd"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85013"
          },
          "officeId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The office (branch) the caregiver works from.",
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          "licenseType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "License or credential type.",
            "example": "CNA"
          },
          "npiNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "National Provider Identifier, for licensed clinicians.",
            "example": null
          },
          "stateLicenseNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State license number.",
            "example": null
          },
          "stateLicenseState": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State that issued the license.",
            "example": null
          },
          "stateLicenseExpiry": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "License expiry date, as `YYYY-MM-DD`.",
            "example": null
          },
          "isLiveInCaregiver": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the caregiver works live-in shifts.",
            "example": false
          },
          "schedulingNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes schedulers see when booking this caregiver.",
            "example": "No cats - allergic."
          }
        },
        "required": [
          "firstName",
          "lastName"
        ]
      },
      "CaregiverUpdate": {
        "type": "object",
        "description": "Fields to change on a caregiver. Send only the fields to change; any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "description": "Given name.",
            "example": "Maria"
          },
          "middleName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Middle name.",
            "example": null
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "description": "Family name.",
            "example": "Santos"
          },
          "goesByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The name the caregiver prefers to be called.",
            "example": null
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Work email address.",
            "example": "maria.santos@example.com"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "OnLeave",
              "Inactive",
              null
            ],
            "description": "Employment status.",
            "example": "Active"
          },
          "active": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the caregiver can be scheduled. If you leave it out on create, it is `false` for an `Inactive` status and `true` otherwise.",
            "example": true
          },
          "dateOfBirth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of birth.",
            "example": "1988-07-22"
          },
          "gender": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Gender as recorded by the agency.",
            "example": "Female"
          },
          "primaryLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Language the caregiver is most comfortable speaking.",
            "example": "Spanish"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Home street address.",
            "example": "220 W Indian School Rd"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85013"
          },
          "officeId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The office (branch) the caregiver works from.",
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          "licenseType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "License or credential type.",
            "example": "CNA"
          },
          "npiNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "National Provider Identifier, for licensed clinicians.",
            "example": null
          },
          "stateLicenseNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State license number.",
            "example": null
          },
          "stateLicenseState": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State that issued the license.",
            "example": null
          },
          "stateLicenseExpiry": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "License expiry date, as `YYYY-MM-DD`.",
            "example": null
          },
          "isLiveInCaregiver": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the caregiver works live-in shifts.",
            "example": false
          },
          "schedulingNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes schedulers see when booking this caregiver.",
            "example": "No cats - allergic."
          }
        },
        "minProperties": 1
      },
      "CaregiverDeleted": {
        "type": "object",
        "description": "Confirmation that a caregiver was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "caregiver"
            ],
            "description": "Always `caregiver`.",
            "example": "caregiver"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted caregiver.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "CaregiverNote": {
        "type": "object",
        "description": "Notes your staff keep on a caregiver's profile. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "caregiverId",
          "content",
          "authorId",
          "authorName",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "caregiver_note"
            ],
            "description": "String representing the object's type. Always `caregiver_note`.",
            "example": "caregiver_note",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the caregiver note.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver the note is about.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "content": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "The note.",
            "example": "Completed dementia care refresher on 9/30."
          },
          "authorId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The person who wrote the note. Set to the API key's user.",
            "example": "d2b7e9a4-1c3f-4e58-b6a0-8f4c2e1d7b39",
            "readOnly": true
          },
          "authorName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Display name of the author.",
            "example": "Alice Smith",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the caregiver note was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the caregiver note was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "CaregiverNoteList": {
        "type": "object",
        "description": "A page of caregiver notes.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaregiverNote"
            },
            "description": "The caregiver notes on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "CaregiverNoteCreate": {
        "type": "object",
        "description": "Fields for a new caregiver note. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "caregiverId": {
            "type": "string",
            "maxLength": 64,
            "description": "The caregiver the note is about.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "content": {
            "type": "string",
            "maxLength": 20000,
            "description": "The note.",
            "example": "Completed dementia care refresher on 9/30."
          }
        },
        "required": [
          "caregiverId",
          "content"
        ]
      },
      "CaregiverNoteUpdate": {
        "type": "object",
        "description": "Fields to change on a caregiver note. Send only the fields to change; any other field is refused with `unknown_field`. `caregiverId` is set when the caregiver note is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string",
            "maxLength": 20000,
            "description": "The note.",
            "example": "Completed dementia care refresher on 9/30."
          }
        },
        "minProperties": 1
      },
      "CaregiverNoteDeleted": {
        "type": "object",
        "description": "Confirmation that a caregiver note was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "caregiver_note"
            ],
            "description": "Always `caregiver_note`.",
            "example": "caregiver_note"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted caregiver note.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Certification": {
        "type": "object",
        "description": "Certifications, licenses and background checks on a caregiver's profile, with their expiry dates. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "caregiverId",
          "name",
          "certKind",
          "obtained",
          "expires",
          "checkAgency",
          "checkState",
          "checkResult",
          "verifiedByName",
          "verifiedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "certification"
            ],
            "description": "String representing the object's type. Always `certification`.",
            "example": "certification",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the certification.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver who holds it.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Name of the certification.",
            "example": "CPR and First Aid"
          },
          "certKind": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Kind of credential, such as a certification or a background check.",
            "example": "certification"
          },
          "obtained": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date it was obtained.",
            "example": "2025-11-02"
          },
          "expires": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date it expires.",
            "example": "2027-11-02"
          },
          "checkAgency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "For background checks, the agency that ran the check.",
            "example": null
          },
          "checkState": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "For background checks, the state the check covers.",
            "example": null
          },
          "checkResult": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "For background checks, the result.",
            "example": null
          },
          "verifiedByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Who verified the credential.",
            "example": "Alice Smith",
            "readOnly": true
          },
          "verifiedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the credential was verified.",
            "example": "2025-11-03T17:20:00.000Z",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the certification was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the certification was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "CertificationList": {
        "type": "object",
        "description": "A page of certifications.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Certification"
            },
            "description": "The certifications on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "CertificationCreate": {
        "type": "object",
        "description": "Fields for a new certification. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "caregiverId": {
            "type": "string",
            "maxLength": 64,
            "description": "The caregiver who holds it.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Name of the certification.",
            "example": "CPR and First Aid"
          },
          "certKind": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Kind of credential, such as a certification or a background check.",
            "example": "certification"
          },
          "obtained": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date it was obtained.",
            "example": "2025-11-02"
          },
          "expires": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date it expires.",
            "example": "2027-11-02"
          },
          "checkAgency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "For background checks, the agency that ran the check.",
            "example": null
          },
          "checkState": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "For background checks, the state the check covers.",
            "example": null
          },
          "checkResult": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "For background checks, the result.",
            "example": null
          }
        },
        "required": [
          "caregiverId",
          "name"
        ]
      },
      "CertificationUpdate": {
        "type": "object",
        "description": "Fields to change on a certification. Send only the fields to change; any other field is refused with `unknown_field`. `caregiverId` is set when the certification is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Name of the certification.",
            "example": "CPR and First Aid"
          },
          "certKind": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Kind of credential, such as a certification or a background check.",
            "example": "certification"
          },
          "obtained": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date it was obtained.",
            "example": "2025-11-02"
          },
          "expires": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date it expires.",
            "example": "2027-11-02"
          },
          "checkAgency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "For background checks, the agency that ran the check.",
            "example": null
          },
          "checkState": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "For background checks, the state the check covers.",
            "example": null
          },
          "checkResult": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "For background checks, the result.",
            "example": null
          }
        },
        "minProperties": 1
      },
      "CertificationDeleted": {
        "type": "object",
        "description": "Confirmation that a certification was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "certification"
            ],
            "description": "Always `certification`.",
            "example": "certification"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted certification.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Availability": {
        "type": "object",
        "description": "When a caregiver can or cannot work. A window is either a weekly recurring time on one weekday, or a one-off date range such as time off. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "caregiverId",
          "isAvailable",
          "recurring",
          "dayOfWeek",
          "startMinute",
          "endMinute",
          "intervalWeeks",
          "effectiveFrom",
          "effectiveTo",
          "startDateTime",
          "endDateTime",
          "isPreferred",
          "reason",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "availability"
            ],
            "description": "String representing the object's type. Always `availability`.",
            "example": "availability",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the availability window.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "isAvailable": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true` when the caregiver can work in this window, `false` for time off.",
            "example": true
          },
          "recurring": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the window repeats weekly.",
            "example": true
          },
          "dayOfWeek": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 6,
            "description": "For weekly windows, the weekday: 0 is Sunday, 6 is Saturday.",
            "example": 1
          },
          "startMinute": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1440,
            "description": "For weekly windows, the start time in minutes after midnight.",
            "example": 480
          },
          "endMinute": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1440,
            "description": "For weekly windows, the end time in minutes after midnight.",
            "example": 1020
          },
          "intervalWeeks": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "For weekly windows, repeat every this many weeks. Defaults to every week.",
            "example": 1
          },
          "effectiveFrom": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First date a weekly window applies.",
            "example": "2026-10-01"
          },
          "effectiveTo": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last date a weekly window applies; `null` for no end.",
            "example": null
          },
          "startDateTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "For one-off windows, when it starts.",
            "example": null
          },
          "endDateTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "For one-off windows, when it ends.",
            "example": null
          },
          "isPreferred": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether these are the caregiver's preferred hours.",
            "example": false
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Why the caregiver is unavailable, for time off.",
            "example": null
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the window is in effect.",
            "example": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the availability window was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the availability window was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "AvailabilityList": {
        "type": "object",
        "description": "A page of availability windows.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Availability"
            },
            "description": "The availability windows on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "AvailabilityCreate": {
        "type": "object",
        "description": "Fields for a new availability window. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "caregiverId": {
            "type": "string",
            "maxLength": 64,
            "description": "The caregiver.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "isAvailable": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true` when the caregiver can work in this window, `false` for time off.",
            "example": true
          },
          "recurring": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the window repeats weekly.",
            "example": true
          },
          "dayOfWeek": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 6,
            "description": "For weekly windows, the weekday: 0 is Sunday, 6 is Saturday.",
            "example": 1
          },
          "startMinute": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1440,
            "description": "For weekly windows, the start time in minutes after midnight.",
            "example": 480
          },
          "endMinute": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1440,
            "description": "For weekly windows, the end time in minutes after midnight.",
            "example": 1020
          },
          "intervalWeeks": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "For weekly windows, repeat every this many weeks. Defaults to every week.",
            "example": 1
          },
          "effectiveFrom": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First date a weekly window applies.",
            "example": "2026-10-01"
          },
          "effectiveTo": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last date a weekly window applies; `null` for no end.",
            "example": null
          },
          "startDateTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "For one-off windows, when it starts.",
            "example": null
          },
          "endDateTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "For one-off windows, when it ends.",
            "example": null
          },
          "isPreferred": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether these are the caregiver's preferred hours.",
            "example": false
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Why the caregiver is unavailable, for time off.",
            "example": null
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the window is in effect.",
            "example": true
          }
        },
        "required": [
          "caregiverId"
        ]
      },
      "AvailabilityUpdate": {
        "type": "object",
        "description": "Fields to change on an availability window. Send only the fields to change; any other field is refused with `unknown_field`. `caregiverId` is set when the availability window is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "isAvailable": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true` when the caregiver can work in this window, `false` for time off.",
            "example": true
          },
          "recurring": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the window repeats weekly.",
            "example": true
          },
          "dayOfWeek": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 6,
            "description": "For weekly windows, the weekday: 0 is Sunday, 6 is Saturday.",
            "example": 1
          },
          "startMinute": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1440,
            "description": "For weekly windows, the start time in minutes after midnight.",
            "example": 480
          },
          "endMinute": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1440,
            "description": "For weekly windows, the end time in minutes after midnight.",
            "example": 1020
          },
          "intervalWeeks": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "For weekly windows, repeat every this many weeks. Defaults to every week.",
            "example": 1
          },
          "effectiveFrom": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First date a weekly window applies.",
            "example": "2026-10-01"
          },
          "effectiveTo": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last date a weekly window applies; `null` for no end.",
            "example": null
          },
          "startDateTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "For one-off windows, when it starts.",
            "example": null
          },
          "endDateTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "For one-off windows, when it ends.",
            "example": null
          },
          "isPreferred": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether these are the caregiver's preferred hours.",
            "example": false
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Why the caregiver is unavailable, for time off.",
            "example": null
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the window is in effect.",
            "example": true
          }
        },
        "minProperties": 1
      },
      "AvailabilityDeleted": {
        "type": "object",
        "description": "Confirmation that an availability window was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "availability"
            ],
            "description": "Always `availability`.",
            "example": "availability"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted availability window.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Specialization": {
        "type": "object",
        "description": "Skills and specialties on a caregiver's profile, such as dementia care or Hoyer lift transfers. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "caregiverId",
          "name",
          "description",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "specialization"
            ],
            "description": "String representing the object's type. Always `specialization`.",
            "example": "specialization",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the specialization.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Name of the skill.",
            "example": "Dementia care"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Details.",
            "example": "Certified through the Alzheimer's Association, 2024."
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the specialization was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the specialization was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "SpecializationList": {
        "type": "object",
        "description": "A page of specializations.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Specialization"
            },
            "description": "The specializations on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "SpecializationCreate": {
        "type": "object",
        "description": "Fields for a new specialization. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "caregiverId": {
            "type": "string",
            "maxLength": 64,
            "description": "The caregiver.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Name of the skill.",
            "example": "Dementia care"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Details.",
            "example": "Certified through the Alzheimer's Association, 2024."
          }
        },
        "required": [
          "caregiverId",
          "name"
        ]
      },
      "SpecializationUpdate": {
        "type": "object",
        "description": "Fields to change on a specialization. Send only the fields to change; any other field is refused with `unknown_field`. `caregiverId` is set when the specialization is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Name of the skill.",
            "example": "Dementia care"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Details.",
            "example": "Certified through the Alzheimer's Association, 2024."
          }
        },
        "minProperties": 1
      },
      "SpecializationDeleted": {
        "type": "object",
        "description": "Confirmation that a specialization was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "specialization"
            ],
            "description": "Always `specialization`.",
            "example": "specialization"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted specialization.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Applicant": {
        "type": "object",
        "description": "People who applied to work for your agency, tracked through your hiring stages until they are hired as caregivers. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "firstName",
          "middleName",
          "lastName",
          "email",
          "phone",
          "stage",
          "stageChangedAt",
          "applicationDate",
          "applicationSource",
          "referredBy",
          "city",
          "state",
          "zipCode",
          "desiredStartDate",
          "desiredPayRate",
          "availableHoursPerWeek",
          "yearsExperience",
          "primaryLanguage",
          "hasDriversLicense",
          "hasReliableTransportation",
          "hasCPRCertification",
          "interviewDate",
          "offerStatus",
          "officeId",
          "notes",
          "convertedToCaregiverId",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "applicant"
            ],
            "description": "String representing the object's type. Always `applicant`.",
            "example": "applicant",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the applicant.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "firstName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Given name.",
            "example": "Tasha"
          },
          "middleName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Middle name.",
            "example": null
          },
          "lastName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Family name.",
            "example": "Brooks"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address.",
            "example": "tasha.brooks@example.com"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number.",
            "example": "+16025550173"
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Hiring stage, as named in your pipeline.",
            "example": "Interview"
          },
          "stageChangedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the applicant last moved stage.",
            "example": "2026-10-01T16:00:00.000Z",
            "readOnly": true
          },
          "applicationDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the application was received.",
            "example": "2026-09-24T14:30:00.000Z"
          },
          "applicationSource": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Where the applicant found you.",
            "example": "Indeed"
          },
          "referredBy": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Who referred the applicant.",
            "example": null
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Tempe"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85281"
          },
          "desiredStartDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Earliest date the applicant can start.",
            "example": "2026-10-20"
          },
          "desiredPayRate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Hourly pay the applicant is asking for, in dollars.",
            "example": 19.5
          },
          "availableHoursPerWeek": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Hours per week the applicant can work.",
            "example": 30
          },
          "yearsExperience": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Years of caregiving experience.",
            "example": 4
          },
          "primaryLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Primary language.",
            "example": "English"
          },
          "hasDriversLicense": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the applicant has a driver's license.",
            "example": true
          },
          "hasReliableTransportation": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the applicant has reliable transportation.",
            "example": true
          },
          "hasCPRCertification": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the applicant holds a current CPR certification.",
            "example": true
          },
          "interviewDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Scheduled or completed interview time.",
            "example": "2026-10-07T17:00:00.000Z"
          },
          "offerStatus": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Status of any job offer.",
            "example": null
          },
          "officeId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The office the applicant applied to.",
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Recruiter notes.",
            "example": "Strong references from prior agency."
          },
          "convertedToCaregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver record created when the applicant was hired.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the applicant was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the applicant was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "ApplicantList": {
        "type": "object",
        "description": "A page of applicants.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Applicant"
            },
            "description": "The applicants on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "ApplicantCreate": {
        "type": "object",
        "description": "Fields for a new applicant. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "description": "Given name.",
            "example": "Tasha"
          },
          "middleName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Middle name.",
            "example": null
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "description": "Family name.",
            "example": "Brooks"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address.",
            "example": "tasha.brooks@example.com"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number.",
            "example": "+16025550173"
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Hiring stage, as named in your pipeline.",
            "example": "Interview"
          },
          "applicationDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the application was received.",
            "example": "2026-09-24T14:30:00.000Z"
          },
          "applicationSource": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Where the applicant found you.",
            "example": "Indeed"
          },
          "referredBy": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Who referred the applicant.",
            "example": null
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Tempe"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85281"
          },
          "desiredStartDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Earliest date the applicant can start.",
            "example": "2026-10-20"
          },
          "desiredPayRate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Hourly pay the applicant is asking for, in dollars.",
            "example": 19.5
          },
          "availableHoursPerWeek": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Hours per week the applicant can work.",
            "example": 30
          },
          "yearsExperience": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Years of caregiving experience.",
            "example": 4
          },
          "primaryLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Primary language.",
            "example": "English"
          },
          "hasDriversLicense": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the applicant has a driver's license.",
            "example": true
          },
          "hasReliableTransportation": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the applicant has reliable transportation.",
            "example": true
          },
          "hasCPRCertification": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the applicant holds a current CPR certification.",
            "example": true
          },
          "interviewDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Scheduled or completed interview time.",
            "example": "2026-10-07T17:00:00.000Z"
          },
          "offerStatus": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Status of any job offer.",
            "example": null
          },
          "officeId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The office the applicant applied to.",
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Recruiter notes.",
            "example": "Strong references from prior agency."
          }
        },
        "required": [
          "firstName",
          "lastName"
        ]
      },
      "ApplicantUpdate": {
        "type": "object",
        "description": "Fields to change on an applicant. Send only the fields to change; any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "description": "Given name.",
            "example": "Tasha"
          },
          "middleName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Middle name.",
            "example": null
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "description": "Family name.",
            "example": "Brooks"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address.",
            "example": "tasha.brooks@example.com"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number.",
            "example": "+16025550173"
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Hiring stage, as named in your pipeline.",
            "example": "Interview"
          },
          "applicationDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the application was received.",
            "example": "2026-09-24T14:30:00.000Z"
          },
          "applicationSource": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Where the applicant found you.",
            "example": "Indeed"
          },
          "referredBy": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Who referred the applicant.",
            "example": null
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Tempe"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85281"
          },
          "desiredStartDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Earliest date the applicant can start.",
            "example": "2026-10-20"
          },
          "desiredPayRate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Hourly pay the applicant is asking for, in dollars.",
            "example": 19.5
          },
          "availableHoursPerWeek": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Hours per week the applicant can work.",
            "example": 30
          },
          "yearsExperience": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Years of caregiving experience.",
            "example": 4
          },
          "primaryLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Primary language.",
            "example": "English"
          },
          "hasDriversLicense": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the applicant has a driver's license.",
            "example": true
          },
          "hasReliableTransportation": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the applicant has reliable transportation.",
            "example": true
          },
          "hasCPRCertification": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the applicant holds a current CPR certification.",
            "example": true
          },
          "interviewDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Scheduled or completed interview time.",
            "example": "2026-10-07T17:00:00.000Z"
          },
          "offerStatus": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Status of any job offer.",
            "example": null
          },
          "officeId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The office the applicant applied to.",
            "example": "6b0e4d1a-2c7f-4a93-8e15-f3d9a7c2b604"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Recruiter notes.",
            "example": "Strong references from prior agency."
          }
        },
        "minProperties": 1
      },
      "ApplicantDeleted": {
        "type": "object",
        "description": "Confirmation that an applicant was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "applicant"
            ],
            "description": "Always `applicant`.",
            "example": "applicant"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted applicant.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Visit": {
        "type": "object",
        "description": "Visits are scheduled or completed caregiver shifts at a patient's home. A visit's patient, caregiver, times and status are set when it is created; reschedule or reassign a visit in AveeCare. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "caregiverId",
          "startTime",
          "endTime",
          "status",
          "title",
          "isAllDay",
          "tasks",
          "reason",
          "notes",
          "serviceCode",
          "locationAddress",
          "actualStartTime",
          "actualEndTime",
          "completedTasks",
          "evvVerified",
          "evvStatus",
          "billingStatus",
          "invoiceId",
          "billableHours",
          "isRecurring",
          "recurrenceSeriesId",
          "caregiverRSVP",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "visit"
            ],
            "description": "String representing the object's type. Always `visit`.",
            "example": "visit",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the visit.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient being visited.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver assigned to the visit; `null` for an open shift.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "startTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Scheduled start.",
            "example": "2026-10-06T15:00:00.000Z"
          },
          "endTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Scheduled end.",
            "example": "2026-10-06T19:00:00.000Z"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Scheduled",
              "InProgress",
              "Cancelled",
              "Completed",
              "Late",
              "OverTime",
              "Incomplete",
              null
            ],
            "description": "Where the visit is in its day. New visits are `Scheduled`.",
            "example": "Scheduled"
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Short title shown on the schedule.",
            "example": "Morning personal care"
          },
          "isAllDay": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the visit spans the whole day, such as a live-in shift.",
            "example": false
          },
          "tasks": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Tasks the caregiver should complete during the visit.",
            "example": [
              "Bathing",
              "Meal preparation",
              "Medication reminder"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the visit is scheduled, if it is not routine.",
            "example": null
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes for the caregiver about this visit.",
            "example": "Use the side door; front steps are icy."
          },
          "serviceCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Billing service code for the visit.",
            "example": "S5125"
          },
          "locationAddress": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "Where the visit takes place, when it is not the patient's home address.",
            "example": null
          },
          "actualStartTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the caregiver clocked in.",
            "example": "2026-10-06T15:02:11.000Z",
            "readOnly": true
          },
          "actualEndTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the caregiver clocked out.",
            "example": "2026-10-06T19:00:40.000Z",
            "readOnly": true
          },
          "completedTasks": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Tasks the caregiver marked done.",
            "example": [
              "Bathing",
              "Meal preparation"
            ],
            "readOnly": true
          },
          "evvVerified": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the visit passed electronic visit verification.",
            "example": true,
            "readOnly": true
          },
          "evvStatus": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Pending",
              "Validated",
              "Flagged",
              "Overridden",
              "Exported",
              "Submitted",
              null
            ],
            "description": "Electronic visit verification status.",
            "example": "Validated",
            "readOnly": true
          },
          "billingStatus": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "NotBilled",
              "Pending",
              "Invoiced",
              "Paid",
              null
            ],
            "description": "Whether the visit has been billed.",
            "example": "NotBilled",
            "readOnly": true
          },
          "invoiceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The invoice the visit was billed on.",
            "example": null,
            "readOnly": true
          },
          "billableHours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Hours billed for the visit.",
            "example": 4,
            "readOnly": true
          },
          "isRecurring": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the visit belongs to a repeating series.",
            "example": false,
            "readOnly": true
          },
          "recurrenceSeriesId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The repeating series the visit belongs to.",
            "example": null,
            "readOnly": true
          },
          "caregiverRSVP": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "confirmed",
              "declined",
              null
            ],
            "description": "The caregiver's response to the assignment.",
            "example": "confirmed",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the visit was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the visit was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "VisitList": {
        "type": "object",
        "description": "A page of visits.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Visit"
            },
            "description": "The visits on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "VisitCreate": {
        "type": "object",
        "description": "Fields for a new visit. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "patientId": {
            "type": "string",
            "maxLength": 64,
            "description": "The patient being visited.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver assigned to the visit; `null` for an open shift.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "startTime": {
            "type": "string",
            "format": "date-time",
            "description": "Scheduled start.",
            "example": "2026-10-06T15:00:00.000Z"
          },
          "endTime": {
            "type": "string",
            "format": "date-time",
            "description": "Scheduled end.",
            "example": "2026-10-06T19:00:00.000Z"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Scheduled",
              "InProgress",
              "Cancelled",
              "Completed",
              "Late",
              "OverTime",
              "Incomplete",
              null
            ],
            "description": "Where the visit is in its day. New visits are `Scheduled`.",
            "example": "Scheduled"
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Short title shown on the schedule.",
            "example": "Morning personal care"
          },
          "isAllDay": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the visit spans the whole day, such as a live-in shift.",
            "example": false
          },
          "tasks": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Tasks the caregiver should complete during the visit.",
            "example": [
              "Bathing",
              "Meal preparation",
              "Medication reminder"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the visit is scheduled, if it is not routine.",
            "example": null
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes for the caregiver about this visit.",
            "example": "Use the side door; front steps are icy."
          },
          "serviceCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Billing service code for the visit.",
            "example": "S5125"
          },
          "locationAddress": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "Where the visit takes place, when it is not the patient's home address.",
            "example": null
          }
        },
        "required": [
          "patientId",
          "startTime",
          "endTime"
        ]
      },
      "VisitUpdate": {
        "type": "object",
        "description": "Fields to change on a visit. Send only the fields to change; any other field is refused with `unknown_field`. `patientId`, `caregiverId`, `startTime`, `endTime`, `status` are set when the visit is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Short title shown on the schedule.",
            "example": "Morning personal care"
          },
          "isAllDay": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the visit spans the whole day, such as a live-in shift.",
            "example": false
          },
          "tasks": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Tasks the caregiver should complete during the visit.",
            "example": [
              "Bathing",
              "Meal preparation",
              "Medication reminder"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the visit is scheduled, if it is not routine.",
            "example": null
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes for the caregiver about this visit.",
            "example": "Use the side door; front steps are icy."
          },
          "serviceCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Billing service code for the visit.",
            "example": "S5125"
          },
          "locationAddress": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "Where the visit takes place, when it is not the patient's home address.",
            "example": null
          }
        },
        "minProperties": 1
      },
      "VisitDeleted": {
        "type": "object",
        "description": "Confirmation that a visit was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "visit"
            ],
            "description": "Always `visit`.",
            "example": "visit"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted visit.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "VisitNote": {
        "type": "object",
        "description": "Notes written about a visit by the caregiver or office staff. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "visitId",
          "content",
          "authorType",
          "authorId",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "visit_note"
            ],
            "description": "String representing the object's type. Always `visit_note`.",
            "example": "visit_note",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the visit note.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit the note is about.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "content": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "The note.",
            "example": "Patient was in good spirits; ate a full lunch."
          },
          "authorType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "User",
              "Caregiver",
              null
            ],
            "description": "Whether office staff (`User`) or a caregiver wrote the note. Set from the API key's user.",
            "example": "Caregiver",
            "readOnly": true
          },
          "authorId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "ID of the staff user or caregiver who wrote the note. Set from the API key's user.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the visit note was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the visit note was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "VisitNoteList": {
        "type": "object",
        "description": "A page of visit notes.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VisitNote"
            },
            "description": "The visit notes on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "VisitNoteCreate": {
        "type": "object",
        "description": "Fields for a new visit note. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "visitId": {
            "type": "string",
            "maxLength": 64,
            "description": "The visit the note is about.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "content": {
            "type": "string",
            "maxLength": 20000,
            "description": "The note.",
            "example": "Patient was in good spirits; ate a full lunch."
          }
        },
        "required": [
          "visitId",
          "content"
        ]
      },
      "VisitNoteUpdate": {
        "type": "object",
        "description": "Fields to change on a visit note. Send only the fields to change; any other field is refused with `unknown_field`. `visitId` is set when the visit note is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string",
            "maxLength": 20000,
            "description": "The note.",
            "example": "Patient was in good spirits; ate a full lunch."
          }
        },
        "minProperties": 1
      },
      "VisitNoteDeleted": {
        "type": "object",
        "description": "Confirmation that a visit note was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "visit_note"
            ],
            "description": "Always `visit_note`.",
            "example": "visit_note"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted visit note.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "VisitRequest": {
        "type": "object",
        "description": "Requests from caregivers to pick up visits with a patient, which office staff approve or deny. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "caregiverId",
          "caregiverName",
          "patientId",
          "patientName",
          "preferredStartDate",
          "preferredEndDate",
          "preferredTimeOfDay",
          "reason",
          "status",
          "adminResponse",
          "respondedByName",
          "respondedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "visit_request"
            ],
            "description": "String representing the object's type. Always `visit_request`.",
            "example": "visit_request",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the visit request.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver asking for the visit. With a caregiver's API key this is always that caregiver (leave it out); office staff must send it.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "caregiverName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Caregiver's display name, taken from the caregiver's record.",
            "example": "Maria Santos",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient the caregiver would visit.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "patientName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Patient's display name.",
            "example": "Eleanor Vance"
          },
          "preferredStartDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First date the caregiver could start.",
            "example": "2026-10-10"
          },
          "preferredEndDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last date of the request.",
            "example": "2026-10-31"
          },
          "preferredTimeOfDay": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Time of day the caregiver prefers.",
            "example": "Mornings"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the caregiver is asking.",
            "example": "I live nearby and have open mornings."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Pending",
              "Approved",
              "Denied",
              "Cancelled",
              null
            ],
            "description": "Where the request stands. A caregiver's key creates `Pending` requests and can only change its own pending request to `Cancelled`; approving and denying is for office staff.",
            "example": "Pending"
          },
          "adminResponse": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "The office's reply. Set by office staff.",
            "example": null
          },
          "respondedByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Who answered the request.",
            "example": null,
            "readOnly": true
          },
          "respondedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the request was answered.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the visit request was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the visit request was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "VisitRequestList": {
        "type": "object",
        "description": "A page of visit requests.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VisitRequest"
            },
            "description": "The visit requests on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "VisitRequestCreate": {
        "type": "object",
        "description": "Fields for a new visit request. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver asking for the visit. With a caregiver's API key this is always that caregiver (leave it out); office staff must send it.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient the caregiver would visit.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "patientName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Patient's display name.",
            "example": "Eleanor Vance"
          },
          "preferredStartDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First date the caregiver could start.",
            "example": "2026-10-10"
          },
          "preferredEndDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last date of the request.",
            "example": "2026-10-31"
          },
          "preferredTimeOfDay": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Time of day the caregiver prefers.",
            "example": "Mornings"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the caregiver is asking.",
            "example": "I live nearby and have open mornings."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Pending",
              "Approved",
              "Denied",
              "Cancelled",
              null
            ],
            "description": "Where the request stands. A caregiver's key creates `Pending` requests and can only change its own pending request to `Cancelled`; approving and denying is for office staff.",
            "example": "Pending"
          },
          "adminResponse": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "The office's reply. Set by office staff.",
            "example": null
          }
        }
      },
      "VisitRequestUpdate": {
        "type": "object",
        "description": "Fields to change on a visit request. Send only the fields to change; any other field is refused with `unknown_field`. `caregiverId` is set when the visit request is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient the caregiver would visit.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "patientName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Patient's display name.",
            "example": "Eleanor Vance"
          },
          "preferredStartDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First date the caregiver could start.",
            "example": "2026-10-10"
          },
          "preferredEndDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last date of the request.",
            "example": "2026-10-31"
          },
          "preferredTimeOfDay": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Time of day the caregiver prefers.",
            "example": "Mornings"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the caregiver is asking.",
            "example": "I live nearby and have open mornings."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Pending",
              "Approved",
              "Denied",
              "Cancelled",
              null
            ],
            "description": "Where the request stands. A caregiver's key creates `Pending` requests and can only change its own pending request to `Cancelled`; approving and denying is for office staff.",
            "example": "Pending"
          },
          "adminResponse": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "The office's reply. Set by office staff.",
            "example": null
          }
        },
        "minProperties": 1
      },
      "VisitRequestDeleted": {
        "type": "object",
        "description": "Confirmation that a visit request was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "visit_request"
            ],
            "description": "Always `visit_request`.",
            "example": "visit_request"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted visit request.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "OpenShift": {
        "type": "object",
        "description": "Open shifts are unassigned visits offered to caregivers so one of them can claim it. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "visitId",
          "broadcastDate",
          "status",
          "acceptedBy",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "open_shift"
            ],
            "description": "String representing the object's type. Always `open_shift`.",
            "example": "open_shift",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the open shift.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The unassigned visit being offered.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "broadcastDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the shift was offered.",
            "example": "2026-10-05T13:00:00.000Z"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Filled",
              "Cancelled",
              null
            ],
            "description": "Whether the offer is still open.",
            "example": "Active"
          },
          "acceptedBy": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver who claimed the shift.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the open shift was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the open shift was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "OpenShiftList": {
        "type": "object",
        "description": "A page of open shifts.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OpenShift"
            },
            "description": "The open shifts on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "OpenShiftCreate": {
        "type": "object",
        "description": "Fields for a new open shift. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "visitId": {
            "type": "string",
            "maxLength": 64,
            "description": "The unassigned visit being offered.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "broadcastDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the shift was offered.",
            "example": "2026-10-05T13:00:00.000Z"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Filled",
              "Cancelled",
              null
            ],
            "description": "Whether the offer is still open.",
            "example": "Active"
          }
        },
        "required": [
          "visitId"
        ]
      },
      "OpenShiftUpdate": {
        "type": "object",
        "description": "Fields to change on an open shift. Send only the fields to change; any other field is refused with `unknown_field`. `visitId` is set when the open shift is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "broadcastDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the shift was offered.",
            "example": "2026-10-05T13:00:00.000Z"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Filled",
              "Cancelled",
              null
            ],
            "description": "Whether the offer is still open.",
            "example": "Active"
          }
        },
        "minProperties": 1
      },
      "OpenShiftDeleted": {
        "type": "object",
        "description": "Confirmation that an open shift was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "open_shift"
            ],
            "description": "Always `open_shift`.",
            "example": "open_shift"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted open shift.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "ShiftSwap": {
        "type": "object",
        "description": "Requests from one caregiver to hand a visit to another, which the other caregiver and then the office approve. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "visitId",
          "requestingCaregiverId",
          "requestingCaregiverName",
          "targetCaregiverId",
          "targetCaregiverName",
          "reason",
          "status",
          "requestDate",
          "responseDate",
          "adminResponseDate",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "shift_swap"
            ],
            "description": "String representing the object's type. Always `shift_swap`.",
            "example": "shift_swap",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the shift swap.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit to hand over.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "requestingCaregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver giving up the visit. With a caregiver's API key this is always that caregiver (leave it out), and the visit must be assigned to them; office staff must send it.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "requestingCaregiverName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Display name of the requesting caregiver, taken from the caregiver's record.",
            "example": "Maria Santos",
            "readOnly": true
          },
          "targetCaregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver asked to take the visit.",
            "example": "8a1f5c3e-2b7d-4e90-b6c4-3d9e1a7f2c58"
          },
          "targetCaregiverName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Display name of the target caregiver.",
            "example": "Marcus Reed"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the swap is requested.",
            "example": "Family appointment that afternoon."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Pending",
              "Accepted",
              "Declined",
              "Cancelled",
              "AdminApproved",
              "AdminDenied",
              null
            ],
            "description": "Where the swap stands. With a caregiver's key: new swaps are `Pending`; the asked caregiver changes a `Pending` swap to `Accepted` or `Declined`; the requesting caregiver can change it to `Cancelled`. `AdminApproved` and `AdminDenied` are for office staff.",
            "example": "Pending"
          },
          "requestDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the swap was requested.",
            "example": "2026-10-05T12:00:00.000Z"
          },
          "responseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the target caregiver answered.",
            "example": null,
            "readOnly": true
          },
          "adminResponseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the office answered.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the shift swap was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the shift swap was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "ShiftSwapList": {
        "type": "object",
        "description": "A page of shift swaps.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShiftSwap"
            },
            "description": "The shift swaps on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "ShiftSwapCreate": {
        "type": "object",
        "description": "Fields for a new shift swap. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "visitId": {
            "type": "string",
            "maxLength": 64,
            "description": "The visit to hand over.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "requestingCaregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver giving up the visit. With a caregiver's API key this is always that caregiver (leave it out), and the visit must be assigned to them; office staff must send it.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "targetCaregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver asked to take the visit.",
            "example": "8a1f5c3e-2b7d-4e90-b6c4-3d9e1a7f2c58"
          },
          "targetCaregiverName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Display name of the target caregiver.",
            "example": "Marcus Reed"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the swap is requested.",
            "example": "Family appointment that afternoon."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Pending",
              "Accepted",
              "Declined",
              "Cancelled",
              "AdminApproved",
              "AdminDenied",
              null
            ],
            "description": "Where the swap stands. With a caregiver's key: new swaps are `Pending`; the asked caregiver changes a `Pending` swap to `Accepted` or `Declined`; the requesting caregiver can change it to `Cancelled`. `AdminApproved` and `AdminDenied` are for office staff.",
            "example": "Pending"
          },
          "requestDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the swap was requested.",
            "example": "2026-10-05T12:00:00.000Z"
          }
        },
        "required": [
          "visitId"
        ]
      },
      "ShiftSwapUpdate": {
        "type": "object",
        "description": "Fields to change on a shift swap. Send only the fields to change; any other field is refused with `unknown_field`. `visitId`, `requestingCaregiverId` are set when the shift swap is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "targetCaregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver asked to take the visit.",
            "example": "8a1f5c3e-2b7d-4e90-b6c4-3d9e1a7f2c58"
          },
          "targetCaregiverName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Display name of the target caregiver.",
            "example": "Marcus Reed"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the swap is requested.",
            "example": "Family appointment that afternoon."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Pending",
              "Accepted",
              "Declined",
              "Cancelled",
              "AdminApproved",
              "AdminDenied",
              null
            ],
            "description": "Where the swap stands. With a caregiver's key: new swaps are `Pending`; the asked caregiver changes a `Pending` swap to `Accepted` or `Declined`; the requesting caregiver can change it to `Cancelled`. `AdminApproved` and `AdminDenied` are for office staff.",
            "example": "Pending"
          },
          "requestDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the swap was requested.",
            "example": "2026-10-05T12:00:00.000Z"
          }
        },
        "minProperties": 1
      },
      "ShiftSwapDeleted": {
        "type": "object",
        "description": "Confirmation that a shift swap was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "shift_swap"
            ],
            "description": "Always `shift_swap`.",
            "example": "shift_swap"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted shift swap.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "CarePlan": {
        "type": "object",
        "description": "Care plans describe the services a patient receives, how often, and when the plan is next reviewed. The plan's goals and task lists are managed in AveeCare and are not included here. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "title",
          "status",
          "serviceType",
          "frequency",
          "startDate",
          "endDate",
          "reviewDate",
          "reviewIntervalDays",
          "lastReviewedAt",
          "lastReviewedByName",
          "createdByName",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "care_plan"
            ],
            "description": "String representing the object's type. Always `care_plan`.",
            "example": "care_plan",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the care plan.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient the plan is for.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Plan title.",
            "example": "Personal care plan 2026"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Draft",
              "Archived",
              "UnderReview",
              "Completed",
              "Discontinued",
              null
            ],
            "description": "Where the plan is in its lifecycle.",
            "example": "Active"
          },
          "serviceType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Type of service the plan covers.",
            "example": "Personal care"
          },
          "frequency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "How often visits happen under the plan.",
            "example": "3 times a week, 4 hours"
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the plan takes effect.",
            "example": "2026-10-01"
          },
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the plan ends; `null` if open-ended.",
            "example": null
          },
          "reviewDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the plan is next due for review.",
            "example": "2027-01-01"
          },
          "reviewIntervalDays": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Days between reviews.",
            "example": 90
          },
          "lastReviewedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the plan was last reviewed.",
            "example": "2026-10-01T18:00:00.000Z",
            "readOnly": true
          },
          "lastReviewedByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Who last reviewed the plan.",
            "example": "Jordan Lee, RN",
            "readOnly": true
          },
          "createdByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Who created the plan.",
            "example": "Jordan Lee, RN",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the care plan was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the care plan was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "CarePlanList": {
        "type": "object",
        "description": "A page of care plans.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CarePlan"
            },
            "description": "The care plans on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "CarePlanCreate": {
        "type": "object",
        "description": "Fields for a new care plan. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "patientId": {
            "type": "string",
            "maxLength": 64,
            "description": "The patient the plan is for.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Plan title.",
            "example": "Personal care plan 2026"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Draft",
              "Archived",
              "UnderReview",
              "Completed",
              "Discontinued",
              null
            ],
            "description": "Where the plan is in its lifecycle.",
            "example": "Active"
          },
          "serviceType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Type of service the plan covers.",
            "example": "Personal care"
          },
          "frequency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "How often visits happen under the plan.",
            "example": "3 times a week, 4 hours"
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the plan takes effect.",
            "example": "2026-10-01"
          },
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the plan ends; `null` if open-ended.",
            "example": null
          },
          "reviewDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the plan is next due for review.",
            "example": "2027-01-01"
          },
          "reviewIntervalDays": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Days between reviews.",
            "example": 90
          }
        },
        "required": [
          "patientId",
          "title"
        ]
      },
      "CarePlanUpdate": {
        "type": "object",
        "description": "Fields to change on a care plan. Send only the fields to change; any other field is refused with `unknown_field`. `patientId` is set when the care plan is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Plan title.",
            "example": "Personal care plan 2026"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Draft",
              "Archived",
              "UnderReview",
              "Completed",
              "Discontinued",
              null
            ],
            "description": "Where the plan is in its lifecycle.",
            "example": "Active"
          },
          "serviceType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Type of service the plan covers.",
            "example": "Personal care"
          },
          "frequency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "How often visits happen under the plan.",
            "example": "3 times a week, 4 hours"
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the plan takes effect.",
            "example": "2026-10-01"
          },
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the plan ends; `null` if open-ended.",
            "example": null
          },
          "reviewDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date the plan is next due for review.",
            "example": "2027-01-01"
          },
          "reviewIntervalDays": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Days between reviews.",
            "example": 90
          }
        },
        "minProperties": 1
      },
      "CarePlanDeleted": {
        "type": "object",
        "description": "Confirmation that a care plan was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "care_plan"
            ],
            "description": "Always `care_plan`.",
            "example": "care_plan"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted care plan.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "ProgressNote": {
        "type": "object",
        "description": "Progress notes are the clinical summaries caregivers write after a visit. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "visitId",
          "patientId",
          "caregiverId",
          "caregiverName",
          "summary",
          "aiGenerated",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "progress_note"
            ],
            "description": "String representing the object's type. Always `progress_note`.",
            "example": "progress_note",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the progress note.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit the note documents.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver who wrote the note. With a caregiver's API key this is always that caregiver (leave it out), and the visit must be assigned to them.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "caregiverName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Display name of the caregiver, taken from the caregiver's record.",
            "example": "Maria Santos",
            "readOnly": true
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "The written summary of the visit.",
            "example": "Assisted with shower and dressing. Patient walked 15 minutes with walker; no falls."
          },
          "aiGenerated": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the summary was drafted with AI assistance.",
            "example": false,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the progress note was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the progress note was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "ProgressNoteList": {
        "type": "object",
        "description": "A page of progress notes.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProgressNote"
            },
            "description": "The progress notes on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "ProgressNoteCreate": {
        "type": "object",
        "description": "Fields for a new progress note. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "visitId": {
            "type": "string",
            "maxLength": 64,
            "description": "The visit the note documents.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "patientId": {
            "type": "string",
            "maxLength": 64,
            "description": "The patient.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver who wrote the note. With a caregiver's API key this is always that caregiver (leave it out), and the visit must be assigned to them.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "summary": {
            "type": "string",
            "maxLength": 20000,
            "description": "The written summary of the visit.",
            "example": "Assisted with shower and dressing. Patient walked 15 minutes with walker; no falls."
          }
        },
        "required": [
          "visitId",
          "patientId",
          "summary"
        ]
      },
      "ProgressNoteUpdate": {
        "type": "object",
        "description": "Fields to change on a progress note. Send only the fields to change; any other field is refused with `unknown_field`. `visitId`, `patientId`, `caregiverId` are set when the progress note is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "summary": {
            "type": "string",
            "maxLength": 20000,
            "description": "The written summary of the visit.",
            "example": "Assisted with shower and dressing. Patient walked 15 minutes with walker; no falls."
          }
        },
        "minProperties": 1
      },
      "ProgressNoteDeleted": {
        "type": "object",
        "description": "Confirmation that a progress note was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "progress_note"
            ],
            "description": "Always `progress_note`.",
            "example": "progress_note"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted progress note.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Authorization": {
        "type": "object",
        "description": "Payer authorizations: how many units of a service a payer has approved for a patient, and over what dates. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "payerName",
          "authorizationNumber",
          "serviceType",
          "procedureCode",
          "modifiers",
          "startDate",
          "endDate",
          "authorizedUnits",
          "unitType",
          "unitBasis",
          "minutesPerUnit",
          "usedUnits",
          "remainingUnits",
          "frequency",
          "placeOfService",
          "status",
          "notes",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "authorization"
            ],
            "description": "String representing the object's type. Always `authorization`.",
            "example": "authorization",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the authorization.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient the authorization covers.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "payerName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The payer that issued it.",
            "example": "Mercy Care"
          },
          "authorizationNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The payer's authorization number.",
            "example": "PA-2026-118842"
          },
          "serviceType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Service authorized.",
            "example": "Attendant care"
          },
          "procedureCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Procedure (HCPCS) code billed against it.",
            "example": "S5125"
          },
          "modifiers": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Procedure code modifiers, comma separated.",
            "example": "U1"
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First date the authorization covers.",
            "example": "2026-10-01"
          },
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last date the authorization covers.",
            "example": "2026-12-31"
          },
          "authorizedUnits": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Units approved.",
            "example": 480
          },
          "unitType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "What a unit is, in the payer's words.",
            "example": "15 minutes"
          },
          "unitBasis": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Time",
              "Visits",
              "Days",
              null
            ],
            "description": "Whether units count time, visits or days.",
            "example": "Time"
          },
          "minutesPerUnit": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "For time-based units, minutes in one unit.",
            "example": 15
          },
          "usedUnits": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Units used so far.",
            "example": 96,
            "readOnly": true
          },
          "remainingUnits": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Units left.",
            "example": 384,
            "readOnly": true
          },
          "frequency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Frequency the payer approved.",
            "example": "20 hours per week"
          },
          "placeOfService": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "description": "Place-of-service code.",
            "example": "12"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Expired",
              "PendingRenewal",
              null
            ],
            "description": "Whether the authorization is in effect.",
            "example": "Active"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the authorization was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the authorization was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "AuthorizationList": {
        "type": "object",
        "description": "A page of authorizations.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Authorization"
            },
            "description": "The authorizations on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "AuthorizationCreate": {
        "type": "object",
        "description": "Fields for a new authorization. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "patientId": {
            "type": "string",
            "maxLength": 64,
            "description": "The patient the authorization covers.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "payerName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The payer that issued it.",
            "example": "Mercy Care"
          },
          "authorizationNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The payer's authorization number.",
            "example": "PA-2026-118842"
          },
          "serviceType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Service authorized.",
            "example": "Attendant care"
          },
          "procedureCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Procedure (HCPCS) code billed against it.",
            "example": "S5125"
          },
          "modifiers": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Procedure code modifiers, comma separated.",
            "example": "U1"
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First date the authorization covers.",
            "example": "2026-10-01"
          },
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last date the authorization covers.",
            "example": "2026-12-31"
          },
          "authorizedUnits": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Units approved.",
            "example": 480
          },
          "unitType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "What a unit is, in the payer's words.",
            "example": "15 minutes"
          },
          "unitBasis": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Time",
              "Visits",
              "Days",
              null
            ],
            "description": "Whether units count time, visits or days.",
            "example": "Time"
          },
          "minutesPerUnit": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "For time-based units, minutes in one unit.",
            "example": 15
          },
          "frequency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Frequency the payer approved.",
            "example": "20 hours per week"
          },
          "placeOfService": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "description": "Place-of-service code.",
            "example": "12"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Expired",
              "PendingRenewal",
              null
            ],
            "description": "Whether the authorization is in effect.",
            "example": "Active"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null
          }
        },
        "required": [
          "patientId"
        ]
      },
      "AuthorizationUpdate": {
        "type": "object",
        "description": "Fields to change on an authorization. Send only the fields to change; any other field is refused with `unknown_field`. `patientId` is set when the authorization is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "payerName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The payer that issued it.",
            "example": "Mercy Care"
          },
          "authorizationNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The payer's authorization number.",
            "example": "PA-2026-118842"
          },
          "serviceType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Service authorized.",
            "example": "Attendant care"
          },
          "procedureCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Procedure (HCPCS) code billed against it.",
            "example": "S5125"
          },
          "modifiers": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "Procedure code modifiers, comma separated.",
            "example": "U1"
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First date the authorization covers.",
            "example": "2026-10-01"
          },
          "endDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last date the authorization covers.",
            "example": "2026-12-31"
          },
          "authorizedUnits": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Units approved.",
            "example": 480
          },
          "unitType": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "What a unit is, in the payer's words.",
            "example": "15 minutes"
          },
          "unitBasis": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Time",
              "Visits",
              "Days",
              null
            ],
            "description": "Whether units count time, visits or days.",
            "example": "Time"
          },
          "minutesPerUnit": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "For time-based units, minutes in one unit.",
            "example": 15
          },
          "frequency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Frequency the payer approved.",
            "example": "20 hours per week"
          },
          "placeOfService": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10,
            "description": "Place-of-service code.",
            "example": "12"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Active",
              "Expired",
              "PendingRenewal",
              null
            ],
            "description": "Whether the authorization is in effect.",
            "example": "Active"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null
          }
        },
        "minProperties": 1
      },
      "AuthorizationDeleted": {
        "type": "object",
        "description": "Confirmation that an authorization was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "authorization"
            ],
            "description": "Always `authorization`.",
            "example": "authorization"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted authorization.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Incident": {
        "type": "object",
        "description": "Incident reports: falls, injuries, medication errors and other events that need follow-up, often for regulatory reporting. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "title",
          "description",
          "incidentDateTime",
          "category",
          "severity",
          "status",
          "patientId",
          "caregiverId",
          "visitId",
          "actionsTaken",
          "injuryBodyPart",
          "witnessName",
          "emergencyServicesContacted",
          "hospitalTransport",
          "hospitalName",
          "physicianNotified",
          "familyNotified",
          "regulatoryReportRequired",
          "followUpRequired",
          "followUpDueAt",
          "followUpNotes",
          "resolved",
          "resolutionNotes",
          "isConfidential",
          "reportedByName",
          "reportedAt",
          "resolvedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "incident"
            ],
            "description": "String representing the object's type. Always `incident`.",
            "example": "incident",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the incident.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Short summary.",
            "example": "Fall in bathroom"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What happened.",
            "example": "Patient slipped stepping out of the shower; caregiver assisted to a chair."
          },
          "incidentDateTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the incident happened.",
            "example": "2026-10-04T16:20:00.000Z"
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Fall",
              "Medication",
              "Behavioral",
              "Injury",
              "Equipment",
              "Attendance",
              "Conduct",
              "Other",
              null
            ],
            "description": "Kind of incident.",
            "example": "Fall"
          },
          "severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical",
              null
            ],
            "description": "How serious it was.",
            "example": "Medium"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Open",
              "Monitoring",
              "AwaitingFollowUp",
              "Resolved",
              "Closed",
              null
            ],
            "description": "Where follow-up stands. New incidents start `Open`.",
            "example": "Open"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient involved.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver involved.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit during which it happened.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "actionsTaken": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What was done at the time.",
            "example": "Checked for injury, called the office, notified daughter."
          },
          "injuryBodyPart": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Body part injured, if any.",
            "example": "Left wrist"
          },
          "witnessName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Witness, if any.",
            "example": null
          },
          "emergencyServicesContacted": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether 911 or other emergency services were called.",
            "example": false
          },
          "hospitalTransport": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient went to hospital.",
            "example": false
          },
          "hospitalName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Hospital, if transported.",
            "example": null
          },
          "physicianNotified": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient's physician was told.",
            "example": true
          },
          "familyNotified": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether family was told.",
            "example": true
          },
          "regulatoryReportRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the incident must be reported to a regulator.",
            "example": false
          },
          "followUpRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether follow-up is needed.",
            "example": true
          },
          "followUpDueAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When follow-up is due.",
            "example": "2026-10-06T16:00:00.000Z"
          },
          "followUpNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Follow-up notes.",
            "example": null
          },
          "resolved": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the incident is resolved.",
            "example": false
          },
          "resolutionNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "How it was resolved.",
            "example": null
          },
          "isConfidential": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether only administrators can see it.",
            "example": false
          },
          "reportedByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Who reported it.",
            "example": "Maria Santos",
            "readOnly": true
          },
          "reportedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was reported.",
            "example": "2026-10-04T16:45:00.000Z",
            "readOnly": true
          },
          "resolvedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was resolved.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the incident was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the incident was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "IncidentList": {
        "type": "object",
        "description": "A page of incidents.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Incident"
            },
            "description": "The incidents on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "IncidentCreate": {
        "type": "object",
        "description": "Fields for a new incident. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Short summary.",
            "example": "Fall in bathroom"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What happened.",
            "example": "Patient slipped stepping out of the shower; caregiver assisted to a chair."
          },
          "incidentDateTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the incident happened.",
            "example": "2026-10-04T16:20:00.000Z"
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Fall",
              "Medication",
              "Behavioral",
              "Injury",
              "Equipment",
              "Attendance",
              "Conduct",
              "Other",
              null
            ],
            "description": "Kind of incident.",
            "example": "Fall"
          },
          "severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical",
              null
            ],
            "description": "How serious it was.",
            "example": "Medium"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Open",
              "Monitoring",
              "AwaitingFollowUp",
              "Resolved",
              "Closed",
              null
            ],
            "description": "Where follow-up stands. New incidents start `Open`. Only keys belonging to office staff can set this.",
            "example": "Open"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient involved.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver involved.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit during which it happened.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "actionsTaken": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What was done at the time.",
            "example": "Checked for injury, called the office, notified daughter."
          },
          "injuryBodyPart": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Body part injured, if any.",
            "example": "Left wrist"
          },
          "witnessName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Witness, if any.",
            "example": null
          },
          "emergencyServicesContacted": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether 911 or other emergency services were called.",
            "example": false
          },
          "hospitalTransport": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient went to hospital.",
            "example": false
          },
          "hospitalName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Hospital, if transported.",
            "example": null
          },
          "physicianNotified": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient's physician was told.",
            "example": true
          },
          "familyNotified": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether family was told.",
            "example": true
          },
          "regulatoryReportRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the incident must be reported to a regulator.",
            "example": false
          },
          "followUpRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether follow-up is needed.",
            "example": true
          },
          "followUpDueAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When follow-up is due. Only keys belonging to office staff can set this.",
            "example": "2026-10-06T16:00:00.000Z"
          },
          "followUpNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Follow-up notes.",
            "example": null
          },
          "resolved": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the incident is resolved. Only keys belonging to office staff can set this.",
            "example": false
          },
          "resolutionNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "How it was resolved. Only keys belonging to office staff can set this.",
            "example": null
          },
          "isConfidential": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether only administrators can see it. Only keys belonging to office staff can set this.",
            "example": false
          }
        },
        "required": [
          "title"
        ]
      },
      "IncidentUpdate": {
        "type": "object",
        "description": "Fields to change on an incident. Send only the fields to change; any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Short summary.",
            "example": "Fall in bathroom"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What happened.",
            "example": "Patient slipped stepping out of the shower; caregiver assisted to a chair."
          },
          "incidentDateTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the incident happened.",
            "example": "2026-10-04T16:20:00.000Z"
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Fall",
              "Medication",
              "Behavioral",
              "Injury",
              "Equipment",
              "Attendance",
              "Conduct",
              "Other",
              null
            ],
            "description": "Kind of incident.",
            "example": "Fall"
          },
          "severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical",
              null
            ],
            "description": "How serious it was.",
            "example": "Medium"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Open",
              "Monitoring",
              "AwaitingFollowUp",
              "Resolved",
              "Closed",
              null
            ],
            "description": "Where follow-up stands. New incidents start `Open`. Only keys belonging to office staff can set this.",
            "example": "Open"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient involved.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver involved.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit during which it happened.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "actionsTaken": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What was done at the time.",
            "example": "Checked for injury, called the office, notified daughter."
          },
          "injuryBodyPart": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Body part injured, if any.",
            "example": "Left wrist"
          },
          "witnessName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Witness, if any.",
            "example": null
          },
          "emergencyServicesContacted": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether 911 or other emergency services were called.",
            "example": false
          },
          "hospitalTransport": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient went to hospital.",
            "example": false
          },
          "hospitalName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Hospital, if transported.",
            "example": null
          },
          "physicianNotified": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the patient's physician was told.",
            "example": true
          },
          "familyNotified": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether family was told.",
            "example": true
          },
          "regulatoryReportRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the incident must be reported to a regulator.",
            "example": false
          },
          "followUpRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether follow-up is needed.",
            "example": true
          },
          "followUpDueAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When follow-up is due. Only keys belonging to office staff can set this.",
            "example": "2026-10-06T16:00:00.000Z"
          },
          "followUpNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Follow-up notes.",
            "example": null
          },
          "resolved": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the incident is resolved. Only keys belonging to office staff can set this.",
            "example": false
          },
          "resolutionNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "How it was resolved. Only keys belonging to office staff can set this.",
            "example": null
          },
          "isConfidential": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether only administrators can see it. Only keys belonging to office staff can set this.",
            "example": false
          }
        },
        "minProperties": 1
      },
      "IncidentDeleted": {
        "type": "object",
        "description": "Confirmation that an incident was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "incident"
            ],
            "description": "Always `incident`.",
            "example": "incident"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted incident.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Event": {
        "type": "object",
        "description": "Events your agency documents about a patient, caregiver or visit, such as a complaint, a compliment or an attendance issue. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "title",
          "description",
          "category",
          "severity",
          "status",
          "occurredAt",
          "patientId",
          "caregiverId",
          "visitId",
          "pointValue",
          "actionsTaken",
          "outcome",
          "followUpRequired",
          "followUpDueAt",
          "followUpNotes",
          "resolutionNotes",
          "isConfidential",
          "reportedByName",
          "reportedAt",
          "resolvedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "event"
            ],
            "description": "String representing the object's type. Always `event`.",
            "example": "event",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the event.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Short summary.",
            "example": "Late arrival"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What happened.",
            "example": "Caregiver arrived 40 minutes late without calling ahead."
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Category, as named in your agency's event types.",
            "example": "Attendance"
          },
          "severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical",
              null
            ],
            "description": "How serious it was.",
            "example": "Low"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Open",
              "Monitoring",
              "AwaitingFollowUp",
              "Resolved",
              "Closed",
              null
            ],
            "description": "Where follow-up stands.",
            "example": "Open"
          },
          "occurredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it happened.",
            "example": "2026-10-03T14:40:00.000Z"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient involved.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver involved.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit involved.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "pointValue": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Attendance points this event counts for, if your agency uses a points policy.",
            "example": 1
          },
          "actionsTaken": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What was done.",
            "example": "Discussed with caregiver."
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Outcome.",
            "example": null
          },
          "followUpRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether follow-up is needed.",
            "example": false
          },
          "followUpDueAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When follow-up is due.",
            "example": null
          },
          "followUpNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Follow-up notes.",
            "example": null
          },
          "resolutionNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "How it was resolved.",
            "example": null
          },
          "isConfidential": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether only administrators can see it.",
            "example": false
          },
          "reportedByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Who documented it.",
            "example": "Alice Smith",
            "readOnly": true
          },
          "reportedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was documented.",
            "example": "2026-10-03T15:00:00.000Z",
            "readOnly": true
          },
          "resolvedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was resolved.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the event was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the event was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "EventList": {
        "type": "object",
        "description": "A page of events.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "description": "The events on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "EventCreate": {
        "type": "object",
        "description": "Fields for a new event. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Short summary.",
            "example": "Late arrival"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What happened.",
            "example": "Caregiver arrived 40 minutes late without calling ahead."
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Category, as named in your agency's event types.",
            "example": "Attendance"
          },
          "severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical",
              null
            ],
            "description": "How serious it was.",
            "example": "Low"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Open",
              "Monitoring",
              "AwaitingFollowUp",
              "Resolved",
              "Closed",
              null
            ],
            "description": "Where follow-up stands.",
            "example": "Open"
          },
          "occurredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it happened.",
            "example": "2026-10-03T14:40:00.000Z"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient involved.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver involved.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit involved.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "pointValue": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Attendance points this event counts for, if your agency uses a points policy.",
            "example": 1
          },
          "actionsTaken": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What was done.",
            "example": "Discussed with caregiver."
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Outcome.",
            "example": null
          },
          "followUpRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether follow-up is needed.",
            "example": false
          },
          "followUpDueAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When follow-up is due.",
            "example": null
          },
          "followUpNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Follow-up notes.",
            "example": null
          },
          "resolutionNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "How it was resolved.",
            "example": null
          },
          "isConfidential": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether only administrators can see it.",
            "example": false
          }
        },
        "required": [
          "title"
        ]
      },
      "EventUpdate": {
        "type": "object",
        "description": "Fields to change on an event. Send only the fields to change; any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Short summary.",
            "example": "Late arrival"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What happened.",
            "example": "Caregiver arrived 40 minutes late without calling ahead."
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Category, as named in your agency's event types.",
            "example": "Attendance"
          },
          "severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical",
              null
            ],
            "description": "How serious it was.",
            "example": "Low"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Open",
              "Monitoring",
              "AwaitingFollowUp",
              "Resolved",
              "Closed",
              null
            ],
            "description": "Where follow-up stands.",
            "example": "Open"
          },
          "occurredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it happened.",
            "example": "2026-10-03T14:40:00.000Z"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient involved.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3"
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver involved.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43"
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit involved.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
          },
          "pointValue": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Attendance points this event counts for, if your agency uses a points policy.",
            "example": 1
          },
          "actionsTaken": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "What was done.",
            "example": "Discussed with caregiver."
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Outcome.",
            "example": null
          },
          "followUpRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether follow-up is needed.",
            "example": false
          },
          "followUpDueAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When follow-up is due.",
            "example": null
          },
          "followUpNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Follow-up notes.",
            "example": null
          },
          "resolutionNotes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "How it was resolved.",
            "example": null
          },
          "isConfidential": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether only administrators can see it.",
            "example": false
          }
        },
        "minProperties": 1
      },
      "EventDeleted": {
        "type": "object",
        "description": "Confirmation that an event was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "event"
            ],
            "description": "Always `event`.",
            "example": "event"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted event.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "ReferralSource": {
        "type": "object",
        "description": "Hospitals, physicians, case managers and other organizations that refer clients to your agency. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "name",
          "type",
          "organization",
          "contactName",
          "contactTitle",
          "contactPhone",
          "contactEmail",
          "address",
          "city",
          "state",
          "zipCode",
          "notes",
          "isActive",
          "totalReferrals",
          "totalConversions",
          "lastReferralDate",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "referral_source"
            ],
            "description": "String representing the object's type. Always `referral_source`.",
            "example": "referral_source",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the referral source.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Name of the source.",
            "example": "Banner Good Samaritan discharge planning"
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Kind of source, such as Hospital or Physician.",
            "example": "Hospital"
          },
          "organization": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Organization the contact works for.",
            "example": "Banner Health"
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Main contact.",
            "example": "Priya Patel"
          },
          "contactTitle": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Contact's job title.",
            "example": "Discharge planner"
          },
          "contactPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Contact's phone number.",
            "example": "+16025550188"
          },
          "contactEmail": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Contact's email address.",
            "example": "priya.patel@example.com"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Street address.",
            "example": "1111 E McDowell Rd"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85006"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether you still receive referrals from this source.",
            "example": true
          },
          "totalReferrals": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Referrals received from this source.",
            "example": 14,
            "readOnly": true
          },
          "totalConversions": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Referrals from this source that became clients.",
            "example": 9,
            "readOnly": true
          },
          "lastReferralDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the most recent referral arrived.",
            "example": "2026-09-29T19:30:00.000Z",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the referral source was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the referral source was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "ReferralSourceList": {
        "type": "object",
        "description": "A page of referral sources.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReferralSource"
            },
            "description": "The referral sources on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "ReferralSourceCreate": {
        "type": "object",
        "description": "Fields for a new referral source. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Name of the source.",
            "example": "Banner Good Samaritan discharge planning"
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Kind of source, such as Hospital or Physician.",
            "example": "Hospital"
          },
          "organization": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Organization the contact works for.",
            "example": "Banner Health"
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Main contact.",
            "example": "Priya Patel"
          },
          "contactTitle": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Contact's job title.",
            "example": "Discharge planner"
          },
          "contactPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Contact's phone number.",
            "example": "+16025550188"
          },
          "contactEmail": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Contact's email address.",
            "example": "priya.patel@example.com"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Street address.",
            "example": "1111 E McDowell Rd"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85006"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether you still receive referrals from this source.",
            "example": true
          }
        },
        "required": [
          "name"
        ]
      },
      "ReferralSourceUpdate": {
        "type": "object",
        "description": "Fields to change on a referral source. Send only the fields to change; any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Name of the source.",
            "example": "Banner Good Samaritan discharge planning"
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Kind of source, such as Hospital or Physician.",
            "example": "Hospital"
          },
          "organization": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Organization the contact works for.",
            "example": "Banner Health"
          },
          "contactName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Main contact.",
            "example": "Priya Patel"
          },
          "contactTitle": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Contact's job title.",
            "example": "Discharge planner"
          },
          "contactPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Contact's phone number.",
            "example": "+16025550188"
          },
          "contactEmail": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Contact's email address.",
            "example": "priya.patel@example.com"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Street address.",
            "example": "1111 E McDowell Rd"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85006"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether you still receive referrals from this source.",
            "example": true
          }
        },
        "minProperties": 1
      },
      "ReferralSourceDeleted": {
        "type": "object",
        "description": "Confirmation that a referral source was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "referral_source"
            ],
            "description": "Always `referral_source`.",
            "example": "referral_source"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted referral source.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Referral": {
        "type": "object",
        "description": "Individual referrals of a prospective client, tracked from first contact to admission. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "referralSourceId",
          "patientId",
          "patientName",
          "contactPhone",
          "contactEmail",
          "referralDate",
          "status",
          "estimatedCareNeeds",
          "estimatedWeeklyHours",
          "urgencyLevel",
          "declineReason",
          "notes",
          "convertedDate",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "referral"
            ],
            "description": "String representing the object's type. Always `referral`.",
            "example": "referral",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the referral.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "referralSourceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "Who made the referral.",
            "example": "9c3a1e7d-4b2f-4d86-a0c5-1e8f6b3d2a97"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient record, once one exists.",
            "example": null
          },
          "patientName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Name of the person referred.",
            "example": "Harold Finch"
          },
          "contactPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number to reach the person or their family.",
            "example": "+16025550164"
          },
          "contactEmail": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address to reach the person or their family.",
            "example": null
          },
          "referralDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the referral arrived.",
            "example": "2026-10-02T17:10:00.000Z"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "New",
              "Contacted",
              "AssessmentScheduled",
              "AssessmentCompleted",
              "ServiceAgreementSent",
              "Admitted",
              "Declined",
              "Lost",
              null
            ],
            "description": "Where the referral stands.",
            "example": "Contacted"
          },
          "estimatedCareNeeds": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Care the person is expected to need.",
            "example": "Help with bathing and meals after hip surgery."
          },
          "estimatedWeeklyHours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Expected hours of care per week.",
            "example": 20
          },
          "urgencyLevel": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "How soon care is needed.",
            "example": "High"
          },
          "declineReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the referral was declined or lost.",
            "example": null
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null
          },
          "convertedDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the person was admitted as a client.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the referral was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the referral was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "ReferralList": {
        "type": "object",
        "description": "A page of referrals.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Referral"
            },
            "description": "The referrals on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "ReferralCreate": {
        "type": "object",
        "description": "Fields for a new referral. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "referralSourceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "Who made the referral.",
            "example": "9c3a1e7d-4b2f-4d86-a0c5-1e8f6b3d2a97"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient record, once one exists.",
            "example": null
          },
          "patientName": {
            "type": "string",
            "maxLength": 200,
            "description": "Name of the person referred.",
            "example": "Harold Finch"
          },
          "contactPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number to reach the person or their family.",
            "example": "+16025550164"
          },
          "contactEmail": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address to reach the person or their family.",
            "example": null
          },
          "referralDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the referral arrived.",
            "example": "2026-10-02T17:10:00.000Z"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "New",
              "Contacted",
              "AssessmentScheduled",
              "AssessmentCompleted",
              "ServiceAgreementSent",
              "Admitted",
              "Declined",
              "Lost",
              null
            ],
            "description": "Where the referral stands.",
            "example": "Contacted"
          },
          "estimatedCareNeeds": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Care the person is expected to need.",
            "example": "Help with bathing and meals after hip surgery."
          },
          "estimatedWeeklyHours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Expected hours of care per week.",
            "example": 20
          },
          "urgencyLevel": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "How soon care is needed.",
            "example": "High"
          },
          "declineReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the referral was declined or lost.",
            "example": null
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null
          }
        },
        "required": [
          "patientName"
        ]
      },
      "ReferralUpdate": {
        "type": "object",
        "description": "Fields to change on a referral. Send only the fields to change; any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "referralSourceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "Who made the referral.",
            "example": "9c3a1e7d-4b2f-4d86-a0c5-1e8f6b3d2a97"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient record, once one exists.",
            "example": null
          },
          "patientName": {
            "type": "string",
            "maxLength": 200,
            "description": "Name of the person referred.",
            "example": "Harold Finch"
          },
          "contactPhone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Phone number to reach the person or their family.",
            "example": "+16025550164"
          },
          "contactEmail": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "maxLength": 320,
            "description": "Email address to reach the person or their family.",
            "example": null
          },
          "referralDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the referral arrived.",
            "example": "2026-10-02T17:10:00.000Z"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "New",
              "Contacted",
              "AssessmentScheduled",
              "AssessmentCompleted",
              "ServiceAgreementSent",
              "Admitted",
              "Declined",
              "Lost",
              null
            ],
            "description": "Where the referral stands.",
            "example": "Contacted"
          },
          "estimatedCareNeeds": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Care the person is expected to need.",
            "example": "Help with bathing and meals after hip surgery."
          },
          "estimatedWeeklyHours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Expected hours of care per week.",
            "example": 20
          },
          "urgencyLevel": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "How soon care is needed.",
            "example": "High"
          },
          "declineReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Why the referral was declined or lost.",
            "example": null
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null
          }
        },
        "minProperties": 1
      },
      "ReferralDeleted": {
        "type": "object",
        "description": "Confirmation that a referral was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "referral"
            ],
            "description": "Always `referral`.",
            "example": "referral"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted referral.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Invoice": {
        "type": "object",
        "description": "Invoices billed to patients and their families for private-pay care. Read-only. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "invoiceNumber",
          "patientId",
          "status",
          "invoiceDate",
          "dueDate",
          "periodStart",
          "periodEnd",
          "description",
          "currency",
          "subtotalCents",
          "taxCents",
          "discountCents",
          "creditAppliedCents",
          "totalCents",
          "amountPaidCents",
          "amountDueCents",
          "visitIds",
          "isAutoBilled",
          "sentAt",
          "paidDate",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "invoice"
            ],
            "description": "String representing the object's type. Always `invoice`.",
            "example": "invoice",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the invoice.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "invoiceNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Invoice number shown to the patient.",
            "example": "INV-01042",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient billed.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3",
            "readOnly": true
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Draft",
              "Pending",
              "Processing",
              "Paid",
              "PartiallyPaid",
              "Overdue",
              "Cancelled",
              "Refunded",
              "Failed",
              null
            ],
            "description": "Payment status.",
            "example": "Pending",
            "readOnly": true
          },
          "invoiceDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of the invoice.",
            "example": "2026-10-01",
            "readOnly": true
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date payment is due.",
            "example": "2026-10-15",
            "readOnly": true
          },
          "periodStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First day of service billed.",
            "example": "2026-09-16",
            "readOnly": true
          },
          "periodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last day of service billed.",
            "example": "2026-09-30",
            "readOnly": true
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Description shown on the invoice.",
            "example": "Home care services, Sept 16-30",
            "readOnly": true
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Three-letter currency code.",
            "example": "USD",
            "readOnly": true
          },
          "subtotalCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total before tax, discounts and credits. In cents.",
            "example": 96000,
            "readOnly": true
          },
          "taxCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Tax. In cents.",
            "example": 0,
            "readOnly": true
          },
          "discountCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Discounts applied. In cents.",
            "example": 0,
            "readOnly": true
          },
          "creditAppliedCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Account credit applied. In cents.",
            "example": 0,
            "readOnly": true
          },
          "totalCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice total. In cents.",
            "example": 96000,
            "readOnly": true
          },
          "amountPaidCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Amount paid so far. In cents.",
            "example": 0,
            "readOnly": true
          },
          "amountDueCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Amount still owed. In cents.",
            "example": 96000,
            "readOnly": true
          },
          "visitIds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Visits billed on this invoice.",
            "example": [
              "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
            ],
            "readOnly": true
          },
          "isAutoBilled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether AveeCare created the invoice automatically when a visit was completed.",
            "example": false,
            "readOnly": true
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the invoice was sent.",
            "example": "2026-10-01T15:00:00.000Z",
            "readOnly": true
          },
          "paidDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the invoice was paid in full.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the invoice was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the invoice was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "InvoiceList": {
        "type": "object",
        "description": "A page of invoices.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invoice"
            },
            "description": "The invoices on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "InvoiceLineItem": {
        "type": "object",
        "description": "The individual charges on an invoice. Read-only. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "invoiceId",
          "description",
          "quantity",
          "unitPriceCents",
          "totalCents",
          "serviceCode",
          "serviceCategory",
          "visitId",
          "visitDate",
          "sortOrder",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "invoice_line_item"
            ],
            "description": "String representing the object's type. Always `invoice_line_item`.",
            "example": "invoice_line_item",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the invoice line item.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "invoiceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The invoice this line belongs to.",
            "example": "7d2f9b4c-1e6a-4c83-9f05-b8a3e2d1c6f7",
            "readOnly": true
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Line description.",
            "example": "Personal care, 4 hours",
            "readOnly": true
          },
          "quantity": {
            "type": [
              "number",
              "null"
            ],
            "description": "Quantity, such as hours.",
            "example": 4,
            "readOnly": true
          },
          "unitPriceCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Price per unit. In cents.",
            "example": 3200,
            "readOnly": true
          },
          "totalCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Line total. In cents.",
            "example": 12800,
            "readOnly": true
          },
          "serviceCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Service code.",
            "example": "S5125",
            "readOnly": true
          },
          "serviceCategory": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Service category.",
            "example": "Personal care",
            "readOnly": true
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit this line bills.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75",
            "readOnly": true
          },
          "visitDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of the visit.",
            "example": "2026-09-18",
            "readOnly": true
          },
          "sortOrder": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Position of the line on the invoice.",
            "example": 1,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the invoice line item was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the invoice line item was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "InvoiceLineItemList": {
        "type": "object",
        "description": "A page of invoice line items.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItem"
            },
            "description": "The invoice line items on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "Claim": {
        "type": "object",
        "description": "Insurance claims billed to Medicaid, Medicare and other payers, with their adjudication status. Read-only. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "patientId",
          "caregiverId",
          "visitId",
          "invoiceId",
          "claimNumber",
          "claimType",
          "payerName",
          "payerId",
          "serviceDateStart",
          "serviceDateEnd",
          "totalChargeAmountCents",
          "status",
          "statusMessage",
          "statusUpdatedAt",
          "paidAmountCents",
          "patientResponsibilityCents",
          "priorAuthNumber",
          "checkNumber",
          "submittedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "claim"
            ],
            "description": "String representing the object's type. Always `claim`.",
            "example": "claim",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the claim.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The patient the claim is for.",
            "example": "3f6c2a9e-8b1d-4e7a-9c55-2d0e7b41a6f3",
            "readOnly": true
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver who provided the service.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43",
            "readOnly": true
          },
          "visitId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The visit billed, for single-visit claims.",
            "example": "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75",
            "readOnly": true
          },
          "invoiceId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The related invoice, if any.",
            "example": null,
            "readOnly": true
          },
          "claimNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Your claim number.",
            "example": "CLM-2026-00381",
            "readOnly": true
          },
          "claimType": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Professional837P",
              "Institutional837I",
              null
            ],
            "description": "Claim format: professional (837P) or institutional (837I).",
            "example": "Professional837P",
            "readOnly": true
          },
          "payerName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "The payer billed.",
            "example": "Mercy Care",
            "readOnly": true
          },
          "payerId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "The payer's electronic payer ID.",
            "example": "86052",
            "readOnly": true
          },
          "serviceDateStart": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "First date of service, as `YYYY-MM-DD`.",
            "example": "2026-09-01",
            "readOnly": true
          },
          "serviceDateEnd": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Last date of service, as `YYYY-MM-DD`.",
            "example": "2026-09-30",
            "readOnly": true
          },
          "totalChargeAmountCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total billed. In cents.",
            "example": 153600,
            "readOnly": true
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Draft",
              "Validated",
              "ValidationFailed",
              "Submitted",
              "Acknowledged",
              "Accepted",
              "Rejected",
              "InAdjudication",
              "Paid",
              "PartiallyPaid",
              "Denied",
              "Appealed",
              "Voided",
              null
            ],
            "description": "Where the claim is in adjudication.",
            "example": "Accepted",
            "readOnly": true
          },
          "statusMessage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Latest status detail from the payer or clearinghouse.",
            "example": null,
            "readOnly": true
          },
          "statusUpdatedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "When the status last changed, ISO 8601.",
            "example": "2026-10-03T12:00:00.000Z",
            "readOnly": true
          },
          "paidAmountCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Amount the payer paid. In cents.",
            "example": null,
            "readOnly": true
          },
          "patientResponsibilityCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Amount the patient owes after the payer. In cents.",
            "example": null,
            "readOnly": true
          },
          "priorAuthNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Authorization number sent on the claim.",
            "example": "PA-2026-118842",
            "readOnly": true
          },
          "checkNumber": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Payment check or EFT trace number.",
            "example": null,
            "readOnly": true
          },
          "submittedAt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "When the claim was submitted, ISO 8601.",
            "example": "2026-10-01T16:30:00.000Z",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the claim was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the claim was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "ClaimList": {
        "type": "object",
        "description": "A page of claims.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Claim"
            },
            "description": "The claims on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "PayrollEntry": {
        "type": "object",
        "description": "One caregiver's hours and pay for one pay period. Read-only. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "caregiverId",
          "payPeriodStart",
          "payPeriodEnd",
          "status",
          "regularHours",
          "overtimeHours",
          "holidayHours",
          "ptoHours",
          "sickLeaveHours",
          "grossPayCents",
          "deductionsCents",
          "netPayCents",
          "mileageCents",
          "visitCount",
          "visitIds",
          "paymentMethod",
          "approvedByName",
          "approvedAt",
          "paidAt",
          "notes",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "payroll_entry"
            ],
            "description": "String representing the object's type. Always `payroll_entry`.",
            "example": "payroll_entry",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the payroll entry.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "caregiverId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver paid.",
            "example": "c4e1a8b2-7d3f-4c69-9b0e-5a2f8d6c1e43",
            "readOnly": true
          },
          "payPeriodStart": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First day of the pay period.",
            "example": "2026-09-16",
            "readOnly": true
          },
          "payPeriodEnd": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last day of the pay period.",
            "example": "2026-09-30",
            "readOnly": true
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Pending",
              "Approved",
              "Processed",
              "Paid",
              "Cancelled",
              "Failed",
              "HoursSubmitted",
              "CheckCreated",
              "PaidConfirmed",
              "PaidExternally",
              "Voided",
              null
            ],
            "description": "Where the entry is in your payroll process.",
            "example": "Approved",
            "readOnly": true
          },
          "regularHours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Regular hours.",
            "example": 72,
            "readOnly": true
          },
          "overtimeHours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Overtime hours.",
            "example": 4.5,
            "readOnly": true
          },
          "holidayHours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Holiday hours.",
            "example": 0,
            "readOnly": true
          },
          "ptoHours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Paid time off hours.",
            "example": 0,
            "readOnly": true
          },
          "sickLeaveHours": {
            "type": [
              "number",
              "null"
            ],
            "description": "Sick leave hours.",
            "example": 0,
            "readOnly": true
          },
          "grossPayCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Gross pay. In cents.",
            "example": 158400,
            "readOnly": true
          },
          "deductionsCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total deductions. In cents.",
            "example": 0,
            "readOnly": true
          },
          "netPayCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Net pay. In cents.",
            "example": 158400,
            "readOnly": true
          },
          "mileageCents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Mileage reimbursement. In cents.",
            "example": 4200,
            "readOnly": true
          },
          "visitCount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Visits in the pay period.",
            "example": 18,
            "readOnly": true
          },
          "visitIds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Visits paid on this entry.",
            "example": [
              "5e8a2c7b-9d1f-4b36-a4e2-6c0d8f3b1a75"
            ],
            "readOnly": true
          },
          "paymentMethod": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "DirectDeposit",
              "Check",
              "Manual",
              "ACH",
              null
            ],
            "description": "How the caregiver is paid.",
            "example": "DirectDeposit",
            "readOnly": true
          },
          "approvedByName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Who approved the entry.",
            "example": "Alice Smith",
            "readOnly": true
          },
          "approvedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was approved.",
            "example": "2026-10-01T18:00:00.000Z",
            "readOnly": true
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was paid.",
            "example": null,
            "readOnly": true
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Notes.",
            "example": null,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the payroll entry was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the payroll entry was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "PayrollEntryList": {
        "type": "object",
        "description": "A page of payroll entries.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PayrollEntry"
            },
            "description": "The payroll entries on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "Conversation": {
        "type": "object",
        "description": "In-app message threads between people at your agency: one-to-one chats and named group chats. Read-only; start conversations in AveeCare. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "participantIds",
          "isGroup",
          "title",
          "lastMessageTime",
          "lastMessageContent",
          "lastMessageSenderId",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "conversation"
            ],
            "description": "String representing the object's type. Always `conversation`.",
            "example": "conversation",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the conversation.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "participantIds": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "User IDs of everyone in the conversation.",
            "example": [
              "d2b7e9a4-1c3f-4e58-b6a0-8f4c2e1d7b39",
              "f8a3c5e1-9b7d-4c20-a6e8-2d4f1b9c7e05"
            ],
            "readOnly": true
          },
          "isGroup": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this is a group chat.",
            "example": false,
            "readOnly": true
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Group chat name; `null` for one-to-one chats.",
            "example": null,
            "readOnly": true
          },
          "lastMessageTime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the most recent message was sent.",
            "example": "2026-10-05T14:02:00.000Z",
            "readOnly": true
          },
          "lastMessageContent": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Preview of the most recent message.",
            "example": "See you at 9 tomorrow.",
            "readOnly": true
          },
          "lastMessageSenderId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "User ID of whoever sent the most recent message.",
            "example": "d2b7e9a4-1c3f-4e58-b6a0-8f4c2e1d7b39",
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the conversation was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the conversation was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "ConversationList": {
        "type": "object",
        "description": "A page of conversations.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Conversation"
            },
            "description": "The conversations on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "Message": {
        "type": "object",
        "description": "Messages in a conversation. Messages you send through the API are sent as the API key's user. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "conversationId",
          "content",
          "senderId",
          "sentAt",
          "editedAt",
          "isDeleted",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "message"
            ],
            "description": "String representing the object's type. Always `message`.",
            "example": "message",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the message.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "conversationId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The conversation the message belongs to.",
            "example": "e3c7a1f9-6d2b-4a58-8e14-0b9f5c2d7a36"
          },
          "content": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000,
            "description": "Message text.",
            "example": "See you at 9 tomorrow."
          },
          "senderId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "User ID of the sender. Set to the API key's user.",
            "example": "d2b7e9a4-1c3f-4e58-b6a0-8f4c2e1d7b39",
            "readOnly": true
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the message was sent.",
            "example": "2026-10-05T14:02:00.000Z",
            "readOnly": true
          },
          "editedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the message was last edited.",
            "example": null,
            "readOnly": true
          },
          "isDeleted": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the sender deleted the message. Deleted messages keep their place in the thread.",
            "example": false,
            "readOnly": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the message was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the message was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "MessageList": {
        "type": "object",
        "description": "A page of messages.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "description": "The messages on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "MessageCreate": {
        "type": "object",
        "description": "Fields for a new message. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "conversationId": {
            "type": "string",
            "maxLength": 64,
            "description": "The conversation the message belongs to.",
            "example": "e3c7a1f9-6d2b-4a58-8e14-0b9f5c2d7a36"
          },
          "content": {
            "type": "string",
            "maxLength": 5000,
            "description": "Message text.",
            "example": "See you at 9 tomorrow."
          }
        },
        "required": [
          "conversationId",
          "content"
        ]
      },
      "Alert": {
        "type": "object",
        "description": "Alerts on your agency's alert board, such as a credential about to expire or a missed clock-in, and announcements staff post for caregivers. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "name",
          "description",
          "type",
          "audience",
          "audienceTargetId",
          "time",
          "reviewDate",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "alert"
            ],
            "description": "String representing the object's type. Always `alert`.",
            "example": "alert",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the alert.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Headline.",
            "example": "Office closed Monday"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Details.",
            "example": "The office is closed for the holiday. Visits go ahead as scheduled."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Critical",
              "Important",
              "Notice",
              null
            ],
            "description": "How prominently the alert is shown.",
            "example": "Notice"
          },
          "audience": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "CompanyWide",
              "StaffOnly",
              "CaregiversAll",
              "PatientsAll",
              "Caregiver",
              "Patient",
              "Visit",
              "PatientCareTeam",
              null
            ],
            "description": "Who sees the alert. `Caregiver`, `Patient`, `Visit` and `PatientCareTeam` need `audienceTargetId`.",
            "example": "CompanyWide"
          },
          "audienceTargetId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver, patient or visit the alert is for, when the audience names one.",
            "example": null
          },
          "time": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the alert takes effect.",
            "example": "2026-10-05T13:00:00.000Z"
          },
          "reviewDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the alert should be reviewed or cleared.",
            "example": null
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the alert was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the alert was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "AlertList": {
        "type": "object",
        "description": "A page of alerts.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alert"
            },
            "description": "The alerts on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "AlertCreate": {
        "type": "object",
        "description": "Fields for a new alert. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Headline.",
            "example": "Office closed Monday"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Details.",
            "example": "The office is closed for the holiday. Visits go ahead as scheduled."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Critical",
              "Important",
              "Notice",
              null
            ],
            "description": "How prominently the alert is shown.",
            "example": "Notice"
          },
          "audience": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "CompanyWide",
              "StaffOnly",
              "CaregiversAll",
              "PatientsAll",
              "Caregiver",
              "Patient",
              "Visit",
              "PatientCareTeam",
              null
            ],
            "description": "Who sees the alert. `Caregiver`, `Patient`, `Visit` and `PatientCareTeam` need `audienceTargetId`.",
            "example": "CompanyWide"
          },
          "audienceTargetId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver, patient or visit the alert is for, when the audience names one.",
            "example": null
          },
          "time": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the alert takes effect.",
            "example": "2026-10-05T13:00:00.000Z"
          },
          "reviewDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the alert should be reviewed or cleared.",
            "example": null
          }
        },
        "required": [
          "name"
        ]
      },
      "AlertUpdate": {
        "type": "object",
        "description": "Fields to change on an alert. Send only the fields to change; any other field is refused with `unknown_field`. `time` is set when the alert is created and cannot be changed afterwards.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Headline.",
            "example": "Office closed Monday"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Details.",
            "example": "The office is closed for the holiday. Visits go ahead as scheduled."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "Critical",
              "Important",
              "Notice",
              null
            ],
            "description": "How prominently the alert is shown.",
            "example": "Notice"
          },
          "audience": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "CompanyWide",
              "StaffOnly",
              "CaregiversAll",
              "PatientsAll",
              "Caregiver",
              "Patient",
              "Visit",
              "PatientCareTeam",
              null
            ],
            "description": "Who sees the alert. `Caregiver`, `Patient`, `Visit` and `PatientCareTeam` need `audienceTargetId`.",
            "example": "CompanyWide"
          },
          "audienceTargetId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "The caregiver, patient or visit the alert is for, when the audience names one.",
            "example": null
          },
          "reviewDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the alert should be reviewed or cleared.",
            "example": null
          }
        },
        "minProperties": 1
      },
      "AlertDeleted": {
        "type": "object",
        "description": "Confirmation that an alert was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "alert"
            ],
            "description": "Always `alert`.",
            "example": "alert"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted alert.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Office": {
        "type": "object",
        "description": "Your agency's offices (branches). Patients, caregivers and applicants can each belong to one office. There is always exactly one default office. Every field is always present; a field with no value is `null`.",
        "required": [
          "object",
          "id",
          "name",
          "address",
          "city",
          "state",
          "zipCode",
          "phone",
          "isDefault",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "office"
            ],
            "description": "String representing the object's type. Always `office`.",
            "example": "office",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the office.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40",
            "readOnly": true
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Office name.",
            "example": "Phoenix Central"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Street address.",
            "example": "3300 N Central Ave, Suite 400"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85012"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Main phone number.",
            "example": "+16025550100"
          },
          "isDefault": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this is the default office. Making another office the default clears this one.",
            "example": true
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the office was created.",
            "example": "2026-10-01T16:04:12.000Z",
            "readOnly": true
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the office was last changed.",
            "example": "2026-10-03T09:30:00.000Z",
            "readOnly": true
          }
        }
      },
      "OfficeList": {
        "type": "object",
        "description": "A page of offices.",
        "required": [
          "object",
          "data",
          "next_cursor",
          "has_more"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "Always `list`.",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Office"
            },
            "description": "The offices on this page."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. `null` on the last page.",
            "example": null
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists.",
            "example": false
          }
        }
      },
      "OfficeCreate": {
        "type": "object",
        "description": "Fields for a new office. Any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Office name.",
            "example": "Phoenix Central"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Street address.",
            "example": "3300 N Central Ave, Suite 400"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85012"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Main phone number.",
            "example": "+16025550100"
          },
          "isDefault": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this is the default office. Making another office the default clears this one.",
            "example": true
          }
        },
        "required": [
          "name"
        ]
      },
      "OfficeUpdate": {
        "type": "object",
        "description": "Fields to change on an office. Send only the fields to change; any other field is refused with `unknown_field`.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Office name.",
            "example": "Phoenix Central"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Street address.",
            "example": "3300 N Central Ave, Suite 400"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "City.",
            "example": "Phoenix"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "State, as a two-letter code.",
            "example": "AZ"
          },
          "zipCode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "ZIP code.",
            "example": "85012"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30,
            "description": "Main phone number.",
            "example": "+16025550100"
          },
          "isDefault": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this is the default office. Making another office the default clears this one.",
            "example": true
          }
        },
        "minProperties": 1
      },
      "OfficeDeleted": {
        "type": "object",
        "description": "Confirmation that an office was deleted.",
        "required": [
          "object",
          "id",
          "deleted"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "office"
            ],
            "description": "Always `office`.",
            "example": "office"
          },
          "id": {
            "type": "string",
            "description": "ID of the deleted office.",
            "example": "9b2e4c71-5d3a-4f08-8e6b-1a7c3d9f2e40"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true`.",
            "example": true
          }
        }
      },
      "Me": {
        "type": "object",
        "description": "The API key making the request.",
        "required": [
          "object",
          "id",
          "name",
          "scopes",
          "role",
          "email",
          "expiresAt",
          "organization"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "me"
            ],
            "description": "Always `me`.",
            "example": "me",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "description": "The key's public identifier: the part of the key between `ak_` and the second underscore.",
            "example": "Xk3mP9qR2tLw",
            "readOnly": true
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name given to the key when it was created.",
            "example": "Payroll export",
            "readOnly": true
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "write"
              ]
            },
            "description": "What the key may do. A key without `write` can only read.",
            "example": [
              "read",
              "write"
            ],
            "readOnly": true
          },
          "role": {
            "type": "string",
            "enum": [
              "RootUser",
              "User",
              "Caregiver",
              "Patient"
            ],
            "description": "Role of the person the key belongs to: `RootUser` (agency administrator), `User` (office staff), `Caregiver` or `Patient`. It decides which resources the key can reach.",
            "example": "RootUser",
            "readOnly": true
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Email address of the person the key belongs to.",
            "example": "alice.smith@example.com",
            "readOnly": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the key stops working.",
            "example": "2027-10-05T00:00:00.000Z",
            "readOnly": true
          },
          "organization": {
            "type": "object",
            "description": "The agency the key belongs to.",
            "required": [
              "id",
              "name"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "ID of the agency.",
                "example": "0d6c1f2a-3b4e-4c5d-9e8f-7a6b5c4d3e2f"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Agency name.",
                "example": "AveeCare Demo Agency"
              }
            },
            "example": {
              "id": "0d6c1f2a-3b4e-4c5d-9e8f-7a6b5c4d3e2f",
              "name": "AveeCare Demo Agency"
            },
            "readOnly": true
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Returned with every response that is not 2xx.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "description": "What went wrong.",
            "required": [
              "type",
              "code",
              "message",
              "request_id"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request_error",
                  "authentication_error",
                  "permission_error",
                  "not_found_error",
                  "conflict_error",
                  "rate_limit_error",
                  "api_error"
                ],
                "description": "Broad category of the error.",
                "example": "invalid_request_error"
              },
              "code": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "unknown_field",
                  "unauthorized",
                  "forbidden",
                  "insufficient_scope",
                  "not_found",
                  "rate_limited",
                  "idempotency_conflict",
                  "internal_error"
                ],
                "description": "The specific error. Build your error handling on this value.",
                "example": "unknown_field"
              },
              "message": {
                "type": "string",
                "description": "A human-readable explanation. Its wording may change; do not parse it.",
                "example": "Unknown field for a patient: `favoriteColor`."
              },
              "request_id": {
                "type": "string",
                "description": "ID of the request. Quote it when contacting support.",
                "example": "req_3f9a1c7e5b2d4a6c8e0f1a2b"
              }
            }
          }
        }
      }
    }
  }
}
