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

# Create a lead management configuration

> Creates a new LeadManagement configuration for the authenticated user. The configurationName must be unique per user (case-insensitive) and defaultProcess must resolve to an existing Prompt ID.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/lead-management
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/lead-management:
    post:
      tags:
        - Lead Management
      summary: Create a lead management configuration
      description: >-
        Creates a new LeadManagement configuration for the authenticated user.
        The configurationName must be unique per user (case-insensitive) and
        defaultProcess must resolve to an existing Prompt ID.
      operationId: post_lead_management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLeadManagementRequest'
      responses:
        '201':
          description: Configuration created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadManagementMutationResponse'
        '400':
          description: Validation error or duplicate name
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadManagementErrorResponse'
        '500':
          description: Error creating lead management
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadManagementErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateLeadManagementRequest:
      type: object
      properties:
        configurationName:
          type: string
        name:
          type: string
        description:
          type: string
        source:
          type: string
          default: Unassigned
        inboundEmail:
          type: string
          format: email
        initialStage:
          type: string
        defaultProcess:
          type: string
          description: Prompt ID (must exist).
        isAutopilot:
          type: boolean
          default: false
        allowRecontact:
          type: boolean
          default: false
        starterMessage:
          type: string
        costPerLead:
          type: number
          minimum: 0
          default: 0
        status:
          type: string
          enum:
            - active
            - inactive
          default: active
        pipelineId:
          type: string
        pipelineStage:
          type: string
        createApplication:
          type: boolean
          default: false
        applicationName:
          type: string
        applicationStatus:
          type: string
        applicationPipelineId:
          type: string
        applicationPipelineStage:
          type: string
        forwardToOutreach:
          type: boolean
          default: true
        useWorkflowOnly:
          type: boolean
          default: false
      required:
        - configurationName
        - initialStage
        - defaultProcess
      additionalProperties: true
      example:
        configurationName: Facebook Lead Ad Funnel
        source: Facebook Lead Ad
        inboundEmail: leads+fb@inbound.example.com
        initialStage: New Lead
        defaultProcess: 64eea1110000000000000001
        isAutopilot: true
        starterMessage: Hi {{firstName}}, thanks for your interest!
        costPerLead: 12.5
        status: active
        forwardToOutreach: true
    LeadManagementMutationResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/LeadManagementDto'
      required:
        - success
        - data
      additionalProperties: true
      example:
        success: true
        message: Lead management configuration created
        data:
          _id: 665f1a0c0e0a4b001a2c9f40
          configurationName: Facebook Lead Ad Funnel
          status: active
    LeadManagementErrorResponse:
      type: object
      description: Error envelope for `/api/lead-management` endpoints.
      properties:
        error:
          type: string
        message:
          type: string
        success:
          type: boolean
          enum:
            - false
      required:
        - error
      additionalProperties: true
      example:
        error: Lead management configuration not found
    LeadManagementDto:
      type: object
      properties:
        _id:
          type: string
        organizationId:
          type: string
        userId:
          type: string
        configurationName:
          type: string
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        source:
          type: string
        inboundEmail:
          type: string
          nullable: true
        initialStage:
          type: string
        defaultProcess:
          type: string
          description: Prompt ID used as the default process.
        isAutopilot:
          type: boolean
        allowRecontact:
          type: boolean
        starterMessage:
          type: string
          nullable: true
        costPerLead:
          type: number
          minimum: 0
        status:
          type: string
          enum:
            - active
            - inactive
        pipelineId:
          type: string
          nullable: true
        pipelineStage:
          type: string
          nullable: true
        createApplication:
          type: boolean
        applicationName:
          type: string
          nullable: true
        applicationStatus:
          type: string
          nullable: true
        applicationPipelineId:
          type: string
          nullable: true
        applicationPipelineStage:
          type: string
          nullable: true
        forwardToOutreach:
          type: boolean
        useWorkflowOnly:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
      example:
        _id: 665f1a0c0e0a4b001a2c9f40
        organizationId: 64ee9a8b1e7f2a0011223344
        userId: 64ee9a8b1e7f2a0011223399
        configurationName: Facebook Lead Ad Funnel
        name: FB Lead Ad
        description: Routes Facebook Lead Ad submissions through the warm-up sequence.
        source: Facebook Lead Ad
        inboundEmail: leads+fb@inbound.example.com
        initialStage: New Lead
        defaultProcess: 64eea1110000000000000001
        isAutopilot: true
        allowRecontact: false
        starterMessage: Hi {{firstName}}, thanks for your interest!
        costPerLead: 12.5
        status: active
        pipelineId: 64eea1110000000000000010
        pipelineStage: New Lead
        createApplication: false
        forwardToOutreach: true
        useWorkflowOnly: false
        createdAt: '2026-05-01T09:00:00.000Z'
        updatedAt: '2026-05-10T15:23:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````