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

# Create Patient

> Create a new patient.



## OpenAPI

````yaml POST /patients/create_patient
openapi: 3.1.0
info:
  title: IOLOKIS API
  description: You can use the REST API to manage your IOLOKIS account and resources.
  version: 1.0.0
servers:
  - url: https://api.iolokis.com
security:
  - bearerAuth: []
paths:
  /patients/create_patient:
    post:
      description: Create a new patient.
      requestBody:
        description: ''
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewPatient'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewPatientResponse'
        '400':
          description: Invalid input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing JWT token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Limit for the current plan has been reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    NewPatient:
      allOf:
        - type: object
          properties:
            first_name:
              type: string
            last_name:
              type: string
            age:
              type: integer
            gender:
              type: string
            dirPath:
              type: array
              items:
                type: string
              description: >-
                This is used for future compatibility with the file system.
                Include it empty.
            phone_number:
              type: string
            workspace_id:
              type: integer
        - required:
            - first_name
            - last_name
            - age
            - gender
            - phone_number
            - workspace_id
            - dirPath
          properties: {}
    NewPatientResponse:
      type: object
      required:
        - patientId
        - message
      properties:
        patientId:
          type: string
          format: uuid
        message:
          type: string
          description: Patient created successfully.
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message indicating the error
      required:
        - error
    UnauthorizedError:
      type: object
      properties:
        message:
          type: string
          description: Error message indicating missing authorization header
      required:
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````