> ## 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.

# Update a lead management configuration

> Updates the LeadManagement configuration with the given id. Caller must own the configuration. Each field is validated independently; defaultProcess (when supplied) must resolve to an existing Prompt ID.



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/lead-management/{id}
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/{id}:
    put:
      tags:
        - Lead Management
      summary: Update a lead management configuration
      description: >-
        Updates the LeadManagement configuration with the given id. Caller must
        own the configuration. Each field is validated independently;
        defaultProcess (when supplied) must resolve to an existing Prompt ID.
      operationId: put_lead_management
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLeadManagementRequest'
      responses:
        '200':
          description: Configuration updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadManagementMutationResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadManagementErrorResponse'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadManagementErrorResponse'
        '404':
          description: Configuration not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadManagementErrorResponse'
        '500':
          description: Error updating lead management
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadManagementErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateLeadManagementRequest:
      type: object
      properties:
        configurationName:
          type: string
          description: Internal identifier for the Lead Management config.
        name:
          type: string
          description: Human-friendly display name surfaced in the UI.
        description:
          type: string
          description: Free-form notes describing this lead routing setup.
        source:
          type: string
          description: >-
            Lead source label attached to contacts matched by this config (e.g.
            `Facebook Lead Ad`).
        inboundEmail:
          type: string
          format: email
          description: Inbox address that ingests external emails for this configuration.
        initialStage:
          type: string
          description: Pipeline stage `_id` new leads enter when matched.
        defaultProcess:
          type: string
          description: Prompt `_id` used to drive the AI on matched leads.
        isAutopilot:
          type: boolean
          description: >-
            When true, the AI runs autonomously without rep approval on new
            leads.
        allowRecontact:
          type: boolean
          description: When true, allow re-contacting leads already in the system.
        starterMessage:
          type: string
          description: First outbound message sent on lead match; supports placeholders.
        costPerLead:
          type: number
          minimum: 0
          description: >-
            Cost (USD) attributed to each lead; powers the outreach metrics
            dashboard.
        status:
          type: string
          enum:
            - active
            - inactive
          description: Whether this config is currently routing leads.
        pipelineId:
          type: string
          description: Pipeline `_id` matched contacts are placed into.
        pipelineStage:
          type: string
          description: Pipeline stage matched contacts are placed into.
        createApplication:
          type: boolean
          description: When true, also creates an `Application` alongside the contact.
        applicationName:
          type: string
          description: Display name for the auto-created application.
        applicationStatus:
          type: string
          description: Initial status for the auto-created application.
        applicationPipelineId:
          type: string
          description: Pipeline `_id` the auto-created application is placed into.
        applicationPipelineStage:
          type: string
          description: Pipeline stage the auto-created application enters.
        forwardToOutreach:
          type: boolean
          description: When true, forwards leads to the outreach trigger pipeline.
        useWorkflowOnly:
          type: boolean
          description: >-
            When true, only execute matching workflows; skip the legacy
            autopilot path.
      additionalProperties: true
      example:
        isAutopilot: false
        costPerLead: 15
        status: inactive
    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

````