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

# Add a doctor

> Only when your system is the master record (`external_master: true` on /me). Otherwise 403 `docistra_is_master`.



## OpenAPI

````yaml /openapi.json post /doctors
openapi: 3.1.0
info:
  title: Docistra API
  version: 1.0.0
  description: >-
    Connect your software to Docistra in both directions. All times are ISO
    8601; Docistra's clinics run on Cairo time (Africa/Cairo). Every path {id}
    takes Docistra's id or `ext:<your id>`.
servers:
  - url: https://docistra.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Organization
  - name: Patients
  - name: Appointments
  - name: Availability
  - name: Doctors
  - name: Doctor schedule
  - name: Branches
  - name: Reference data
  - name: Webhooks
paths:
  /doctors:
    post:
      tags:
        - Doctors
      summary: Add a doctor
      description: >-
        Only when your system is the master record (`external_master: true` on
        /me). Otherwise 403 `docistra_is_master`.
      operationId: createDoctor
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DoctorInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Doctor'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      schema:
        type: string
        maxLength: 255
      description: >-
        A unique value (e.g. a UUID) per operation. A retry with the same key
        returns the first response for 24 hours.
  schemas:
    DoctorInput:
      type: object
      properties:
        external_id:
          type:
            - string
            - 'null'
        name_ar:
          type:
            - string
            - 'null'
          description: 'Without a title: Docistra adds it.'
        name_en:
          type:
            - string
            - 'null'
        specialty_id:
          type:
            - string
            - 'null'
        session_minutes:
          type: integer
          minimum: 5
          maximum: 480
          multipleOf: 5
        consultation_price:
          type:
            - number
            - 'null'
        follow_up_price:
          type:
            - number
            - 'null'
        is_active:
          type: boolean
    Doctor:
      type: object
      properties:
        object:
          const: doctor
        id:
          type: string
          format: uuid
        external_id:
          type:
            - string
            - 'null'
        name_ar:
          type:
            - string
            - 'null'
        name_en:
          type:
            - string
            - 'null'
        specialty_id:
          type:
            - string
            - 'null'
        session_minutes:
          type: integer
        consultation_price:
          type:
            - number
            - 'null'
          description: EGP
        follow_up_price:
          type:
            - number
            - 'null'
          description: EGP
        is_active:
          type: boolean
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: slot_taken
      additionalProperties: true
  responses:
    Forbidden:
      description: >-
        API access not approved, or a write reserved for master-record
        organizations
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: >-
        The request clashes with the current state (slot taken, already linked,
        paid visit, ...)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key (dk_live_...), from Settings > Integrations > API in
        Docistra.

````

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