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

> Updates a contact identified by `_id` in the body. Resolves pipeline stage / status pairs to keep them in sync, records pipeline transitions, logs a manual event with field-level diffs, and emits the `contact_updated` socket event. Org-scoped unless caller is SUPERADMIN.



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/contact
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/contact:
    put:
      tags:
        - Contacts
      summary: Update contact
      description: >-
        Updates a contact identified by `_id` in the body. Resolves pipeline
        stage / status pairs to keep them in sync, records pipeline transitions,
        logs a manual event with field-level diffs, and emits the
        `contact_updated` socket event. Org-scoped unless caller is SUPERADMIN.
      operationId: put_contact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContactRequest'
      responses:
        '200':
          description: Contact updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyContactMutationResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
        '404':
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateContactRequest:
      type: object
      properties:
        _id:
          type: string
          description: Target contact `_id`; required to locate the document.
        fromHistoryModal:
          type: boolean
          description: >-
            Suppresses side-effects (audit log, socket emit) when the update
            originates from the history viewer.
        status:
          type: string
          description: New pipeline status name; resolved together with `pipelineStage`.
        pipelineStage:
          type: string
          nullable: true
          description: >-
            Stage `_id`. Set to `null` to clear the stage assignment (legacy
            status-only update).
        pipelineId:
          type: string
          description: >-
            Optional pipeline `_id` used to scope stage resolution; inferred
            from the resolved stage when omitted.
      required:
        - _id
      additionalProperties: true
      example:
        _id: 64f0a1b2c3d4e5f6a7b8c9d0
        status: Qualified
        pipelineStage: 64f0a1b2c3d4e5f6a7b8c9d2
        pipelineId: 64f0a1b2c3d4e5f6a7b8c9d1
    LegacyContactMutationResponse:
      type: object
      properties:
        message:
          type: string
        contact:
          $ref: '#/components/schemas/ContactDto'
        data: {}
        success:
          type: boolean
      additionalProperties: true
      example:
        message: Contact updated successfully
        success: true
        contact:
          _id: 64f0a1b2c3d4e5f6a7b8c9d0
          firstName: Jane
          lastName: Doe
    ApiErrorEnvelope:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
          required:
            - message
          additionalProperties: true
      required:
        - success
        - error
      additionalProperties: true
      example:
        success: false
        message: Contact not found
        error:
          code: NOT_FOUND
          message: Contact not found
    ContactDto:
      type: object
      properties:
        _id:
          type: string
        firstName:
          type: string
          nullable: true
        lastName:
          type: string
          nullable: true
        phoneNumber:
          nullable: true
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContactPhoneNumber'
        secondaryPhoneNumber:
          type: array
          nullable: true
          items:
            type: string
        email:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        pipelineId:
          type: string
          nullable: true
        pipelineStage:
          type: string
          nullable: true
        organizationId:
          type: string
          nullable: true
        userId:
          type: string
          nullable: true
        createdBy:
          type: string
          nullable: true
        assignees:
          type: array
          items: {}
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        existingConversationId:
          type: string
          nullable: true
          description: >-
            Set on responses from /api/contacts/inactive when called with
            includeExisting=true. Identifies the caller-accessible conversation
            in the requested channel; clients should route to this conversation
            instead of creating a new one.
      additionalProperties: true
      example:
        _id: 64f0a1b2c3d4e5f6a7b8c9d0
        firstName: Jane
        lastName: Doe
        phoneNumber:
          - value: '+14165550100'
            isPrimary: true
        secondaryPhoneNumber: []
        email: jane.doe@example.com
        status: New Lead
        pipelineId: 64f0a1b2c3d4e5f6a7b8c9d1
        pipelineStage: 64f0a1b2c3d4e5f6a7b8c9d2
        organizationId: 64f0a1b2c3d4e5f6a7b8c9d3
        userId: 64f0a1b2c3d4e5f6a7b8c9d4
        createdBy: 64f0a1b2c3d4e5f6a7b8c9d4
        assignees:
          - 64f0a1b2c3d4e5f6a7b8c9d4
        createdAt: '2026-05-01T14:30:00.000Z'
        updatedAt: '2026-05-15T09:12:00.000Z'
    ContactPhoneNumber:
      type: object
      properties:
        value:
          type: string
        isPrimary:
          type: boolean
      required:
        - value
      additionalProperties: true
      example:
        value: '+14165550100'
        isPrimary: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````