> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haau3.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Find schedules

> Search the Schedules of SMART Scheduling Links publishers: each the provider, the place and the service a publisher's Slots belong to. The answer is a FHIR `searchset` Bundle whose matches are Schedules, each as its publisher published it (the guide's Schedule profile), in order of id. Each Schedule's Location and provider come in the same Bundle when asked for: `_include=Schedule:actor`, then `_include:iterate=PractitionerRole:practitioner` and `_include:iterate=HealthcareService:location`. Each included resource comes once, and `total` counts the Schedules only.

A Schedule search does not reach its Slots: a Schedule matches whether or not it has a free Slot ahead, and nothing here filters by a Slot's time, status or patient type. To find open Slots, search Slots, with `_include=Slot:schedule` for each one's Schedule. Follow the `next` link to continue: its cursor belongs to the one search.

Every other parameter is refused by name rather than ignored, so a search never quietly answers a different question than the one asked. `_sort`, `_total`, `_summary`, `_elements` and `_revinclude` are not served.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/fhir/r4/Schedule
openapi: 3.1.0
info:
  title: haau3 Platform API
  version: 1.0.0-preview.49
  description: >-
    The haau3 platform API is in preview: it may change as we build, usually to
    add features or improve performance. Endpoints require an API key, sent as
    `Authorization: Bearer <key>`. Requests without a valid key return 401.
    Create a key in the dashboard at https://platform.haau3.com; a new
    organization starts on the free Developer plan. From 2026-11-02 a request
    past one of its plan's limits (requests a minute on every plan, requests a
    month on Developer) returns 429 with `Retry-After`. Every service is on the
    FHIR R4 base at `/v1/fhir/r4`, and every error is a FHIR `OperationOutcome`;
    https://docs.haau3.com/errors lists every status, whether to retry it, and
    what a method a path does not take answers.
servers:
  - url: https://api.haau3.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: FHIR base
    description: >-
      What the FHIR R4 base at `/v1/fhir/r4` answers for every service on it:
      the `CapabilityStatement` that lists them all, and batch Bundles that
      carry several requests to any of them in one round trip.
  - name: Scheduling
    description: >-
      Provider availability from SMART Scheduling Links publishers: Slot and
      Schedule, searched and read, and the Location, Practitioner,
      PractitionerRole and HealthcareService they name.
  - name: Terminology
    description: >-
      FHIR terminology operations over the code systems listed in
      TerminologyCapabilities. Some are resolved from their own source when you
      ask; others are held here at a named release, which that resource also
      names.
  - name: Provider directory
    description: >-
      CMS's National Provider Directory as FHIR R4: practitioners and their
      roles, organizations, payers and insurance networks, network membership,
      healthcare services, locations and endpoints. Every parameter the service
      serves is declared here, and any other is refused by name rather than
      ignored.
  - name: Questionnaires
    description: >-
      FHIR Questionnaire, served as its source publishes it. This service holds
      copies of a curated set and reaches any other questionnaire its source
      publishes by canonical URL, as well as forms published at their own
      address under places this service is set up to reach. Read one by id, and
      build the QuestionnaireResponse in your own application.
  - name: Medical Benefits
    description: >-
      FHIR InsurancePlan: what a Medicare Advantage or ACA Marketplace plan
      covers and what a member pays, read from the files CMS publishes. Every
      plan names the CMS release it was read from. Read a plan by its id, or
      search by identifier, name, state or county, and check whether the CMS
      National Provider Directory lists providers in a plan's network. A
      Medicare Part D formulary and a Part D plan's drug plan are InsurancePlans
      too, read on the same path by their own forms of id, and counted as
      Pharmacy Benefits.
  - name: Pharmacy Benefits
    description: >-
      The CARIN Consumer Real-Time Pharmacy Benefit Check as FHIR messaging:
      what a medication would cost a member under their coverage, or its price
      at pharmacies near a ZIP code, in real time, from the sources this service
      connects to. A member's request receives patient data, so send it only
      under an executed agreement. And Medicare Part D from CMS's monthly file,
      in the shape of HL7's Da Vinci US Drug Formulary guide: which drugs each
      formulary lists, at which tier and with which limits, and each plan's drug
      plan, with what each tier costs.
  - name: MedList
    description: >-
      One reconciled medication list from one patient's FHIR medication records,
      as US Core MedicationRequests with a Provenance for each. This operation
      receives patient data, so send it only under an executed agreement.
  - name: Structured Sig
    description: >-
      A prescription's free-text directions as a FHIR Dosage: the dose, unit,
      route, method and timing coded in SNOMED CT, NCIt and UCUM where the words
      support them, the directions kept verbatim, and a review flag on anything
      a person should check. It takes the directions and the medication's
      codings, never a patient.
  - name: Sandbox
    description: >-
      The FHIR base without production behind it, to build and test against: the
      same paths at `/v1/sandbox/fhir/r4`, answered with synthetic data that
      always gives the same answer. Its first service is the CARIN Consumer
      Real-Time Pharmacy Benefit Check, answered by Example Health Plan, a test
      insurer. It takes a test key (`haau3_sk_test_…`), made on the API keys
      page. A test key's requests count toward its organization's requests a
      minute, apart from its production requests, and never toward the plan's
      month. Send test members only, never a real person.
