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

# List appointments

> Lists your appointments in ascending start order (`sort=desc` reverses it), filterable by patient, provider, appointment type, status, and outcome.

**Every read is anchored or windowed.** `from` and `to` bound the appointment's **start**, not its end, as a half-open interval — so a visit starting 23:45 Tuesday belongs to Tuesday. Send no window and a recent one is applied for you (7 days back through 24 days out). An explicit window may span at most 31 days, enough for a calendar month in one request. Sending `patient_id` lifts the window entirely, since one patient's history is small.

**Every bound must name its zone.** A bare `YYYY-MM-DD` date means that whole day in the zone you name via `timezone`; without `timezone` it is rejected rather than silently read as UTC, which would shift a Pacific caller's day by 7–8 hours. A timestamp must carry an explicit offset — `2026-08-11T00:00:00Z` or `2026-08-11T00:00:00-07:00`. An offsetless `2026-08-11T00:00:00` is rejected (`appointment_list.offset_required`): it has no single meaning, and the obvious reading would resolve it against our clock rather than yours.

A `cursor` is sealed to the filters that produced it. Changing any filter mid-walk is a 400 (`appointment_list.cursor_filter_mismatch`) — restart without a cursor. `limit` is not part of that seal, so page size may change mid-walk.



## OpenAPI

````yaml /openapi.json get /appointments
openapi: 3.1.0
info:
  title: OpenLoop API
  version: 0.1.0
  description: >-
    Unified reference for the OpenLoop Patient (clinical) and Payments & Revenue
    APIs.
servers:
  - url: https://api.openloophealth.com/v0.1
    description: Production partner edge
  - url: https://api-staging.openloophealth.com/v0.1
    description: Staging partner edge (sandbox credentials)
security: []
paths:
  /appointments:
    get:
      tags:
        - Scheduling
      summary: List appointments
      description: >-
        Lists your appointments in ascending start order (`sort=desc` reverses
        it), filterable by patient, provider, appointment type, status, and
        outcome.


        **Every read is anchored or windowed.** `from` and `to` bound the
        appointment's **start**, not its end, as a half-open interval — so a
        visit starting 23:45 Tuesday belongs to Tuesday. Send no window and a
        recent one is applied for you (7 days back through 24 days out). An
        explicit window may span at most 31 days, enough for a calendar month in
        one request. Sending `patient_id` lifts the window entirely, since one
        patient's history is small.


        **Every bound must name its zone.** A bare `YYYY-MM-DD` date means that
        whole day in the zone you name via `timezone`; without `timezone` it is
        rejected rather than silently read as UTC, which would shift a Pacific
        caller's day by 7–8 hours. A timestamp must carry an explicit offset —
        `2026-08-11T00:00:00Z` or `2026-08-11T00:00:00-07:00`. An offsetless
        `2026-08-11T00:00:00` is rejected (`appointment_list.offset_required`):
        it has no single meaning, and the obvious reading would resolve it
        against our clock rather than yours.


        A `cursor` is sealed to the filters that produced it. Changing any
        filter mid-walk is a 400 (`appointment_list.cursor_filter_mismatch`) —
        restart without a cursor. `limit` is not part of that seal, so page size
        may change mid-walk.
      parameters:
        - name: patient_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
            description: >-
              Anchor the read to one patient, as returned by `POST /patients`.
              Lifts the time window — the full history is returned.
          description: >-
            Anchor the read to one patient, as returned by `POST /patients`.
            Lifts the time window — the full history is returned.
        - name: provider_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: Only appointments assigned to this provider.
        - name: appointment_type_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: Only appointments of this type.
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - open
              - closed
          description: Lifecycle state.
        - name: outcome
          in: query
          required: false
          schema:
            type: string
            enum:
              - completed
              - no_show
              - cancelled
          description: >-
            How a closed appointment ended. `unresolved` is a real outcome — a
            reopen that found nobody to take the window leaves it — but it is
            not a filter value here.
        - name: from
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 64
          description: >-
            Inclusive lower bound on the appointment's start. An ISO 8601
            timestamp with an offset, or a bare `YYYY-MM-DD` date (which
            requires `timezone`). Defaults to 7 days ago.
        - name: to
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 64
          description: >-
            Upper bound on the appointment's start. Its meaning follows its
            shape: a bare `YYYY-MM-DD` date means through the end of that local
            day (so `from=to` returns exactly one day), while a timestamp is
            exclusive of that instant. Defaults to 24 days out.
        - name: timezone
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 64
          description: >-
            IANA zone id (e.g. `America/Los_Angeles`). Required when `from` or
            `to` is a bare date, ignored when both are timestamps. Send what the
            browser reports: `Intl.DateTimeFormat().resolvedOptions().timeZone`.
            Abbreviations like `PST` are not zone ids.
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
          description: Order by start time.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            maxLength: 8192
            pattern: ^[A-Za-z0-9_-]+$
          description: >-
            Opaque `after` or `before` value from a previous response, passed
            back verbatim. It carries its own direction, so there is no separate
            paging parameter. Validated strictly and bound to the filters it was
            issued for — a modified cursor, or one replayed against a different
            filter set, returns `400`. `limit` is not part of that binding, so
            page size may change mid-walk.
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: string
                pattern: ^\d+$
            default: 25
          description: >-
            Maximum appointments per page. Defaults to 25. There is no declared
            maximum, so a larger value is accepted rather than rejected, but the
            page size is capped at 100 — ask for more and you get 100. Values
            below 1 return `400`.
      responses:
        '200':
          description: A page of your appointments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/SchedulingAppointment'
                  after:
                    type: string
                    description: >-
                      Cursor for the next page. Absent only when there are no
                      further pages.
                  before:
                    type: string
                    description: >-
                      Cursor for the previous page. Absent on the first page of
                      a walk.
                  request_id:
                    type: string
                required:
                  - items
                  - request_id
        '400':
          description: >-
            Query validation failed. `code` distinguishes the cause:
            `appointment_list.offset_required`,
            `appointment_list.timezone_required`,
            `appointment_list.timezone_invalid`,
            `appointment_list.window_unparseable`,
            `appointment_list.window_invalid`,
            `appointment_list.window_too_large`,
            `appointment_list.cursor_invalid` (the cursor could not be decoded),
            or `appointment_list.cursor_filter_mismatch` (it was issued for
            different filters).
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/SchedulingProblem'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/SchedulingProblem'
        '403':
          description: >-
            The access token carries no usable organization, or the organization
            is not one you may act for.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/SchedulingProblem'
      security:
        - serviceToken: []
        - userToken: []
