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

# Create a patient

> Create a new patient.

Returns **400** with `existing_patient_id` (and, if populated, `existing_patient_external_id`) when the create attempt is identified as a duplicate of an active patient.




## OpenAPI

````yaml /openapi-public.yml post /api/v1/patients
openapi: 3.0.3
info:
  title: Blend API
  version: 1.0.0
  description: API for Blend
servers:
  - url: https://api.byblend.com
    description: Blend production server
security:
  - bearerAuth: []
tags:
  - name: Orders
    description: Order management endpoints
  - name: Patients
    description: Patient management endpoints
  - name: Reports
    description: Reporting endpoints
  - name: Products and Materials
    description: Product catalog and inventory endpoints
  - name: Electronic Prescriptions
    description: Electronic prescription management endpoints
  - name: Prescriptions
    description: Prescription management endpoints
  - name: Authentication
    description: Authentication endpoints
  - name: Notifications
    description: User management endpoints
  - name: Prescribers
paths:
  /api/v1/patients:
    post:
      tags:
        - Patients
      summary: Create a patient
      description: >
        Create a new patient.


        Returns **400** with `existing_patient_id` (and, if populated,
        `existing_patient_external_id`) when the create attempt is identified as
        a duplicate of an active patient.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatientCreate'
      responses:
        '201':
          description: Patient created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientFull'
        '400':
          description: >
            Invalid payload or duplicate patient rejected within the same
            customer.


            Response JSON always includes `error` (string). For
            duplicate-patient rejects, the body also includes
            `existing_patient_id` (UUID string of the matched active patient).
            When that patient has an `external_id`,
            `existing_patient_external_id` is included; otherwise it is omitted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    description: Human-readable validation or duplicate-detection message.
                  existing_patient_id:
                    type: string
                    format: uuid
                    description: >-
                      Present only when creation was rejected as a duplicate;
                      Blend ID of the matched patient.
                  existing_patient_external_id:
                    type: string
                    description: >-
                      Present only on duplicate errors when the matched patient
                      has an external ID.
              examples:
                duplicatePatient:
                  summary: Duplicate patient (with ids for automation)
                  value:
                    error: >-
                      A patient with matching name and date of birth already
                      exists (Patient ID: cc9e7850-69de-4cb7-b930-05ab23210a4f,
                      Name: Veda Abbott). Please use the existing patient or
                      verify the information is correct.
                    existing_patient_id: cc9e7850-69de-4cb7-b930-05ab23210a4f
                duplicatePatientWithExternalId:
                  summary: Duplicate patient; matched record has external_id
                  value:
                    error: >-
                      A patient with matching external ID already exists
                      (Patient ID: cc9e7850-69de-4cb7-b930-05ab23210a4f, Name:
                      Veda Abbott). Please use the existing patient or verify
                      the information is correct.
                    existing_patient_id: cc9e7850-69de-4cb7-b930-05ab23210a4f
                    existing_patient_external_id: b658f16f-819c-4503-aede-bd555fc4ebfb
                validationOnly:
                  summary: Other validation error (no duplicate metadata)
                  value:
                    error: first_name is required
components:
  schemas:
    PatientCreate:
      title: New Patient
      allOf:
        - $ref: '#/components/schemas/PatientCreateUpdateBase'
      required:
        - first_name
        - last_name
        - email
        - phone
        - date_of_birth
        - address
    PatientFull:
      allOf:
        - $ref: '#/components/schemas/ID'
        - $ref: '#/components/schemas/Timestamps'
        - $ref: '#/components/schemas/PatientBase'
        - type: object
          properties:
            is_minor:
              type: boolean
              example: false
              description: >-
                Whether the patient is a minor. Automatically calculated based
                on date of birth.
    PatientCreateUpdateBase:
      type: object
      allOf:
        - $ref: '#/components/schemas/PatientBase'
        - type: object
          properties:
            risk_factors:
              type: object
              description: >-
                Raw text risk factors for the patient. These will be parsed and
                automatically matched to standardized risk factors. Please
                delimit with commas, semi-colons, or slashes. Discrete risk
                factors can be added using the dedicated endpoints.
              properties:
                allergies:
                  type: string
                  example: peanuts, tree nuts, shellfish
                conditions:
                  type: string
                  example: asthma, hypertension
                medications:
                  type: string
                  example: albuterol, levothyroxine
    ID:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
    Timestamps:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: Date and time of creation
          example: '2025-03-15T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Date and time of last update
          example: '2025-03-15T12:00:00Z'
    PatientBase:
      type: object
      properties:
        first_name:
          type: string
          example: Willard
        middle_name:
          type: string
          example: Moises
        last_name:
          type: string
          example: Donnelly
        gender:
          type: string
          enum:
            - male
            - female
          example: male
          description: Gender of the patient
        email:
          type: string
          example: Harmon43@gmail.com
        phone:
          type: string
          description: 10-digit phone number without formatting, e.g. 6417383445
          example: '6417383445'
        date_of_birth:
          type: string
          format: date
          example: '1990-01-01'
        driver_license_number:
          type: string
          example: B49188319
        driver_license_state:
          type: string
          example: CA
        ssn:
          type: string
          example: '123456789'
          description: Social Security number. Can be provided with or without hyphens.
        primary_language:
          type: string
          description: ISO 639-1 language code
          example: en
        guardian_name:
          type: string
          description: Name of the patient's guardian. Required if patient is a minor.
          example: John Guardian
        guardian_phone:
          type: string
          example: '6417383445'
        guardian_email:
          type: string
          example: parent@example.com
        guardian_relationship:
          type: string
          description: >-
            Relationship of the guardian to the patient. See relationship types
            lookup for available values; most common are `parent` and
            `legal_guardian`; and `other` can be used.
          example: parent
        height_inches:
          type: integer
          example: 72
          description: Height of the patient in inches
        weight_pounds:
          type: integer
          example: 180
          description: Weight of the patient in pounds
        external_id:
          type: string
          example: '1234567890'
          description: >-
            External (your own) ID for the patient, to be used for prescription
            matching
        is_smoker:
          type: boolean
          example: false
          description: Whether the patient is a smoker
        is_diabetic:
          type: boolean
          example: false
          description: Whether the patient is diabetic
        is_pregnant:
          type: boolean
          example: false
          description: Whether the patient is pregnant
        receive_sms:
          type: boolean
          example: true
          description: >-
            Whether the patient should receive SMS notifications for shipments.
            This is only applicable if you have authorized Blend to send patient
            communications on your behalf.
        receive_email:
          type: boolean
          example: true
          description: >-
            Whether the patient should receive email notifications for
            shipments. This is only applicable if you have authorized Blend to
            send patient communications on your behalf.
        address:
          $ref: '#/components/schemas/AddressCreate'
    AddressCreate:
      type: object
      required:
        - address_1
        - city
        - state
        - zip_code
      properties:
        address_1:
          type: string
          example: 140 Lindgren Streets
        address_2:
          type: string
          example: Apt 227
        city:
          type: string
          example: North Consueloburgh
        state:
          type: string
          description: Two-letter state abbreviation
          example: CA
        country:
          type: string
          description: Two-letter country code, defaults to US
          example: US
        zip_code:
          type: string
          description: 5-digit ZIP code or 9-digit ZIP+4 code, e.g. 02108 or 02108-1234.
          example: '02108'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````