paths:
  /v1/fhir/r4/Schedule:
    get:
      tags:
        - Scheduling
      summary: Find schedules
      description: >-
        Search the Schedules of SMART Scheduling Links publishers: each the
        provider, the place and the service a publisher's Slots belong to. The
        answer is a FHIR `searchset` Bundle whose matches are Schedules, each as
        its publisher published it (the guide's Schedule profile), in order of
        id. Each Schedule's Location and provider come in the same Bundle when
        asked for: `_include=Schedule:actor`, then
        `_include:iterate=PractitionerRole:practitioner` and
        `_include:iterate=HealthcareService:location`. Each included resource
        comes once, and `total` counts the Schedules only.


        A Schedule search does not reach its Slots: a Schedule matches whether
        or not it has a free Slot ahead, and nothing here filters by a Slot's
        time, status or patient type. To find open Slots, search Slots, with
        `_include=Slot:schedule` for each one's Schedule. Follow the `next` link
        to continue: its cursor belongs to the one search.


        Every other parameter is refused by name rather than ignored, so a
        search never quietly answers a different question than the one asked.
        `_sort`, `_total`, `_summary`, `_elements` and `_revinclude` are not
        served.
      operationId: searchSchedule
      parameters:
        - name: service-type
          in: query
          required: false
          description: >-
            The Schedule's service type, its own `serviceType`. Any of FHIR's
            token forms: `code`, `system|code`, `|code` (a code with no system)
            or `system|` (any code in that system), several separated by commas
            for any of them.
          schema:
            type: string
        - name: specialty
          in: query
          required: false
          description: >-
            The Schedule's own specialty, FHIR's Schedule.specialty. For a
            specialty the SMART Scheduling Links `schedule-specialty` extension
            or the provider states, use `provider-specialty`. Any of FHIR's
            token forms: `code`, `system|code`, `|code` (a code with no system)
            or `system|` (any code in that system), several separated by commas
            for any of them.
          schema:
            type: string
        - name: provider-specialty
          in: query
          required: false
          description: >-
            A specialty of the provider, as the Schedule states it (its own
            `specialty` or the SMART Scheduling Links `schedule-specialty`
            extension) or as the provider itself does (a PractitionerRole or
            HealthcareService the Schedule names). Any of FHIR's token forms:
            `code`, `system|code`, `|code` (a code with no system) or `system|`
            (any code in that system), several separated by commas for any of
            them.
          schema:
            type: string
        - name: provider-identifier
          in: query
          required: false
          description: >-
            An identifier, such as an NPI
            (`http://hl7.org/fhir/sid/us-npi|1234567890`), of the provider the
            Schedule names: a Practitioner, a PractitionerRole or the
            Practitioner behind it, or a HealthcareService, whichever the
            publisher used. Any of FHIR's token forms: `code`, `system|code`,
            `|code` (a code with no system) or `system|` (any code in that
            system), several separated by commas for any of them.
          schema:
            type: string
          example: http://hl7.org/fhir/sid/us-npi|2900000227
        - name: location-address-city
          in: query
          required: false
          description: >-
            The city of a Location the Schedule names, or of the Location of a
            HealthcareService it names: the start of the city's name, ignoring
            case and accents: `San Jose` finds San José. Several separated by
            commas.
          schema:
            type: string
        - name: location-address-state
          in: query
          required: false
          description: >-
            The state of a Location the Schedule names, or of the Location of a
            HealthcareService it names, matched as `location-address-city` is.
          schema:
            type: string
        - name: location-physical-type
          in: query
          required: false
          description: >-
            The physicalType of a Location the Schedule names, or of the
            Location of a HealthcareService it names: `vi` for a virtual one,
            from `http://terminology.hl7.org/CodeSystem/location-physical-type`.
            Any of FHIR's token forms: `code`, `system|code`, `|code` (a code
            with no system) or `system|` (any code in that system), several
            separated by commas for any of them.
          schema:
            type: string
        - name: _source
          in: query
          required: false
          description: >-
            The Schedule's `meta.source`: where the publisher published it, its
            feed's address followed by `Schedule/` and the publisher's own id.
            Several separated by commas.
          schema:
            type: string
        - name: _source:below
          in: query
          required: false
          description: >-
            The start of the Schedule's `meta.source`: a feed's address, for
            every Schedule it published. Several separated by commas.
          schema:
            type: string
        - name: _include
          in: query
          required: false
          style: form
          explode: true
          description: >-
            `Schedule:actor` adds each Schedule's Location, PractitionerRole,
            Practitioner or HealthcareService. What those reach comes with
            `_include:iterate`.
          schema:
            minItems: 1
            maxItems: 3
            type: array
            items:
              type: string
              enum:
                - Schedule:actor
          example: Schedule:actor
        - name: _include:iterate
          in: query
          required: false
          style: form
          explode: true
          description: >-
            `PractitionerRole:practitioner` adds the Practitioner behind each
            included role, and `HealthcareService:location` the Location of each
            included HealthcareService. Each needs `_include=Schedule:actor`,
            which may be sent here too.
          schema:
            minItems: 1
            maxItems: 3
            type: array
            items:
              type: string
              enum:
                - Schedule:actor
                - PractitionerRole:practitioner
                - HealthcareService:location
          example:
            - PractitionerRole:practitioner
            - HealthcareService:location
        - name: _count
          in: query
          required: false
          description: >-
            Page size, 1 to 100, 25 by default. A larger value is refused rather
            than quietly reduced.
          schema:
            default: 25
            type: integer
            minimum: 1
            maximum: 100
        - name: page
          in: query
          required: false
          description: >-
            The next page's cursor, from the `next` link of the page before. It
            is opaque and belongs to the one search; follow the link rather than
            building one.
          schema:
            type: string
        - $ref: '#/components/parameters/XRequestId'
      responses:
        '200':
          description: >-
            A `searchset` Bundle with `total` set: the matching Schedules, then
            the resources `_include` asked for.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/Bundle'
              examples:
                Schedules by a provider's NPI, with each Schedule's Location and provider:
                  summary: >-
                    Schedules by a provider's NPI, with each Schedule's Location
                    and provider
                  value:
                    resourceType: Bundle
                    type: searchset
                    total: 1
                    link:
                      - relation: self
                        url: >-
                          https://api.haau3.com/v1/fhir/r4/Schedule?provider-identifier=http%3A%2F%2Fhl7.org%2Ffhir%2Fsid%2Fus-npi%7C2900000227&_include=Schedule%3Aactor&_include:iterate=PractitionerRole%3Apractitioner&_include:iterate=HealthcareService%3Alocation&_count=25
                    entry:
                      - fullUrl: >-
                          https://api.haau3.com/v1/fhir/r4/Schedule/e859c18cc8cc1a6ab1c9b7b63c5c60a1
                        resource:
                          id: e859c18cc8cc1a6ab1c9b7b63c5c60a1
                          meta:
                            source: >-
                              https://api.haau3.com/scheduling/Schedule/sched-haau3-radiology
                            security:
                              - code: HTEST
                                system: >-
                                  http://terminology.hl7.org/CodeSystem/v3-ActReason
                                display: test health data
                            extension:
                              - url: >-
                                  http://hl7.org/fhir/StructureDefinition/lastSourceSync
                                valueDateTime: '2026-11-24T00:01:47.571Z'
                            lastUpdated: '2026-11-23T03:58:55.936Z'
                          actor:
                            - reference: >-
                                Location/Location-scheduling-a6c987ccde51c74f24d100fffbc7124d
                            - reference: >-
                                PractitionerRole/PractitionerRole-scheduling-c56a5082f9e86dd25a0325e925d6bf82
                          identifier:
                            - value: sched-haau3-radiology
                              system: https://api.haau3.com/scheduling/
                          serviceType:
                            - text: Diagnostic Radiology/Xray/CT/Fluoroscopy
                              coding:
                                - code: '209'
                                  system: >-
                                    http://terminology.hl7.org/CodeSystem/service-type
                                  display: Diagnostic Radiology/Xray/CT/Fluoroscopy
                          resourceType: Schedule
                        search:
                          mode: match
                      - fullUrl: >-
                          https://api.haau3.com/v1/fhir/r4/Location/Location-scheduling-a6c987ccde51c74f24d100fffbc7124d
                        resource:
                          id: Location-scheduling-a6c987ccde51c74f24d100fffbc7124d
                          meta:
                            source: >-
                              https://api.haau3.com/scheduling/Location/loc-haau3-imaging
                            security:
                              - code: HTEST
                                system: >-
                                  http://terminology.hl7.org/CodeSystem/v3-ActReason
                                display: test health data
                            extension:
                              - url: >-
                                  http://hl7.org/fhir/StructureDefinition/lastSourceSync
                                valueDateTime: '2026-11-24T00:01:47.571Z'
                            lastUpdated: '2026-11-23T03:58:55.936Z'
                          name: haau3 Cambridge Imaging Center
                          status: active
                          address:
                            city: Cambridge
                            line:
                              - 55 Kendall Square
                            state: MA
                            postalCode: '02142'
                          telecom:
                            - value: +1-617-555-0188
                              system: phone
                            - value: https://haau3.com/locations/imaging
                              system: url
                          position:
                            latitude: 42.362611
                            longitude: -71.0876102
                          identifier:
                            - value: loc-haau3-imaging
                              system: https://haau3.com/synthetic/location
                            - value: loc-haau3-imaging
                              system: https://api.haau3.com/scheduling/
                          description: Ground floor, with a step-free entrance.
                          physicalType:
                            coding:
                              - code: ph
                                system: >-
                                  http://hl7.org/fhir/uv/smart-scheduling-links/CodeSystem/temporary
                                display: Physical
                          resourceType: Location
                        search:
                          mode: include
                      - fullUrl: >-
                          https://api.haau3.com/v1/fhir/r4/Practitioner/Practitioner-scheduling-9e042d6421d98d92b6944395e7d1ae8d
                        resource:
                          id: >-
                            Practitioner-scheduling-9e042d6421d98d92b6944395e7d1ae8d
                          meta:
                            source: >-
                              https://api.haau3.com/scheduling/Practitioner/sample-dr-wei-example
                            profile:
                              - >-
                                http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
                              - >-
                                http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner|6.1.0
                            security:
                              - code: HTEST
                                system: >-
                                  http://terminology.hl7.org/CodeSystem/v3-ActReason
                                display: test health data
                            extension:
                              - url: >-
                                  http://hl7.org/fhir/StructureDefinition/lastSourceSync
                                valueDateTime: '2026-11-24T00:01:47.571Z'
                            lastUpdated: '2026-11-23T03:58:55.936Z'
                          name:
                            - text: Dr. Wei Example
                              given:
                                - Wei
                              family: Example
                              prefix:
                                - Dr.
                          active: true
                          gender: female
                          extension:
                            - url: >-
                                http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
                              extension:
                                - url: ombCategory
                                  valueCoding:
                                    code: 2028-9
                                    system: urn:oid:2.16.840.1.113883.6.238
                                    display: Asian
                                - url: text
                                  valueString: Asian
                            - url: >-
                                http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
                              extension:
                                - url: ombCategory
                                  valueCoding:
                                    code: 2186-5
                                    system: urn:oid:2.16.840.1.113883.6.238
                                    display: Not Hispanic or Latino
                                - url: text
                                  valueString: Not Hispanic or Latino
                          identifier:
                            - value: sample-dr-wei-example
                              system: https://haau3.com/synthetic/practitioner
                            - value: '2900000227'
                              system: http://hl7.org/fhir/sid/us-npi
                            - value: sample-dr-wei-example
                              system: https://api.haau3.com/scheduling/
                          resourceType: Practitioner
                          communication:
                            - text: English
                              coding:
                                - code: en
                                  system: urn:ietf:bcp:47
                                  display: English
                            - text: Chinese
                              coding:
                                - code: zh
                                  system: urn:ietf:bcp:47
                                  display: Chinese
                          qualification:
                            - code:
                                text: Doctor of Medicine
                                coding:
                                  - code: MD
                                    system: >-
                                      http://terminology.hl7.org/CodeSystem/v2-0360
                                    display: Doctor of Medicine
                        search:
                          mode: include
                      - fullUrl: >-
                          https://api.haau3.com/v1/fhir/r4/PractitionerRole/PractitionerRole-scheduling-c56a5082f9e86dd25a0325e925d6bf82
                        resource:
                          id: >-
                            PractitionerRole-scheduling-c56a5082f9e86dd25a0325e925d6bf82
                          meta:
                            source: >-
                              https://api.haau3.com/scheduling/PractitionerRole/prole-haau3-radiology
                            security:
                              - code: HTEST
                                system: >-
                                  http://terminology.hl7.org/CodeSystem/v3-ActReason
                                display: test health data
                            extension:
                              - url: >-
                                  http://hl7.org/fhir/StructureDefinition/lastSourceSync
                                valueDateTime: '2026-11-24T00:01:47.571Z'
                            lastUpdated: '2026-11-23T03:58:55.936Z'
                          active: true
                          location:
                            - reference: >-
                                Location/Location-scheduling-a6c987ccde51c74f24d100fffbc7124d
                          specialty:
                            - text: Diagnostic Radiology Physician
                              coding:
                                - code: 2085R0202X
                                  system: http://nucc.org/provider-taxonomy
                                  display: Diagnostic Radiology Physician
                          identifier:
                            - value: prole-haau3-radiology
                              system: https://api.haau3.com/scheduling/
                          practitioner:
                            display: Dr. Wei Example
                            reference: >-
                              Practitioner/Practitioner-scheduling-9e042d6421d98d92b6944395e7d1ae8d
                          resourceType: PractitionerRole
                        search:
                          mode: include
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Correlation-Id:
              $ref: '#/components/headers/XCorrelationId'
        '400':
          description: >-
            A parameter this service does not serve, among them a Slot's own
            such as `start` or `status`, a parameter sent more times than it
            takes, a value of the wrong form, an include sent without the
            `:iterate` it needs, or a page that is not this search's. One issue
            per offending parameter, naming it.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Correlation-Id:
              $ref: '#/components/headers/XCorrelationId'
        '401':
          $ref: '#/components/responses/FhirUnauthorized'
        '403':
          $ref: '#/components/responses/FhirForbiddenTestKey'
        '404':
          description: No such interaction on this base.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Correlation-Id:
              $ref: '#/components/headers/XCorrelationId'
        '406':
          $ref: '#/components/responses/FhirNotAcceptable'
        '429':
          $ref: '#/components/responses/FhirTooManyRequests'
        '500':
          $ref: '#/components/responses/FhirServerError'
        '503':
          description: >-
            The scheduling store is down or did not answer in time: send the
            request again after `Retry-After`. Also the answer, with no
            `Retry-After`, when Scheduling is not configured on this deployment.
            Never reported as an empty result. It is also the answer when the
            API key could not be checked just now, with `Retry-After`.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
          headers:
            Retry-After:
              description: >-
                Sent when waiting will help: the API key could not be checked
                just now, or the source behind this service is rate limiting
                requests or did not answer. How many seconds to wait before
                sending the request again.
              schema:
                type: integer
                minimum: 0
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Correlation-Id:
              $ref: '#/components/headers/XCorrelationId'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl
            "https://api.haau3.com/v1/fhir/r4/Schedule?provider-identifier=http://hl7.org/fhir/sid/us-npi%7C2900000227&_include=Schedule:actor&_include:iterate=PractitionerRole:practitioner&_include:iterate=HealthcareService:location"
            \
              -H "Authorization: Bearer $HAAU3_API_KEY"
        - lang: typescript
          label: TypeScript
          source: |
            import { Haau3 } from "@haau3/sdk";

            const haau3 = new Haau3(); // reads HAAU3_API_KEY
            const bundle = await haau3.searchSchedule({
              "provider-identifier": "http://hl7.org/fhir/sid/us-npi|2900000227",
              _include: "Schedule:actor",
              "_include:iterate": ["PractitionerRole:practitioner", "HealthcareService:location"],
            });
            console.log(bundle.entry?.length ?? 0);
        - lang: python
          label: Python
          source: |
            from haau3 import Haau3

            client = Haau3()  # reads HAAU3_API_KEY
            bundle = client.search_schedule(
                provider_identifier="http://hl7.org/fhir/sid/us-npi|2900000227",
                include="Schedule:actor",
                include_iterate=["PractitionerRole:practitioner", "HealthcareService:location"],
            )
            print(len(bundle.get("entry", [])))
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/haau3/haau3-go\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclient, err := haau3.NewClient() // reads HAAU3_API_KEY\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tbundle, err := client.SearchSchedule(ctx, haau3.SearchScheduleParams{ProviderIdentifier: new(\"http://hl7.org/fhir/sid/us-npi|2900000227\"), Include: []string{\"Schedule:actor\"}, IncludeIterate: []string{\"PractitionerRole:practitioner\", \"HealthcareService:location\"}})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(len(bundle.Entry))\n}\n"
components:
  parameters:
    XRequestId:
      name: X-Request-Id
      in: header
      required: false
      schema:
        type: string
        format: uuid
      description: >-
        An id of your own for this request, as a UUID. It comes back in the
        `X-Correlation-Id` header and is kept with haau3's record of the
        request. Any value that is not a UUID is ignored. See
        https://docs.haau3.com/errors#request-ids.
  schemas:
    Bundle:
      type: object
      description: A FHIR R4 [Bundle](https://hl7.org/fhir/R4/bundle.html).
      properties:
        resourceType:
          type: string
          const: Bundle
        type:
          type: string
        entry:
          type: array
          items:
            type: object
            additionalProperties: true
      required:
        - resourceType
      additionalProperties: true
    OperationOutcome:
      type: object
      description: >-
        A FHIR R4
        [OperationOutcome](https://hl7.org/fhir/R4/operationoutcome.html).
      properties:
        resourceType:
          type: string
          const: OperationOutcome
        issue:
          type: array
          items:
            type: object
            properties:
              severity:
                type: string
                enum:
                  - fatal
                  - error
                  - warning
                  - information
              code:
                type: string
              details:
                type: object
                properties:
                  text:
                    type: string
                additionalProperties: true
              diagnostics:
                type: string
              expression:
                type: array
                items:
                  type: string
            required:
              - severity
              - code
            additionalProperties: true
      required:
        - resourceType
        - issue
  headers:
    XRequestId:
      description: >-
        The id haau3 gave this request, a UUID, on every response. Quote it in a
        question about the response.
      schema:
        type: string
        format: uuid
    XCorrelationId:
      description: The `X-Request-Id` you sent, when it was a UUID.
      schema:
        type: string
        format: uuid
  responses:
    FhirUnauthorized:
      description: Missing or invalid API key.
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        WWW-Authenticate:
          description: >-
            The scheme to authenticate with: `Bearer realm="api.haau3.com"`,
            with `error="invalid_token"` when a key was sent and not recognised.
          schema:
            type: string
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
    FhirForbiddenTestKey:
      description: >-
        A test key (`haau3_sk_test_…`) works only in the Sandbox, so one sent
        here is refused before the request runs: coded `forbidden`, with
        `test-key-outside-sandbox` from
        `https://haau3.com/fhir/CodeSystem/api-error` in `issue.details.coding`.
        Send a live key.
      headers:
        WWW-Authenticate:
          description: >-
            Sent when the API key works only in the other mode: `Bearer
            realm="api.haau3.com", error="insufficient_scope"`.
          schema:
            type: string
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
          examples:
            A test key outside the Sandbox:
              summary: A test key outside the Sandbox
              value:
                resourceType: OperationOutcome
                issue:
                  - severity: error
                    code: forbidden
                    details:
                      coding:
                        - system: https://haau3.com/fhir/CodeSystem/api-error
                          code: test-key-outside-sandbox
                          display: Test key outside the Sandbox
                      text: >-
                        This is a test key, which works only in the Sandbox
                        (https://api.haau3.com/v1/sandbox/fhir/r4). Send this
                        request with a live key; create one in the dashboard.
                        See
                        https://docs.haau3.com/authentication#test-and-live-keys
    FhirNotAcceptable:
      description: >-
        The request asked for a format other than JSON (`Accept` or `_format`),
        or for a FHIR release this endpoint does not serve (the `fhirVersion`
        media-type parameter).
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
    FhirTooManyRequests:
      description: >-
        A limit of the organization's plan was reached: its requests a minute,
        or the Developer plan's requests a month. Send the request again after
        `Retry-After`, which for the monthly limit runs to the 1st of the next
        month (UTC).
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        Retry-After:
          description: How many seconds to wait before sending the request again.
          schema:
            type: integer
            minimum: 0
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
    FhirServerError:
      description: The server failed to process this request.
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: haau3_sk_live_…
      description: >-
        A live platform API key (`haau3_sk_live_…`), sent as `Authorization:
        Bearer <key>`. It works for every service outside the Sandbox. Create
        one on the API keys page at https://platform.haau3.com.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.