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

# Patch contact fields

> Partial-updates the contact: resolves pipeline stage / status pairs, normalizes phone numbers (rejecting provisioned org SMS numbers), records pipeline transitions, logs manual events with field-level diffs, and emits `contact_updated`. Used by the inline contact-edit panel.



## OpenAPI

````yaml /api-reference/openapi.yaml patch /api/contacts/{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/contacts/{id}:
    patch:
      tags:
        - Contacts
      summary: Patch contact fields
      description: >-
        Partial-updates the contact: resolves pipeline stage / status pairs,
        normalizes phone numbers (rejecting provisioned org SMS numbers),
        records pipeline transitions, logs manual events with field-level diffs,
        and emits `contact_updated`. Used by the inline contact-edit panel.
      operationId: patch_contact_field
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchContactRequest'
      responses:
        '200':
          description: Contact updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactMutationSuccessEnvelope'
        '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:
    PatchContactRequest:
      type: object
      properties:
        status:
          type: string
          description: >-
            New pipeline status name; resolved alongside `pipelineStage` and
            recorded as a pipeline transition.
        pipelineStage:
          type: string
          nullable: true
          description: >-
            Stage `_id`. `null` clears the stage; legacy status updates without
            a resolvable stage fall back to null.
        pipelineId:
          type: string
          description: Optional pipeline `_id` scoping stage/status resolution.
        phoneNumber:
          type: array
          items:
            $ref: '#/components/schemas/ContactPhoneNumber'
          description: >-
            Replacement phone-number list; normalized to E.164 and rejected if
            any value is a provisioned org SMS number.
      additionalProperties: true
      example:
        status: Qualified
        pipelineStage: 64f0a1b2c3d4e5f6a7b8c9d2
    ContactMutationSuccessEnvelope:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            contact:
              $ref: '#/components/schemas/ContactDto'
            message:
              type: string
          required:
            - contact
          additionalProperties: true
        message:
          type: string
        contact:
          $ref: '#/components/schemas/ContactDto'
      required:
        - success
        - data
      additionalProperties: true
      example:
        success: true
        message: Contact updated successfully
        data:
          contact:
            _id: 64f0a1b2c3d4e5f6a7b8c9d0
            firstName: Jane
            lastName: Doe
            status: Qualified
          message: Contact updated successfully
    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
    ContactPhoneNumber:
      type: object
      properties:
        value:
          type: string
        isPrimary:
          type: boolean
      required:
        - value
      additionalProperties: true
      example:
        value: '+14165550100'
        isPrimary: true
    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'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````