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

# Create lead

> Add a new lead to campaign



## OpenAPI

````yaml POST /v1/order/leads
openapi: 3.0.0
info:
  version: 1.0.0
  title: Adscrush CRM API
  description: API for managing leads in Adscrush CRM
  license:
    name: MIT
servers:
  - url: https://affilate.adscrush.com/api
security:
  - API_KEY: []
  - BearerToken: []
paths:
  /v1/order/leads:
    post:
      summary: Add a new lead to campaign
      description: Add a new lead to campaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewLead'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  lead:
                    $ref: '#/components/schemas/Lead'
        '400':
          $ref: '#/components/responses/ZodValidationError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - API_KEY: []
          BearerToken: []
components:
  schemas:
    NewLead:
      type: object
      properties:
        campaignCode:
          type: string
        name:
          type: string
          description: Name is required. The name of the lead.
        phone:
          type: string
          description: The phone number of the lead.
        address:
          type: string
          description: The address of the lead.
        email:
          type: string
          format: email
          pattern: \.[Ii][Oo]$
          description: Email for the lead. this field is optional
        country:
          type: string
          description: Country for the lead. this field is optional
        region:
          type: string
          description: Region for the lead. this field is optional
        city:
          type: string
          description: City for the lead. this field is optional
        street:
          type: string
          description: Street for the lead. this field is optional
        zipcode:
          type: string
          description: Zipcode for the lead. this field is optional
        website:
          type: string
          description: Website for the lead. this field is optional
        description:
          type: string
          description: Description for the lead. this field is optional
      required:
        - campaignCode
        - name
        - phone
    Lead:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the lead.
        ip:
          type: string
          description: The IP address associated with the lead.
        name:
          type: string
          description: The name of the lead.
        phone:
          type: string
          description: The phone number of the lead.
        address:
          type: string
          description: The address of the lead.
        state:
          type: string
          description: The state associated with the lead.
        region:
          type: string
          description: The region associated with the lead.
        country:
          type: string
          description: The country associated with the lead.
        status:
          type: string
          description: The status of the lead (e.g., OnHold, InProgress).
          enum:
            - OnHold
            - Trashed
            - Paid
            - Approved
        createdAt:
          type: string
          format: date-time
          description: The timestamp indicating when the lead was created.
        updatedAt:
          type: string
          format: date-time
          description: The timestamp indicating when the lead was last updated.
        campaignId:
          type: string
          description: The identifier of the campaign associated with the lead.
        userId:
          type: string
          description: The identifier of the user associated with the lead.
      required:
        - id
        - name
        - phone
        - createdAt
        - updatedAt
        - campaignId
        - userId
      description: Represents a lead in the Adscrush CRM system.
  responses:
    ZodValidationError:
      description: Zod Validation Error
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: validation
              message:
                type: string
                example: Invalid input data
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: unauthorized
              message:
                type: string
                example: Authentication failed
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                example: error
              message:
                type: string
                example: An unexpected error occurred
  securitySchemes:
    API_KEY:
      type: apiKey
      in: header
      name: API_KEY
      description: >-
        Your API key. Include this key in the `API_KEY` header when making
        requests to endpoints that require authentication. You can find your API
        key in the 'Profile' tab on the website.
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: bearer
      description: >-
        Your Bearer Token. Include this token in the 'Authorization' header as
        `Bearer <your_token>` when making requests to endpoints that require
        user authentication. You can view and manage your Bearer Token in the
        'Profile' tab on the website.

````