{
  "openapi": "3.0.1",
  "info": {
    "title": "WriteUpp OpenAPI",
    "description": "Welcome to the WriteUpp Open API. WriteUpp subscribers can use this API to connect their WriteUpp\nsite to external systems.\n\nThe API is designed for server-side integrations that need to read site data or, when separately\nauthorised, create plain-text patient notes without asking a staff member to share their login.\n\nAPI keys belong to your WriteUpp site. That keeps every request inside the same site boundary that\nadministrators already manage in WriteUpp, and gives you a clear way to switch access off if an\nintegration is no longer needed.\n\n## Support\n\nPlease contact WriteUpp support at support@writeupp.com if you need help with the Open API.\n\n## Security\n\nThe Open API uses HTTPS for production traffic.\n\nAPI keys can read customer data for the site they belong to. Treat API keys like passwords:\n\n- Keep them server-side.\n- Do not commit them to source control.\n- Do not include them in support emails, chat, screenshots, logs, or public forums.\n\nWriteUpp support will never ask for your API key.\n\n## Authentication\n\nSite administrators can generate API keys in WriteUpp. Send the key in the `X-API-Key` header with\neach authenticated request.\n\nThe key tells WriteUpp which site the request belongs to. You do not need to send a site id.\n\n## Regional API URLs\n\nWriteUpp runs in more than one region, and each region has its own API URL. API keys are\nregion-bound, so use the regional API URL shown in WriteUpp.\n\nIf a valid key is sent to the wrong URL, the API returns `401 Unauthorized`.\n\n## Identifying Your Application\n\nSend a `User-Agent` header with every request so we can identify your integration when investigating\nissues.\n\nThe header should use this format:\n\n```text\nAPPLICATION_NAME (APPLICATION_EMAIL)\n```\n\n`APPLICATION_NAME` is the name of your application. `APPLICATION_EMAIL` is a contact email address\nfor you or your company.\n\nExample:\n\n```text\nClinic reporting connector (support@example-integration.com)\n```\n\nWe may block requests in future if you do not include an application name and contact email address\nin the `User-Agent`.\n\n## Making a Request\n\nStart with your API base URL, add the endpoint path, and include the headers below:\n\n```text\nAccept: application/json\nUser-Agent: APPLICATION_NAME (APPLICATION_EMAIL)\nX-API-Key: API_KEY\n```\n\nExample:\n\n```bash\ncurl https://openapi.writeupp.com/v1/appointment-types \\\n  -H 'Accept: application/json' \\\n  -H 'User-Agent: Clinic reporting connector (support@example-integration.com)' \\\n  -H 'X-API-Key: API_KEY'\n```\n\n## Errors\n\nHTTP status codes tell you what happened:\n\n- `2xx` means the request succeeded.\n- `4xx` means the request could not be completed as sent.\n- `5xx` means the API could not complete a valid request.\n\nError responses use `application/problem+json`. They include a `trace_id` value, which is useful\nwhen you need help investigating a request.\n\n## Rate Limits\n\nRequests under `/v1` default to 200 reads and 30 writes per minute per API key, with separate read\nand write budgets. WriteUpp staff can agree higher limits for an individual key. The\n`X-RateLimit-Limit` response header reports the effective limit for that request. Anonymous or\nfailed authentication requests are limited separately by IP address or the supplied key value.\n\nWhen the limit is exceeded, the API returns `429 Too Many Requests`. The `X-RateLimit-Reset`\nresponse header contains the UTC Unix timestamp for when the current window resets. The\n`Retry-After` header contains the number of seconds to wait before retrying.\n\nCreating a patient note also requires a key with the dedicated `notes.create` scope and a site\nwhere the separate patient-note write rollout is enabled. Existing read-only keys do not gain this\nscope automatically. Request headers and bodies are not included in Open API usage telemetry.\n\n## Data Responses\n\nThe API returns JSON. Send an `Accept` header that allows `application/json`.\n\n## Dates and Times\n\nDate and time values are UTC unless an endpoint explicitly documents a different behaviour.\n\n## Pagination\n\nList endpoints use `page` and `per_page` query parameters. The default page size is 50 and the\nmaximum page size is 100.\n\nPaginated responses include `total_entries` and a `links` object. Follow `links.self`,\n`links.previous`, and `links.next` rather than building pagination URLs yourself. `previous` and\n`next` are only included when there is a previous or next page.\n\n## Filtering\n\nFiltering is documented on each resource that supports it. The reserved filter format is\n`q[]=FIELD:OPERATORVALUE`.\n\nSupported filter operator families are:\n\n- Date/time: `=`, `>=`, `>`, `<=`, `<`, `?`, `!?`, `*`\n- Numeric: `=`, `!=`, `>=`, `>`, `<=`, `<`, `?`, `!?`\n- String: `=`, `!=`, `~`, `~~`, `?`, `!?`\n- Boolean: `=`, `!=`, `?`, `!?`\n\n`~` means contains and `~~` means starts with for strings. `?` tests that a value is\npresent and `!?` tests that it is missing. `*` matches the UTC calendar day for a date/time\nfield. Multiple `q[]` values are combined with AND semantics, including repeated filters for\nthe same field. Each endpoint publishes an explicit field/operator allow-list; unknown fields,\nunsupported operators, malformed values, and invalid sort parameters return HTTP 400.\n\nDate/time filter values must be UTC, for example `2026-05-06T13:00:00Z`.\n\n## Ordering\n\nOrdering is documented on each resource that supports it. Use `sort` for the field list and `order`\nfor `asc` or `desc` (ascending is the default). A single sort field is accepted and the resource\nidentifier is always used as a final ascending tie-breaker, so page boundaries remain deterministic.\nPagination links retain the original filters and ordering parameters.\n\nThe generated resource documentation lists the allow-listed fields for each endpoint. The current\nsets are: appointments (`id`, `starts_at`, `ends_at`, `created_at`, `appointment_type_id`, `user_id`,\n`location_id`, `status_id`, `patient_id`); invoices (`id`, `created_at`, `issue_date`, `due_date`,\n`payment_date`, `patient_id`, `user_id`, `paid`); invoice items (`id`, `invoice_id`, `appointment_id`,\n`expense_id`, `date`, `price_excluding_tax`, `tax_amount`, `discount`,\n`price_excluding_tax_after_discount`, `line_total`); patients (`id`, `first_name`, `surname`, `email`,\n`date_of_birth`, `created_at`, `updated_at`, `mobile`, `home_phone`, `work_phone`); and reference data fields\ndocumented by each resource. Phone filters compare the local number, ignoring spaces, punctuation and a national leading zero. International `+` and `00` formats are equivalent to WriteUpp's stored international values, so use `+447700900000`, `0044 7700 900000` or `07700 900000` for the same UK mobile.\n\nPatient responses preserve the stored `mobile` value, for example `44#7700900000`, for existing integrations.\nThe optional `mobile_international` field provides the ordinary international form, for example\n`+447700900000`, and is omitted when the stored value cannot be formatted without assuming a country code.\nThese fields are consistent across list, single-patient, creation and retry responses. Continue filtering\non `mobile`; either returned format can be used as its filter value. The `+44 (0)7700 900000` format is not supported.\n\n## Links to the WriteUpp web app\n\nPatient and appointment responses include an `app_url` field that opens the record in the WriteUpp web\napp for the practice that owns the API key, for example `https://example.writeupp.com/patient_summary.aspx?id=123`.\nThe link is for a person to follow in a browser, not an API endpoint. The user must be signed in to\nWriteUpp and have access to the record, and may be asked to sign in first. After signing in they may\nland on the WriteUpp home page rather than the record.\n\n## Commercial Terms and API Access\n\n### API Access\n\nAccess to the WriteUpp Open API is provided at WriteUpp’s discretion and may be subject to additional commercial terms, service agreements, subscription requirements, or partnership agreements.\n\n### Commercial Partner Agreements\n\nWhere API access is used for commercial purposes, including but not limited to third-party integrations, reseller services, marketplace offerings, or solutions provided to mutual customers, WriteUpp may require the organisation to enter into a separate partnership, commercial, or integration agreement.\n\nWriteUpp reserves the right to require such an agreement as a condition of continued API access and may suspend or withdraw API access where an organisation declines to enter into, or comply with, the applicable agreement.\n\n### Fees\n\nUnless otherwise agreed in writing, access to the API is currently provided without additional charges. WriteUpp reserves the right to introduce fees for API access, API transactions, usage volumes, premium endpoints, support services, certification programmes, or other API-related services in the future.\n\nWhere fees are introduced, WriteUpp will provide reasonable advance notice to affected customers and partners.\n\n### Usage Limits\n\nWriteUpp may apply rate limits, usage quotas, fair usage policies, or other technical restrictions to ensure platform stability, security, and service quality. Such limits may be amended from time to time.\n\n### Suspension and Termination\n\nWriteUpp may suspend, restrict, or terminate API access immediately where:\n\nAPI credentials are compromised or suspected to be compromised;\n\nAPI usage presents a security, operational, legal, or compliance risk;\n\nUsage breaches applicable agreements, documentation, or acceptable use requirements;\n\nRequired commercial terms are not accepted or applicable fees are not paid;\n\nA required partnership or commercial agreement is not executed or maintained.\n\nFor enterprise and commercial partners, WriteUpp may refuse, restrict, suspend, or withdraw API access where reasonably necessary to protect the security, stability, integrity, reputation, or commercial operation of the WriteUpp platform and services.\n\n### Changes to the API\n\nWriteUpp may modify, replace, deprecate, or discontinue API functionality, endpoints, features, or versions. Where reasonably practicable, notice will be provided for material changes affecting existing integrations.\n\n### Availability\n\nAPI access is provided on an “as available” basis. WriteUpp does not guarantee uninterrupted availability of API services and may perform maintenance, upgrades, or emergency changes that temporarily affect access.",
    "version": "v1"
  },
  "paths": {
    "/v1/appointment-categories": {
      "get": {
        "tags": [
          "Appointment Categories"
        ],
        "summary": "Lists active appointment categories",
        "operationId": "ListAppointmentCategories",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentCategoryListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/appointment-categories/{id}": {
      "get": {
        "tags": [
          "Appointment Categories"
        ],
        "summary": "Gets a single appointment category",
        "operationId": "GetAppointmentCategory",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentCategoryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/appointment-statuses": {
      "get": {
        "tags": [
          "Appointment Statuses"
        ],
        "summary": "Lists active appointment statuses",
        "operationId": "ListAppointmentStatuses",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentStatusListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/appointment-statuses/{id}": {
      "get": {
        "tags": [
          "Appointment Statuses"
        ],
        "summary": "Gets a single appointment status",
        "operationId": "GetAppointmentStatus",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/appointment-types": {
      "get": {
        "tags": [
          "Appointment Types"
        ],
        "summary": "Lists appointment types",
        "operationId": "ListAppointmentTypes",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/appointment-types/{id}": {
      "get": {
        "tags": [
          "Appointment Types"
        ],
        "summary": "Gets a single appointment type",
        "operationId": "GetAppointmentType",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/appointments": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Lists appointments",
        "operationId": "ListAppointments",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "appointment_type_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "status_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "patient_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/appointments/{id}": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "summary": "Gets a single appointment",
        "operationId": "GetAppointment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/booking/available-times": {
      "get": {
        "tags": [
          "Booking Available Times"
        ],
        "summary": "Lists bookable appointment slots for one day",
        "description": "Accounts for configured working hours, Online Booking eligibility and existing appointments or\r\ngroup sessions. Filter by clinician and/or location; omitting either returns slots across every\r\nclinician/location bookable for the appointment type.",
        "operationId": "ListBookingAvailableTimes",
        "parameters": [
          {
            "name": "day",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appointment_type_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableTimesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/booking/practitioners": {
      "get": {
        "tags": [
          "Booking Practitioners"
        ],
        "summary": "Lists bookable practitioners and their configured recurring working hours",
        "description": "These hours describe diary configuration in the site's time zone. They are not live\r\nappointment slots and do not account for existing appointments or other booking rules.",
        "operationId": "ListBookingPractitioners",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingPractitionerListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/expenses": {
      "get": {
        "tags": [
          "Expenses"
        ],
        "summary": "Lists active expenses",
        "operationId": "ListExpenses",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/expenses/{id}": {
      "get": {
        "tags": [
          "Expenses"
        ],
        "summary": "Gets a single expense",
        "operationId": "GetExpense",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/invoices": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Lists invoices",
        "operationId": "ListInvoices",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "patient_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "appointment_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paid",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/invoices/{id}": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Gets a single invoice",
        "operationId": "GetInvoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/appointments/{appointment-id}/invoices": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Lists invoices for an appointment",
        "operationId": "ListInvoicesForAppointment",
        "parameters": [
          {
            "name": "appointment-id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/invoice-items": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Lists invoice items",
        "operationId": "ListInvoiceItems",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "invoice_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "appointment_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceItemListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/invoice-items/{id}": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Gets a single invoice item",
        "operationId": "GetInvoiceItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceItemResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/invoices/{invoice-id}/invoice-items": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Lists invoice items for an invoice",
        "operationId": "ListInvoiceItemsForInvoice",
        "parameters": [
          {
            "name": "invoice-id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceItemListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/locations": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Lists active locations",
        "operationId": "ListLocations",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/locations/{id}": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets a single location",
        "operationId": "GetLocation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/patients/{patientId}/notes": {
      "post": {
        "tags": [
          "Patient Notes"
        ],
        "summary": "Creates a plain-text patient note.",
        "operationId": "CreatePatientNote",
        "parameters": [
          {
            "name": "patientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientNoteRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientNoteResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientNoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/patients": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Lists patients",
        "operationId": "ListPatients",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/patients/{id}": {
      "get": {
        "tags": [
          "Patients"
        ],
        "summary": "Gets a single patient",
        "operationId": "GetPatient",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/payment-types": {
      "get": {
        "tags": [
          "Payment Types"
        ],
        "summary": "Lists active payment types",
        "operationId": "ListPaymentTypes",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTypeListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/payment-types/{id}": {
      "get": {
        "tags": [
          "Payment Types"
        ],
        "summary": "Gets a single payment type",
        "operationId": "GetPaymentType",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTypeResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/referral-sources": {
      "get": {
        "tags": [
          "Referral Sources"
        ],
        "summary": "Lists active referral sources",
        "operationId": "ListReferralSources",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralSourceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/referral-sources/{id}": {
      "get": {
        "tags": [
          "Referral Sources"
        ],
        "summary": "Gets a single referral source",
        "operationId": "GetReferralSource",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralSourceResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/status": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Returns the OpenAPI status without requiring an API key",
        "operationId": "GetOpenApiStatus",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiStatusResponse"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/taxes": {
      "get": {
        "tags": [
          "Taxes"
        ],
        "summary": "Lists active VAT rates",
        "operationId": "ListTaxes",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/taxes/{id}": {
      "get": {
        "tags": [
          "Taxes"
        ],
        "summary": "Gets a single VAT rate",
        "operationId": "GetTax",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Lists clinical users",
        "operationId": "ListUsers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number, starting at one.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Number of users per page.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "description": "Includes deactivated clinical users when true.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/users/{id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Gets a single clinical user, including a deactivated user",
        "operationId": "GetUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/users/{user-id}/appointment-types": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Lists appointment types linked to a user",
        "operationId": "ListAppointmentTypesForUser",
        "parameters": [
          {
            "name": "user-id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentTypeListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/appointment-types/{appointment-type-id}/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Lists users linked to an appointment type",
        "operationId": "ListUsersForAppointmentType",
        "parameters": [
          {
            "name": "appointment-type-id",
            "in": "path",
            "description": "Appointment type identifier.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number, starting at one.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "Number of users per page.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "description": "Includes linked deactivated clinical users when true.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "q[]",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable. Send an Accept header that allows application/json responses.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. The limit is 200 requests per minute per API key.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix timestamp, in UTC, for when the current rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              "Retry-After": {
                "description": "Seconds until another request should be attempted.",
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiListLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "nullable": true
          },
          "previous": {
            "type": "string",
            "nullable": true
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ApiSelfLink": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ApiStatusResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "nullable": true
          },
          "version": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AppointmentCategoryListResponse": {
        "type": "object",
        "properties": {
          "appointment_categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentCategoryResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "AppointmentCategoryResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "order": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "AppointmentLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "nullable": true
          },
          "invoices": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AppointmentListResponse": {
        "type": "object",
        "properties": {
          "appointments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "AppointmentResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "appointment_type_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "location_id": {
            "type": "string",
            "nullable": true
          },
          "status_id": {
            "type": "string",
            "nullable": true
          },
          "patient_id": {
            "type": "string",
            "nullable": true
          },
          "patient_case_id": {
            "type": "string",
            "nullable": true
          },
          "cost": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amount_payable": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "from_online_booking": {
            "type": "boolean"
          },
          "app_url": {
            "type": "string",
            "description": "Link that opens the appointment in the WriteUpp web app. Omitted when the site's web app\r\naddress is not available. The user may need to sign in first.",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/AppointmentLinks"
          }
        },
        "additionalProperties": false
      },
      "AppointmentStatusListResponse": {
        "type": "object",
        "properties": {
          "appointment_statuses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentStatusResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "AppointmentStatusResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "is_default": {
            "type": "boolean"
          },
          "patient_attending": {
            "type": "boolean"
          },
          "arrived": {
            "type": "boolean"
          },
          "html_colour": {
            "type": "string",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "AppointmentTypeListResponse": {
        "type": "object",
        "properties": {
          "appointment_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentTypeResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "AppointmentTypeResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "duration_in_minutes": {
            "type": "integer",
            "format": "int32"
          },
          "buffer_time_in_minutes": {
            "type": "integer",
            "format": "int32"
          },
          "show_in_online_bookings": {
            "type": "boolean"
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "AvailableSlotResponse": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "location_id": {
            "type": "string",
            "nullable": true
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AvailableTimesResponse": {
        "type": "object",
        "properties": {
          "day": {
            "type": "string",
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "nullable": true
          },
          "appointment_type_id": {
            "type": "string",
            "nullable": true
          },
          "duration_minutes": {
            "type": "integer",
            "format": "int32"
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailableSlotResponse"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Bookable appointment slots for one day, computed from the same diary rules the appointment\r\nwrite endpoints enforce. Times are explicit UTC offsets; WriteUpp.OpenApi.Contracts.V1.AvailableTimesResponse.Timezone gives the site's\r\nown IANA timezone for display."
      },
      "BookingPractitionerListResponse": {
        "type": "object",
        "properties": {
          "time_zone": {
            "type": "string",
            "nullable": true
          },
          "availability_kind": {
            "type": "string",
            "nullable": true
          },
          "is_live_availability": {
            "type": "boolean"
          },
          "practitioners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingPractitionerResponse"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BookingPractitionerResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "working_hours_source": {
            "type": "string",
            "nullable": true
          },
          "recurring_working_hours": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingWorkingDayResponse"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BookingWorkingDayResponse": {
        "type": "object",
        "properties": {
          "day_of_week": {
            "type": "string",
            "nullable": true
          },
          "periods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingWorkingPeriodResponse"
            },
            "nullable": true
          },
          "breaks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingWorkingPeriodResponse"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BookingWorkingPeriodResponse": {
        "type": "object",
        "properties": {
          "starts_at": {
            "type": "string",
            "nullable": true
          },
          "ends_at": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreatePatientNoteRequest": {
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "text": {
            "minLength": 1,
            "type": "string"
          },
          "label": {
            "maxLength": 64,
            "type": "string",
            "nullable": true
          },
          "recorded_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "appointment_id": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "external_reference": {
            "maxLength": 200,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ExpenseListResponse": {
        "type": "object",
        "properties": {
          "expenses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpenseResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "ExpenseResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "price_excluding_tax": {
            "type": "number",
            "format": "double"
          },
          "tax_amount": {
            "type": "number",
            "format": "double"
          },
          "tax_rate": {
            "type": "number",
            "format": "double"
          },
          "tax_id": {
            "type": "string",
            "nullable": true
          },
          "stock_level": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "industry_standard_code": {
            "type": "string",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "InvoiceItemListResponse": {
        "type": "object",
        "properties": {
          "invoice_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceItemResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "InvoiceItemResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "invoice_id": {
            "type": "string",
            "nullable": true
          },
          "appointment_id": {
            "type": "string",
            "nullable": true
          },
          "expense_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "price_excluding_tax": {
            "type": "number",
            "format": "double"
          },
          "tax_amount": {
            "type": "number",
            "format": "double"
          },
          "tax_rate": {
            "type": "number",
            "format": "double"
          },
          "discount": {
            "type": "number",
            "format": "double"
          },
          "price_excluding_tax_after_discount": {
            "type": "number",
            "format": "double"
          },
          "line_total": {
            "type": "number",
            "description": "The final invoice-line value after discount, including the stored tax amount, using the\r\ninvoice's existing monetary precision.",
            "format": "double"
          },
          "tax_id": {
            "type": "string",
            "nullable": true
          },
          "industry_standard_code": {
            "type": "string",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "InvoiceLinks": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string",
            "nullable": true
          },
          "invoice_items": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InvoiceListResponse": {
        "type": "object",
        "properties": {
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "InvoiceResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "number": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "patient_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "issue_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "due_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "payment_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "paid": {
            "type": "boolean"
          },
          "bad_debt": {
            "type": "boolean"
          },
          "ex_tax": {
            "type": "number",
            "format": "double"
          },
          "tax": {
            "type": "number",
            "format": "double"
          },
          "discount": {
            "type": "number",
            "format": "double"
          },
          "total": {
            "type": "number",
            "format": "double"
          },
          "outstanding": {
            "type": "number",
            "format": "double"
          },
          "payment_type_id": {
            "type": "string",
            "nullable": true
          },
          "currency_code": {
            "type": "string",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/InvoiceLinks"
          }
        },
        "additionalProperties": false
      },
      "LocationListResponse": {
        "type": "object",
        "properties": {
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "LocationResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "is_default": {
            "type": "boolean"
          },
          "show_in_online_bookings": {
            "type": "boolean"
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "PatientCustomFieldResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PatientListResponse": {
        "type": "object",
        "properties": {
          "patients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "PatientNextOfKinResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "patient_id": {
            "type": "string",
            "nullable": true
          },
          "relation": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "nullable": true
          },
          "home_number": {
            "type": "string",
            "nullable": true
          },
          "work_number": {
            "type": "string",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "mobile_opt_in": {
            "type": "boolean"
          },
          "email_opt_in": {
            "type": "boolean"
          },
          "is_primary": {
            "type": "boolean"
          },
          "deactivated": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "PatientNoteResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "version_id": {
            "type": "string",
            "nullable": true
          },
          "patient_id": {
            "type": "string",
            "nullable": true
          },
          "recorded_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "PatientResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "wuid": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "first_name": {
            "type": "string",
            "nullable": true
          },
          "surname": {
            "type": "string",
            "nullable": true
          },
          "preferred_name": {
            "type": "string",
            "nullable": true
          },
          "pronouns": {
            "type": "string",
            "nullable": true
          },
          "date_of_birth": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "date_of_death": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "home_phone": {
            "type": "string",
            "nullable": true
          },
          "work_phone": {
            "type": "string",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "description": "Stored mobile value, preserved for existing integrations (for example 44#7700900000).",
            "nullable": true
          },
          "mobile_international": {
            "type": "string",
            "description": "International mobile number (for example +447700900000). Omitted when the stored value cannot\r\nbe formatted without assuming a country code.",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "other_address": {
            "type": "string",
            "nullable": true
          },
          "other_postcode": {
            "type": "string",
            "nullable": true
          },
          "other_city": {
            "type": "string",
            "nullable": true
          },
          "hospital_number": {
            "type": "string",
            "nullable": true
          },
          "nhs_number": {
            "type": "string",
            "nullable": true
          },
          "previous_id": {
            "type": "string",
            "nullable": true
          },
          "source_id": {
            "type": "string",
            "nullable": true
          },
          "gender_id": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "ethnic_origin_id": {
            "type": "string",
            "nullable": true
          },
          "comments": {
            "type": "string",
            "nullable": true
          },
          "cloud_id": {
            "type": "string",
            "nullable": true
          },
          "created_by_user_id": {
            "type": "string",
            "nullable": true
          },
          "modified_by_user_id": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "sms_opt_in": {
            "type": "boolean",
            "description": "Whether the patient currently has SMS/email contact consent recorded. These are informational\r\nmirrors of the patient's own preference - setting them here does not send, opt in or opt out any\r\ncommunication."
          },
          "email_opt_in": {
            "type": "boolean"
          },
          "next_of_kin": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientNextOfKinResponse"
            },
            "nullable": true
          },
          "custom_fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatientCustomFieldResponse"
            },
            "nullable": true
          },
          "app_url": {
            "type": "string",
            "description": "Link that opens the patient in the WriteUpp web app. Omitted when the site's web app address\r\nis not available. The user may need to sign in first.",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "PaymentTypeListResponse": {
        "type": "object",
        "properties": {
          "payment_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentTypeResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "PaymentTypeResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "ReferralSourceListResponse": {
        "type": "object",
        "properties": {
          "referral_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReferralSourceResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "ReferralSourceResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "TaxListResponse": {
        "type": "object",
        "properties": {
          "taxes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "TaxResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "rate": {
            "type": "number",
            "format": "double"
          },
          "xero_type": {
            "type": "string",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      },
      "UserListResponse": {
        "type": "object",
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserResponse"
            },
            "nullable": true
          },
          "total_entries": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "$ref": "#/components/schemas/ApiListLinks"
          }
        },
        "additionalProperties": false
      },
      "UserResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "job_title": {
            "type": "string",
            "nullable": true
          },
          "professional_registration": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "active": {
            "type": "boolean"
          },
          "deactivated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "links": {
            "$ref": "#/components/schemas/ApiSelfLink"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "Provide the API key in the X-API-Key header.",
        "name": "X-API-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "ApiKey": [ ]
    }
  ]
}