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

# Create Lead

> Creates a new lead



## OpenAPI

````yaml /uk/openapi.json post /external/v1/leads
openapi: 3.1.0
info:
  title: OpenAPI ClinicOS
  description: ClinicOS OpenAPI Documentation
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://uk.api.aiosmedical.com
security: []
paths:
  /external/v1/leads:
    post:
      tags:
        - Leads
      summary: Create Lead
      description: Creates a new lead
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLeadPayload'
      responses:
        '200':
          description: Lead created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lead'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 400
                  error:
                    type: object
                    properties:
                      message:
                        type: array
                        items:
                          type: string
                        example:
                          - email must be an email
                      error:
                        type: string
                        example: Bad Request
                      statusCode:
                        type: number
                        example: 400
                  timestamp:
                    type: string
                    example: '2025-06-04T12:00:00.000Z'
                  path:
                    type: string
                    example: /external/v1/leads
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 500
                  error:
                    type: string
                    example: Internal Server Error
                  timestamp:
                    type: string
                    example: '2025-06-04T12:00:00.000Z'
                  path:
                    type: string
                    example: /external/v1/leads
components:
  schemas:
    CreateLeadPayload:
      type: object
      properties:
        email:
          type: string
          format: email
          example: test@example.com
        data:
          type: object
          properties:
            surname:
              type: string
              example: Doe
            forename:
              type: string
              example: John
            phone:
              type: string
              example: +44 7700 900123
            gender:
              type: string
              example: Male
            ethnicity:
              type: string
              example: White British
            dateOfBirth:
              type: string
              example: '1990-01-01'
            billingAddress:
              $ref: '#/components/schemas/AddressDto'
            shippingAddress:
              $ref: '#/components/schemas/AddressDto'
            height:
              $ref: '#/components/schemas/HeightDto'
            weight:
              $ref: '#/components/schemas/WeightDto'
            goalWeight:
              $ref: '#/components/schemas/WeightDto'
            prescriptionMedication:
              type: array
              items:
                $ref: '#/components/schemas/PrescriptionMedicationDto'
            surgeries:
              type: array
              items:
                $ref: '#/components/schemas/SurgeryDto'
            weightLossInjections:
              $ref: '#/components/schemas/WeightLossInjectionDto'
            allergicReactionToWeightLossInjections:
              $ref: '#/components/schemas/AllergicReactionDto'
            medicalConditions:
              type: array
              items:
                $ref: '#/components/schemas/MedicalConditionDto'
            healthConditions:
              type: array
              items:
                $ref: '#/components/schemas/MedicalConditionDto'
            familyHistoryOfMedicalConditions:
              $ref: '#/components/schemas/FamilyHistoryDto'
            allergyToMedicationOrSupplement:
              type: string
              example: Penicillin
    Lead:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
        email:
          type: string
          example: test@example.com
        data:
          type: object
          example:
            name: John Doe
            email: test@example.com
            phone: '1234567890'
            address: 123 Main St, Anytown, USA
        createdAt:
          type: string
          example: '2025-06-04T12:00:00.000Z'
    AddressDto:
      type: object
      properties:
        addressLine1:
          type: string
          example: 123 High Street
        addressLine2:
          type: string
          example: Flat 2B
        city:
          type: string
          example: London
        state:
          type: string
          example: England
        region:
          type: string
          example: Greater London
        zipCode:
          type: string
          example: SW1A 1AA
    HeightDto:
      type: object
      properties:
        unit:
          type: string
          example: metric
        feet:
          type: string
          example: '5'
        inches:
          type: string
          example: '10'
        cm:
          type: string
          example: '178'
    WeightDto:
      type: object
      properties:
        unit:
          type: string
          example: metric
        kg:
          type: string
          example: '75'
        stones:
          type: string
          example: '11'
        pounds:
          type: string
          example: '165'
    PrescriptionMedicationDto:
      type: object
      properties:
        medication:
          type: string
          example: Metformin
        reason:
          type: string
          example: Type 2 Diabetes
    SurgeryDto:
      type: object
      properties:
        value:
          type: string
          example: Appendectomy
        intervalTime:
          type: string
          example: 2 years ago
        details:
          type: string
          example: Laparoscopic appendectomy, no complications
    WeightLossInjectionDto:
      type: object
      properties:
        drugName:
          type: string
          example: Ozempic
        strength:
          type: string
          example: 1mg
        weightPriorToTreatment:
          type: string
          example: 85kg
    AllergicReactionDto:
      type: object
      properties:
        description:
          type: string
          example: Nausea and dizziness after injection
    MedicalConditionDto:
      type: object
      properties:
        condition:
          type: string
          example: Diabetes
        desc:
          type: string
          example: Type 2 diabetes diagnosed in 2020
        kidneyDiseaseType:
          type: string
          example: Chronic kidney disease stage 3
    FamilyHistoryDto:
      type: object
      properties:
        value:
          type: string
          example: Heart disease
        relation:
          type: string
          example: Father

````