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

# Create Lead



## OpenAPI

````yaml POST /leads
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /leads:
    post:
      tags:
        - Leads
      summary: Create lead
      operationId: createLead
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - phone_number
              properties:
                phone_number:
                  type: string
                  example: '+972501234567'
                name:
                  type: string
                  nullable: true
                email:
                  type: string
                  format: email
                  nullable: true
                tags:
                  type: array
                  items:
                    type: string
                  description: >-
                    Tag names to attach. Resolved to IDs server-side. Use
                    `tag_ids` to pass UUIDs directly.
                tag_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: >-
                    Tag IDs to attach. Use `tags` (names) or `tag_ids` (UUIDs),
                    not both.
                metadata:
                  type: object
      responses:
        '201':
          description: Lead created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lead'
        '409':
          description: A lead with this phone number already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Lead:
      type: object
      properties:
        id:
          type: string
          format: uuid
        phone_number:
          type: string
          example: '+972501234567'
        name:
          type: string
          nullable: true
        email:
          type: string
          format: email
          nullable: true
        source:
          type: string
          example: api
          description: >-
            How the lead was created: 'api', 'manual', or 'auto' (from inbound
            call).
        tags:
          type: array
          items:
            $ref: '#/components/schemas/LeadTag'
        long_term_context:
          type: string
          nullable: true
          description: >-
            AI memory for this lead. Injected into the agent's system prompt at
            call time when lead_memory_enabled is true on the agent.
        metadata:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
    LeadTag:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
          nullable: true
        color:
          type: string
          nullable: true
        sort_order:
          type: integer
        created_at:
          type: string
          format: date-time
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Yappr API key (e.g. `ypr_live_...`). Generate one in the dashboard
        under **Settings → API Keys**.

````