Zocdoc webhook API

Sandbox endpoints to mock webhook behavior

OpenAPI Specification

zocdoc-webhook-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: '1.176'
  title: API Documentation appointments webhook 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: webhook
  description: Sandbox endpoints to mock webhook behavior
  x-displayName: Webhook
paths:
  /v1/webhook/mock-request:
    post:
      tags:
      - webhook
      security:
      - ClientCredentialsFlow: []
      - AuthorizationCodeFlow: []
      operationId: mockWebhookRequest
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookMockDataRequest'
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookMockResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
      summary: Mock webhook request
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
    WebhookMockRequestData:
      type: object
      required:
      - data_type
      - appointment_data
      properties:
        data_type:
          type: string
        appointment_data:
          $ref: '#/components/schemas/WebhookMockAppointmentData'
    WebhookMockAppointmentData:
      type: object
      required:
      - appointment_id
      - appointment_updated_timestamp
      - appointment_update_type
      properties:
        appointment_id:
          type: string
        appointment_updated_timestamp:
          type: string
        appointment_update_type:
          $ref: '#/components/schemas/AppointmentUpdateType'
        changed_attributes:
          type: array
          items:
            $ref: '#/components/schemas/ChangedAttribute'
          description: Array of changed attributes when webhook is triggered due to attribute changes. Each object must contain at least an attribute_path indicating the changed field.
    ChangedAttribute:
      type: object
      required:
      - attribute_path
      properties:
        attribute_path:
          type: string
          description: The path to the changed attribute in dot notation (e.g., "appointment.start_time", "patient.uploaded_attachments")
          example: appointment.start_time
        attachment_type:
          type: string
          description: Required when attribute_path is "appointment.attachments", indicates the type of attachment
    AppointmentUpdateType:
      type: string
      enum:
      - updated
      - cancelled
      - created
    Error:
      required:
      - message
      type: object
      properties:
        field:
          type: string
        message:
          type: string
    WebhookMockDataRequest:
      type: object
      required:
      - webhook_url
      - webhook_key
      properties:
        webhook_url:
          type: string
          description: a valid url to receive the mock webhook request
        webhook_key:
          type: string
          description: a valid key for the signature in base64 format
        appointment_update_type:
          $ref: '#/components/schemas/AppointmentUpdateType'
    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'
    WebhookMockResponse:
      type: object
      required:
      - event_type
      - webhook_timestamp
      - data
      properties:
        event_type:
          type: string
        webhook_timestamp:
          type: string
        data:
          $ref: '#/components/schemas/WebhookMockRequestData'
  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.