ModMed Appointments and Slots API

Appoitments and Slots Details

OpenAPI Specification

modernizing-medicine-appointments-and-slots-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: EMA Proprietary Appointments and Slots API
  contact:
    email: ankit.srivastava@modmed.com
  version: 3.4.3_FINAL
  description: 'The EMA Proprietary FHIR API provides programmatic access to ModMed EMA clinical and practice-management data using FHIR R4-style resources under `/fhir/v2`.


    This documentation targets the **public sandbox** (`stage.ema-api.com`).


    **Authentication.** Two mechanisms are supported during the current migration: the **legacy OAuth2 `password` grant** (being sunset) and the **new OAuth2 `client_credentials`** flow (recommended for new integrations) — see the **Authentication** guide. Every API call also requires the `x-api-key` header.'
servers:
- url: https://stage.ema-api.com/ema-dev/firm/apiportal/ema
security:
- BearerAuth: []
  ApiKeyAuth: []
tags:
- name: Appointments and Slots
  description: Appoitments and Slots Details
paths:
  /fhir/v2/Appointment/{id}:
    get:
      tags:
      - Appointments and Slots
      summary: Retrieve details for a specific Appointment by ID
      parameters:
      - name: id
        in: path
        description: The resource ID
        required: true
        style: simple
        schema:
          minimum: 1
          type: string
        example: '123'
      - name: Content-flag
        in: header
        required: false
        description: Optional header. `Referral` adds Referral Contact and Referral Source information to the Appointment payload.
        schema:
          type: string
          enum:
          - Referral
      responses:
        '200':
          description: Success
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/FHIR-JSON-RESOURCE'
              example:
                resourceType: Appointment
                id: '204865'
                meta:
                  lastUpdated: '2025-05-15T18:02:15.000+00:00'
                status: pending
                appointmentType:
                  coding:
                  - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/appointment-type
                    code: '1957'
                    display: Follow-up
                  text: Follow-up
                reasonCode:
                - coding:
                  - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/reportable-reason
                    code: Other
                    display: OTHER
                  text: OTHER
                supportingInformation:
                - identifier:
                    system: NEW_PATIENT
                    value: 'false'
                  display: Example SupportingInformation
                start: '2025-05-08T19:00:00.000+00:00'
                end: '2025-05-08T19:10:00.000+00:00'
                minutesDuration: 10
                created: '2025-05-08T18:41:05+00:00'
                participant:
                - actor:
                    reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
                    display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
                - actor:
                    reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/385871
                    display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/385871
                - actor:
                    reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375399
                    display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375399
            application/fhir+xml:
              schema:
                $ref: '#/components/schemas/FHIR-XML-RESOURCE'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
    put:
      tags:
      - Appointments and Slots
      summary: Update an Appointment
      parameters:
      - name: id
        in: path
        description: The resource ID
        required: true
        style: simple
        schema:
          minimum: 1
          type: string
        example: '123'
      requestBody:
        required: true
        content:
          application/fhir+json:
            schema:
              $ref: '#/components/schemas/FHIR-JSON-RESOURCE'
            example:
              resourceType: Appointment
              id: '328983'
              status: booked
              appointmentType:
                coding:
                - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/appointment-type
                  code: '1959'
                  display: Surgery
                text: Surgery
              reasonCode:
              - coding:
                - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/reportable-reason
                  code: Medical Non-emergency
                  display: MEDICAL_NON_EMERGENCY
                text: MEDICAL_NON_EMERGENCY
              supportingInformation:
              - identifier:
                  system: NEW_PATIENT
                  value: 'true'
                display: 'New Patient: true'
              start: '2026-06-26T16:30:00.000+00:00'
              end: '2026-06-26T17:00:00.000+00:00'
              minutesDuration: 30
              created: '2026-06-25T15:51:20+00:00'
              participant:
              - actor:
                  reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
                  display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
              - actor:
                  reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/450858
                  display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/450858
              - actor:
                  reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375397
                  display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375397
      responses:
        '200':
          description: Updated
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/FHIR-JSON-RESOURCE'
              example:
                resourceType: Appointment
                id: '328983'
                status: booked
                appointmentType:
                  coding:
                  - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/appointment-type
                    code: '1959'
                    display: Surgery
                  text: Surgery
                reasonCode:
                - coding:
                  - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/reportable-reason
                    code: Medical Non-emergency
                    display: MEDICAL_NON_EMERGENCY
                  text: MEDICAL_NON_EMERGENCY
                supportingInformation:
                - identifier:
                    system: NEW_PATIENT
                    value: 'true'
                  display: 'New Patient: true'
                start: '2026-06-26T16:30:00.000+00:00'
                end: '2026-06-26T17:00:00.000+00:00'
                minutesDuration: 30
                created: '2026-06-25T15:51:20+00:00'
                participant:
                - actor:
                    reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
                    display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
                - actor:
                    reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/450858
                    display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/450858
                - actor:
                    reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375397
                    display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375397
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /fhir/v2/Appointment:
    get:
      tags:
      - Appointments and Slots
      summary: Retrieve All Appointments for a Practice/Firm
      parameters:
      - name: _count
        in: query
        description: Number of records to use as the page size for paginated search. The maximum page size for this Resource is 50
        required: false
        schema:
          type: string
      - name: _lastUpdated
        in: query
        description: This is an Optional Date in the format _lastUpdated=gtDATE, _lastUpdated=eqDATE and _lastUpdated=leDATE in the format yyyy-mm-dd
        required: false
        schema:
          type: string
          format: date
      - name: appointment-type
        in: query
        description: The style of appointment or patient that has been booked in the slot (not service type)
        required: false
        schema:
          type: string
      - name: created
        in: query
        description: Created date in format of yyyy-MM-dd'T'HH:mm:ss.SSSSSSSZ
        required: false
        schema:
          type: string
          format: date
      - name: date
        in: query
        description: Appointment date/time.
        required: false
        schema:
          type: string
          format: date
      - name: location
        in: query
        description: This location is listed in the participants of the appointment
        required: false
        schema:
          type: string
      - name: page
        in: query
        description: Page to be used for paginated search
        required: false
        schema:
          type: string
      - name: patient
        in: query
        description: One of the individuals of the appointment is this patient
        required: false
        schema:
          type: string
      - name: practitioner
        in: query
        description: One of the individuals of the appointment is this practitioner
        required: false
        schema:
          type: string
      - name: status
        in: query
        description: The overall status of the appointment
        required: false
        schema:
          type: string
      - name: supporting-info
        in: query
        description: Additional information to support the appointment
        required: false
        schema:
          type: string
      - name: Content-flag
        in: header
        required: false
        description: Optional header. `Referral` adds Referral Contact and Referral Source information to the Appointment payload.
        schema:
          type: string
          enum:
          - Referral
      responses:
        '200':
          description: Success
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/FHIR-JSON-RESOURCE'
              example:
                resourceType: Bundle
                id: 09f7a0bc-d577-4854-bcad-b54fa68749e4
                meta:
                  lastUpdated: '2026-06-25T14:56:06.963+00:00'
                type: searchset
                total: 2
                link:
                - relation: self
                  url: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Appointment?_count=2
                - relation: next
                  url: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Appointment?_count=2&page=2
                entry:
                - fullUrl: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Appointment/204865
                  resource:
                    resourceType: Appointment
                    id: '204865'
                    meta:
                      lastUpdated: '2025-05-15T18:02:15.000+00:00'
                    status: pending
                    appointmentType:
                      coding:
                      - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/appointment-type
                        code: '1957'
                        display: Follow-up
                      text: Follow-up
                    reasonCode:
                    - coding:
                      - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/reportable-reason
                        code: Other
                        display: OTHER
                      text: OTHER
                    supportingInformation:
                    - identifier:
                        system: NEW_PATIENT
                        value: 'false'
                      display: Example SupportingInformation
                    start: '2025-05-08T19:00:00.000+00:00'
                    end: '2025-05-08T19:10:00.000+00:00'
                    minutesDuration: 10
                    created: '2025-05-08T18:41:05+00:00'
                    participant:
                    - actor:
                        reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
                        display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
                    - actor:
                        reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/385871
                        display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/385871
                    - actor:
                        reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375399
                        display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375399
                - fullUrl: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Appointment/205149
                  resource:
                    resourceType: Appointment
                    id: '205149'
                    meta:
                      lastUpdated: '2025-10-14T01:23:10.000+00:00'
                    status: fulfilled
                    appointmentType:
                      coding:
                      - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/appointment-type
                        code: '1957'
                        display: Follow-up
                      text: Follow-up
                    reasonCode:
                    - coding:
                      - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/reportable-reason
                        code: Other
                        display: OTHER
                      text: OTHER
                    supportingInformation:
                    - identifier:
                        system: NEW_PATIENT
                        value: 'false'
                      display: Example SupportingInformation
                    start: '2025-05-12T12:00:00.000+00:00'
                    end: '2025-05-12T12:10:00.000+00:00'
                    minutesDuration: 10
                    created: '2025-05-09T16:32:26+00:00'
                    participant:
                    - actor:
                        reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
                        display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/827
                    - actor:
                        reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/385871
                        display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Patient/385871
                    - actor:
                        reference: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375399
                        display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/375399
            application/fhir+xml:
              schema:
                $ref: '#/components/schemas/FHIR-XML-RESOURCE'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
    post:
      tags:
      - Appointments and Slots
      summary: Create an Appointment
      requestBody:
        required: true
        content:
          application/fhir+json:
            schema:
              $ref: '#/components/schemas/FHIR-JSON-RESOURCE'
            example:
              resourceType: Appointment
              status: pending
              appointmentType:
                coding:
                - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/appointment-type
                  code: '1152'
                  display: New Patient
                text: New Patient
              reasonCode:
              - coding:
                - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/reportable-reason
                  code: Medical Non-emergency
                  display: MEDICAL_NON_EMERGENCY
                text: MEDICAL_NON_EMERGENCY
              start: '2019-09-25T20:00:00.000+00:00'
              end: '2019-09-25T20:15:00.000+00:00'
              minutesDuration: '15'
              participant:
              - actor:
                  reference: Patient/9487211
                  display: Test Sample
              - actor:
                  reference: Location/822
                  display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/822
              - actor:
                  reference: Practitioner/317044
                  display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/317044
      responses:
        '200':
          description: Success
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/FHIR-JSON-RESOURCE'
            application/fhir+xml:
              schema:
                $ref: '#/components/schemas/FHIR-XML-RESOURCE'
        '201':
          description: Created
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/FHIR-JSON-RESOURCE'
              example:
                resourceType: Appointment
                status: pending
                appointmentType:
                  coding:
                  - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/appointment-type
                    code: '1152'
                    display: New Patient
                  text: New Patient
                reasonCode:
                - coding:
                  - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/reportable-reason
                    code: Medical Non-emergency
                    display: MEDICAL_NON_EMERGENCY
                  text: MEDICAL_NON_EMERGENCY
                start: '2019-09-25T20:00:00.000+00:00'
                end: '2019-09-25T20:15:00.000+00:00'
                minutesDuration: '15'
                participant:
                - actor:
                    reference: Patient/9487211
                    display: Test Sample
                - actor:
                    reference: Location/822
                    display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Location/822
                - actor:
                    reference: Practitioner/317044
                    display: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Practitioner/317044
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-readme:
        explorer-enabled: false
  /fhir/v2/Slot:
    get:
      tags:
      - Appointments and Slots
      summary: Search for a slot
      parameters:
      - name: appointment-type
        in: query
        description: The style of appointment or patient that may be booked in the slot
        required: true
        schema:
          type: string
      - name: date
        in: query
        description: The param "date" supports date with prefix of eq in yyyy-MM-dd'T'HH:mm:ss.SSSSSSSZ format AND date range with start date with ge prefix and yyyy-MM-dd'T'HH:mm:ss.SSSSSSSZ format and end date with le prefix and yyyy-MM-dd'T'HH:mm:ss.SSSSSSSZ format
        required: false
        schema:
          type: string
          format: date
      - name: identifier
        in: query
        description: List of identifiers to search by for Slots. Valid Identifier Systems are PRN with a system value of https://www.hl7.org/fhir/v2/0203/index.html#v2-0203-PRN which is used for Provider id,  FI with a system value of https://www.hl7.org/fhir/v2/0203/index.html#v2-0203-FI which is used for Location id
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/FHIR-JSON-RESOURCE'
              example:
                resourceType: Bundle
                id: 3e9ef3b4-70db-41be-bb3e-fe01eaaeca60
                meta:
                  lastUpdated: '2026-06-25T16:22:41.214+00:00'
                type: searchset
                total: 2
                link:
                - relation: self
                  url: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Slot?appointment-type=1957&identifier=http%3A%2F%2Fwww.hl7.org%2Ffhir%2Fv2%2F0203%2Findex.html%23v2-0203-PRN%7C450861&date=ge2026-07-06T00%3A00%3A00.000Z&date=le2026-07-11T00%3A00%3A00.000Z&_count=2
                entry:
                - fullUrl: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Slot/fc7bd826-8ed8-443e-86df-f46eb2b9d5e0
                  resource:
                    resourceType: Slot
                    id: fc7bd826-8ed8-443e-86df-f46eb2b9d5e0
                    identifier:
                    - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/appointment-type
                      value: '1957'
                    - system: http://www.hl7.org/fhir/v2/0203/index.html#v2-0203-FI
                      value: '826'
                    - system: http://www.hl7.org/fhir/v2/0203/index.html#v2-0203-PRN
                      value: '450861'
                    schedule:
                      display: Available Slot for Frederick Frankenstein at Main Street Clinic
                    status: free
                    start: '2026-07-06T12:20:00.000+00:00'
                    end: '2026-07-06T12:30:00.000+00:00'
                - fullUrl: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/Slot/e141b829-13b4-4101-9ec3-9f3733240fbf
                  resource:
                    resourceType: Slot
                    id: e141b829-13b4-4101-9ec3-9f3733240fbf
                    identifier:
                    - system: https://stage.ema-api.com/ema-dev/firm/apiportal/ema/fhir/v2/ValueSet/appointment-type
                      value: '1957'
                    - system: http://www.hl7.org/fhir/v2/0203/index.html#v2-0203-FI
                      value: '826'
                    - system: http://www.hl7.org/fhir/v2/0203/index.html#v2-0203-PRN
                      value: '450861'
                    schedule:
                      display: Available Slot for Frederick Frankenstein at Main Street Clinic
                    status: free
                    start: '2026-07-06T12:45:00.000+00:00'
                    end: '2026-07-06T12:55:00.000+00:00'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  responses:
    Unauthorized:
      description: NOT AUTHORIZED - Authentication error; this token is not allowed access to the API
    TooManyRequests:
      description: TOO MANY REQUESTS - Request was rate limited (1000 calls/min default); please retry
    ServerError:
      description: SERVER ERROR - Internal Server Error
    BadRequest:
      description: BAD REQUEST - The request was bad, often due to a missing required parameter
    NotFound:
      description: NOT FOUND
    UnprocessableEntity:
      description: UNPROCESSABLE ENTITY - Request could not be processed; typically a validation error
    Forbidden:
      description: FORBIDDEN
  schemas:
    FHIR-XML-RESOURCE:
      type: object
      description: A FHIR resource
    FHIR-JSON-RESOURCE:
      type: object
      description: A FHIR resource
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'OAuth2 access token (JWT). Obtain it via the legacy `password` grant or the new `client_credentials` flow (see the **Authentication** guide), then send as `Authorization: Bearer <token>`.'
      x-default: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhN2NiZmYwZWUxYjk0ODkwOWMxZmQzYzk3ODhlZjc1NCIsImlzcyI6Im1vZG1lZCIsInN1YiI6ImZoaXJfUWZMbG8iLCJ1cmxQcmVmaXgiOiJhcGlwb3J0YWwiLCJ0b2tlblR5cGUiOiJhY2Nlc3MiLCJ2ZW5kb3IiOiJmaGlyX1FmTGxvQGFwaXBvcnRhbCIsInBvbCI6ImNoYW5nZW1lIn0.f0VcA3R56IuAvdbPhInqUbhmEwk-tiOIeELVpTZCUZ8
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Shared **sandbox** API key (public sandbox only). Send as the `x-api-key` header.


        `Zt9tXPIgz17uxEU6gkZPWa3ZAFhZOqm04oEDHC1f`'
      x-default: Zt9tXPIgz17uxEU6gkZPWa3ZAFhZOqm04oEDHC1f