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

# Add Lead to Campaign

> Adds a single lead to a lead source (campaign). Supports three import types: **username** (Twitter handle), **profile_url** (x.com profile URL), or **json** (full Twitter user object).

**Lead Credits:** Adding a lead by `username` or `profile_url` consumes **Lead Credits**, as the system looks up the Twitter profile. Adding by `json` does not consume Lead Credits.

Adds a single lead to a lead source (campaign). You can add a lead in three ways:

* By username — Pass a Twitter username; the system looks up the profile. Consumes Lead Credits.
* By profile URL — Pass an x.com profile URL (e.g. `https://x.com/username`); the username is extracted and the profile is looked up. Consumes Lead Credits.
* By JSON — Pass a full Twitter user object. Does not consume Lead Credits.

<Info>
  The `username` and `profile_url` import options use Lead Credits. Use `json` when you already have the user data (e.g., via the enrichment API) to avoid spending Lead Credits.
</Info>


## OpenAPI

````yaml POST /lead-sources/{id}/lead
openapi: 3.0.1
info:
  title: Drippi Public API
  description: API for accessing Drippi automation and lead management data
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.drippi.ai/api/v1
    description: Production API server
security:
  - apiKeyAuth: []
paths:
  /lead-sources/{id}/lead:
    post:
      tags:
        - Lead Sources
      summary: Add lead to campaign
      description: >-
        Adds a single lead to a lead source (campaign). Supports three import
        types: **username** (Twitter handle), **profile_url** (x.com profile
        URL), or **json** (full Twitter user object).


        **Lead Credits:** Adding a lead by `username` or `profile_url` consumes
        **Lead Credits**, as the system looks up the Twitter profile. Adding by
        `json` does not consume Lead Credits.
      parameters:
        - name: id
          in: path
          description: Lead Source ID (campaign ID)
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddLeadToCampaignRequest'
      responses:
        '200':
          description: Lead added successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
                    example: Lead added successfully
                  lead:
                    description: Lead data (for username/profile_url imports)
                  data:
                    description: Response data (for json import)
        '400':
          description: Invalid request data or invalid x.com profile URL format
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Lead source not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded (5,000 requests per minute per API key)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AddLeadToCampaignRequest:
      oneOf:
        - $ref: '#/components/schemas/AddLeadByUsername'
        - $ref: '#/components/schemas/AddLeadByProfileUrl'
        - $ref: '#/components/schemas/AddLeadByJson'
      description: >-
        Request body for adding a lead. Use one of: username (consumes Lead
        Credits), profile_url (consumes Lead Credits), or json (no Lead
        Credits).
    Error:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Something went wrong
    RateLimitError:
      type: object
      properties:
        code:
          type: string
          example: RATE_LIMITED
        message:
          type: string
          example: Rate limit exceeded
        ratelimit:
          type: object
          properties:
            remaining:
              type: integer
              description: Remaining requests
            limit:
              type: integer
              description: Total limit
            duration:
              type: integer
              description: Duration in milliseconds
            reset:
              type: integer
              description: Reset timestamp
    AddLeadByUsername:
      type: object
      required:
        - importType
        - username
      properties:
        importType:
          type: string
          enum:
            - username
          description: Import by Twitter username. Consumes Lead Credits.
        username:
          type: string
          description: Twitter username (without @)
        customVariables:
          type: object
          additionalProperties:
            type: string
          description: Optional key-value pairs for personalization
    AddLeadByProfileUrl:
      type: object
      required:
        - importType
        - url
      properties:
        importType:
          type: string
          enum:
            - profile_url
          description: Import by x.com profile URL. Consumes Lead Credits.
        url:
          type: string
          format: uri
          description: Full x.com profile URL, e.g. https://x.com/username
        customVariables:
          type: object
          additionalProperties:
            type: string
          description: Optional key-value pairs for personalization
    AddLeadByJson:
      type: object
      required:
        - importType
        - json
      properties:
        importType:
          type: string
          enum:
            - json
          description: Import by full Twitter user object. Does not consume Lead Credits.
        json:
          $ref: '#/components/schemas/DrippiTwitterUser'
          description: Full Twitter user object
        customVariables:
          type: object
          additionalProperties:
            type: string
          description: Optional key-value pairs for personalization
    DrippiTwitterUser:
      type: object
      required:
        - id
        - name
        - username
        - created_at
        - profile_image_url
        - public_metrics
      properties:
        id:
          type: string
          description: Twitter user ID
        name:
          type: string
          description: Display name
        username:
          type: string
          description: Twitter username
        created_at:
          type: string
          description: Account creation date (ISO 8601)
        protected:
          type: boolean
          nullable: true
        location:
          type: string
          nullable: true
        url:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        verified:
          type: boolean
          nullable: true
        entities:
          type: object
        profile_image_url:
          type: string
        public_metrics:
          type: object
          properties:
            followers_count:
              type: integer
            following_count:
              type: integer
            tweet_count:
              type: integer
            listed_count:
              type: integer
        pinned_tweet_id:
          type: string
          nullable: true
        gqlId:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````