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

# Create patient

> Create a patient.



## OpenAPI

````yaml POST /api/v2/patients/
openapi: 3.0.3
info:
  title: Spot API v2
  version: 2.0.0
  description: API Docs for Spot API
servers:
  - url: https://app.spotdx.com
    description: Production
security: []
paths:
  /api/v2/patients/:
    post:
      description: Create a patient.
      operationId: api_v2_create_patient
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePatient'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreatePatient'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreatePatient'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Patient'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    CreatePatient:
      $ref: '#/components/schemas/Patient'
    Patient:
      type: object
      properties:
        first_name:
          type: string
          description: The first name of the patient.
          example: Alice
        last_name:
          type: string
          description: The last name of the patient to be created.
          example: Smith
        email:
          type: string
          format: email
          description: The email of the patient to be created.
          example: alice123@gmail.com
        phone:
          type: string
          description: Optional phone number of the patient.
          example: '1234567890'
        sex:
          type: string
          description: The biological sex of the patient to be created.
          enum:
            - M
            - F
          example: F
        date_of_birth:
          type: string
          format: date
          description: The date of birth of the patient to be created.
      required:
        - date_of_birth
        - email
        - first_name
        - last_name
        - sex
    BadRequest:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              type: number
              example: 400
              enum:
                - 400
                - 401
                - 403
                - 404
                - 500
            type:
              type: string
              example: bad_request
              enum:
                - bad_request
                - not_found
                - unauthorized
                - forbidden
                - rate_limit_exceeded
                - internal_server_error
            detail:
              type: string
              example: The first_name field is required
      required:
        - error
    NotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              type: number
              example: 404
              enum:
                - 400
                - 401
                - 403
                - 404
                - 500
            type:
              type: string
              example: forbidden
              enum:
                - bad_request
                - not_found
                - unauthorized
                - forbidden
                - rate_limit_exceeded
                - internal_server_error
            detail:
              type: string
              example: Kit id SPOTZZZZZZ not found
      required:
        - error
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````