components:
  schemas:
    SchedulingAppointment:
      type: object
      description: >-
        A booked appointment. Returned bare (not wrapped in a `data` envelope)
        by the single-appointment endpoints. Carries no `organization_id` — your
        org comes from the access token.
      properties:
        id:
          type: string
          format: uuid
        provider_id:
          type: string
          format: uuid
          description: The provider scheduling assigned at book time.
        patient_id:
          type: string
          format: uuid
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - open
            - closed
          description: >-
            Lifecycle state. `closed` is terminal; read `outcome` for how it
            closed.
        outcome:
          type: string
          enum:
            - completed
            - no_show
            - cancelled
            - unresolved
          description: Present once the appointment closes.
        state:
          type: string
          minLength: 2
          maxLength: 2
          description: Two-letter US state the visit was licensed against.
        closed_at:
          type: string
          format: date-time
          description: >-
            When the appointment closed, however it closed — completed, no-show
            or cancelled. Present once `status` is `closed`.
        cancelled_at:
          type: string
          format: date-time
        cancel_reason:
          type: string
        notes:
          type: string
          description: Pre-visit notes, when the booking set them.
        external_refs:
          type: array
          description: Identifiers this appointment carries in downstream systems.
          items:
            type: object
            properties:
              system:
                type: string
              id:
                type: string
            required:
              - system
              - id
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - provider_id
        - patient_id
        - start
        - end
        - status
        - created_at
        - updated_at
    SchedulingProblem:
      type: object
      description: >-
        RFC 7807 problem detail. Scheduling endpoints return errors as
        `application/problem+json`, not the platform `{ error, request_id }`
        envelope. `code` is the stable machine-readable identifier — branch on
        it, not on `detail`.
      properties:
        type:
          type: string
          description: Problem type URI. `about:blank` for the codes below.
        title:
          type: string
          description: Short human-readable summary, e.g. `Bad Request`.
        status:
          type: integer
          description: The HTTP status code, repeated in the body.
        detail:
          type: string
          description: Human-readable explanation of this occurrence.
        instance:
          type: string
        code:
          type: string
          description: >-
            Stable error identifier, e.g. `slot_search.window_too_large`,
            `appointment_list.offset_required`, `slot_token.tampered`.
          examples:
            - slot_search.window_too_large
        errors:
          type: array
          description: >-
            Field-level validation failures, when the error is a body/query
            validation failure.
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
              code:
                type: string
            required:
              - field
              - message
              - code
      required:
        - type
        - title
        - status
        - code
  securitySchemes:
    serviceToken:
      type: oauth2
      description: >-
        Service (M2M) access token issued by POST /auth/token using the
        client_credentials grant. Required scopes, where known, are listed on
        each operation below.
      flows:
        clientCredentials:
          tokenUrl: https://api.openloophealth.com/v0.1/auth/token
          scopes: {}
    userToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User access token issued by POST /auth/token via the verification-code
        grant (after Verify a one-time code) or the refresh_token grant.

````

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