Zocdoc reference API

Endpoints to retrieve information about the developer's directory.

OpenAPI Specification

zocdoc-reference-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: '1.176'
  title: API Documentation appointments reference API
  description: Endpoints for booking, cancelling, and rescheduling appointments, including retrieving current appointment statuses and updated information.
servers:
- url: https://api-developer-sandbox.zocdoc.com
  description: Sandbox
- url: https://api-developer.zocdoc.com
  description: Production
tags:
- name: reference
  description: Endpoints to retrieve information about the developer's directory.
  x-displayName: NPIs
paths:
  /v1/reference/npi:
    get:
      tags:
      - reference
      summary: Get active provider NPIs
      description: 'Retrieves the list of active provider NPIs within the developer''s Zocdoc directory. The NPIs retrieved here can be used to search for providers in the /v1/providers endpoint to facilitate availability, discovery, and booking.


        Developers can fetch the NPI list and cache in their system. The available NPIs do not change frequently. Pulling this data once a week and/or after known directory change events should be sufficient.

        '
      security:
      - ClientCredentialsFlow: []
      - AuthorizationCodeFlow: []
      operationId: getProviderNpis
      parameters:
      - name: page
        in: query
        description: The zero indexed page of results. A mimimum value of 0 will be accepted.
        schema:
          type: integer
      - name: page_size
        in: query
        description: The number of results to return per page. A mimimum value of 1 and a maximum of 60000 will be accepted.
        schema:
          type: integer
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderNpiResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
  /v1/specialties:
    get:
      tags:
      - reference
      summary: Get specialties
      description: Get specialties with optional filtering by care category
      security:
      - ClientCredentialsFlow: []
      - AuthorizationCodeFlow: []
      operationId: getSpecialties
      parameters:
      - name: page
        in: query
        description: The zero indexed page of results. Default is 0. Maximum is 200.
        schema:
          type: integer
          minimum: 0
          maximum: 200
      - name: page_size
        in: query
        description: The number of results to return per page. Default is 100. Maximum is 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: care_category
        in: query
        description: Filter by care category
        schema:
          $ref: '#/components/schemas/CareCategory'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpecialtiesResponse'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
  /v1/specialties/{specialty_id}:
    get:
      tags:
      - reference
      summary: Get specialty by id
      description: Get specialty by id
      security:
      - ClientCredentialsFlow: []
      - AuthorizationCodeFlow: []
      operationId: getSpecialtyById
      parameters:
      - name: specialty_id
        in: path
        required: true
        description: Zocdoc specialty id
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpecialtyByIdResponse'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
  /v1/visit_reasons:
    get:
      tags:
      - reference
      summary: Get visit reasons
      description: Get visit reasons with optional filtering by specialty
      security:
      - ClientCredentialsFlow: []
      - AuthorizationCodeFlow: []
      operationId: getVisitReasons
      parameters:
      - name: page
        in: query
        description: The zero indexed page of results. Default is 0. Maximum is 200.
        schema:
          type: integer
          minimum: 0
          maximum: 200
      - name: page_size
        in: query
        description: The number of results to return per page. Default is 100. Maximum is 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: specialty_id
        in: query
        description: Filter by primary specialty id
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VisitReasonsResponse'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
  /v1/visit_reasons/{visit_reason_id}:
    get:
      tags:
      - reference
      summary: Get visit reason by id
      description: Get visit reason by id
      security:
      - ClientCredentialsFlow: []
      - AuthorizationCodeFlow: []
      operationId: getVisitReasonById
      parameters:
      - name: visit_reason_id
        in: path
        required: true
        description: Zocdoc visit reason id (format `pc_*`, e.g. `pc_TlZW-r06U0W3pCsIGtSI5B`).
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VisitReasonByIdResponse'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
components:
  schemas:
    ErrorType:
      type: string
      enum:
      - api_error
      - invalid_request
    BaseResult:
      required:
      - request_id
      type: object
      properties:
        request_id:
          type: string
          description: Unique request identifier for tracing
    PaginatedBaseResult:
      allOf:
      - $ref: '#/components/schemas/BaseResult'
      - type: object
        required:
        - page
        - page_size
        - total_count
        - next_url
        properties:
          page:
            description: The zero based index of the current page.
            type: integer
          page_size:
            description: The size of the current page.
            type: integer
          total_count:
            description: The total number of result items.
            type: integer
          next_url:
            description: A link to the next page of results; null if this is the last page of results.
            type: string
    ProviderNpiResponse:
      allOf:
      - $ref: '#/components/schemas/PaginatedBaseResult'
      - type: object
        required:
        - data
        properties:
          data:
            $ref: '#/components/schemas/ProviderNpis'
    ProviderNpis:
      type: object
      properties:
        npis:
          type: array
          items:
            type: string
    VisitReasonByIdResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/BaseResult'
      - type: object
        required:
        - data
        properties:
          data:
            $ref: '#/components/schemas/VisitReasonData'
    SpecialtiesResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/PaginatedBaseResult'
      - type: object
        required:
        - data
        properties:
          data:
            type: array
            items:
              $ref: '#/components/schemas/SpecialtyData'
    VisitReasonData:
      type: object
      required:
      - id
      - name
      - specialty_id
      properties:
        id:
          type: string
          description: Zocdoc visit reason id
        name:
          type: string
        specialty_id:
          type: string
          description: Zocdoc specialty id this visit reason belongs to
    VisitReasonsResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/PaginatedBaseResult'
      - type: object
        required:
        - data
        properties:
          data:
            type: array
            items:
              $ref: '#/components/schemas/VisitReasonData'
    Error:
      required:
      - message
      type: object
      properties:
        field:
          type: string
        message:
          type: string
    SpecialtyByIdResponse:
      type: object
      allOf:
      - $ref: '#/components/schemas/BaseResult'
      - type: object
        required:
        - data
        properties:
          data:
            $ref: '#/components/schemas/SpecialtyData'
    SpecialtyData:
      type: object
      required:
      - id
      - name
      - care_category
      - default_visit_reason_id
      - default_visit_reason_name
      properties:
        id:
          type: string
          description: Zocdoc specialty id
        name:
          type: string
        care_category:
          $ref: '#/components/schemas/CareCategory'
        default_visit_reason_id:
          type: string
        default_visit_reason_name:
          type: string
    CareCategory:
      type: string
      description: "The category of care for an insurance plan\n  * Health: Health and Mental Health Care\n  * Dental: Dental Care\n  * Vision: Vision Care\n"
      enum:
      - health
      - dental
      - vision
    ErrorResult:
      allOf:
      - $ref: '#/components/schemas/BaseResult'
      - type: object
        required:
        - error_type
        - errors
        properties:
          error_type:
            $ref: '#/components/schemas/ErrorType'
          errors:
            type: array
            items:
              $ref: '#/components/schemas/Error'
  securitySchemes:
    ClientCredentialsFlow:
      type: oauth2
      description: 'Machine to machine authentication (for use from client server to Zocdoc).

        Production: `https://auth.zocdoc.com/oauth/token`

        Sandbox: `https://auth-api-developer-sandbox.zocdoc.com/oauth/token`

        '
      flows:
        clientCredentials:
          tokenUrl: https://auth.zocdoc.com/oauth/token
          scopes:
            external.credential.rotate: Rotate the authenticated client secret.
            external.appointment.write: Book and modify appointments.
            external.appointment.read: Read basic details of your appointments.
            external.anonymous_token.write: Create anonymous tokens used for discovery endpoints.
            external.provider_insurance.write: Update the insurance accepted by a provider.
            external.schedulable_entity.read: Read schedulable entities.
    AuthorizationCodeFlow:
      type: oauth2
      description: 'Log in as a user. Client Secret is not necessary for this login flow.

        Production: `https://auth.zocdoc.com`

        Sandbox: `https://auth-api-developer-sandbox.zocdoc.com`

        '
      flows:
        authorizationCode:
          x-usePkce: true
          tokenUrl: https://auth.zocdoc.com/oauth/token
          authorizationUrl: https://auth.zocdoc.com/authorize
          scopes:
            external.appointment.write: Book and modify appointments.
            external.appointment.read: Read basic details of your appointments.
            external.schedulable_entity.read: Read schedulable entities.