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

# Create a lead

> Creates a new lead



## OpenAPI

````yaml post /leads/create
openapi: 3.0.1
info:
  title: AttentPublicAPI
  version: '2024-05-17T21:09:13Z'
servers:
  - url: https://api.attent.app/v1
security: []
paths:
  /leads/create:
    post:
      description: Creates a new lead
      requestBody:
        description: Lead to create. Phone number must be unique.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/leadItem'
        required: true
      responses:
        '200':
          description: A lead has been successfully created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      Returns `"Lead created successfully."` if the lead was
                      created successfully.
                  id:
                    type: string
                    description: The ID of the lead that was created.
                example:
                  message: Lead created successfully.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                example:
                  message: Lead already exists.
        '403':
          $ref: '#/components/responses/403'
        '429':
          description: The maximum number of leads has been reached for this month.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                example:
                  message: Max leads reached for this month.
        '500':
          $ref: '#/components/responses/500'
      security:
        - api_key: []
components:
  schemas:
    leadItem:
      type: object
      properties:
        firstName:
          type: string
          description: The first name of the lead.
        lastName:
          type: string
          description: The last name of the lead.
        phone:
          $ref: '#/components/schemas/phoneProperty'
        customerProfile:
          type: string
          description: >-
            The name of the customer profile to which this lead should belong
            to.
        timeZone:
          type: string
          description: >-
            The timezone of the lead in tz database format (e.g.
            America/New_York, Europe/London).
        email:
          type: string
          description: >-
            The email address of the lead. Must be a valid email format (e.g.
            user@domain.com).
        outboundPhone:
          type: string
          description: >-
            The phone number to use for outbound texts and calls to this lead.
            Must be a phone number configured for your organization. If not
            specified, the organization default phone number will be used.
        additionalInfo:
          type: object
          description: >-
            An optional key-value object containing additional information to
            store with the lead.
        scheduledImportAt:
          type: string
          format: date-time
          description: >
            Optional. If set, the lead is imported now but the first outbound
            message is deferred until this time.

            Must be an ISO 8601 timestamp with seconds and an explicit timezone
            offset (e.g. `2027-12-15T18:30:00Z` or `2027-12-15T13:30:00-05:00`),
            must be strictly in the future, and must be no more than 365 days
            from now.

            When this is provided, it overrides your organization's
            business-hours, allowed-days, and holiday adjustments.
          example: '2027-12-15T18:30:00Z'
      required:
        - firstName
        - lastName
        - phone
        - customerProfile
      example:
        firstName: John
        lastName: Doe
        phone: '+15555555555'
        customerProfile: My Customer Profile
        timeZone: America/New_York
        email: example@gmail.com
        outboundPhone: '+15551234567'
        scheduledImportAt: '2027-12-15T18:30:00Z'
        additionalInfo:
          key1: value1
          key2: value2
    phoneProperty:
      type: string
      description: >
        The phone number must begin with an area code (+) and can contain
        digits, spaces, parentheses, and hyphens (e.g. +1 (555) 555-5555)
  responses:
    '403':
      description: Forbidden API key
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            example:
              message: Forbidden
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            example:
              message: Internal Server Error
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header

````