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

# Map excess fields for contact payload

> Re-runs the AI lead-mapper on a contact's `misc` (excess) data to promote previously-unmapped values to first-class fields. Never overwrites an existing firstName/lastName/email; persists the remaining excess fields back to `misc`.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/contact/map-excess-data
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/map-excess-data:
    post:
      tags:
        - Contacts
      summary: Map excess fields for contact payload
      description: >-
        Re-runs the AI lead-mapper on a contact's `misc` (excess) data to
        promote previously-unmapped values to first-class fields. Never
        overwrites an existing firstName/lastName/email; persists the remaining
        excess fields back to `misc`.
      operationId: post_contact_map_excess_data
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MapExcessDataRequest'
      responses:
        '200':
          description: Mapped excess data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericObjectResponse'
        '400':
          description: Invalid payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
      security:
        - bearerAuth: []
components:
  schemas:
    MapExcessDataRequest:
      type: object
      properties:
        sourceText:
          type: string
          description: >-
            Raw lead text the AI mapper should re-parse into structured contact
            fields.
        existingSchema:
          type: object
          additionalProperties: true
          description: >-
            Field definitions describing the target schema the mapper should
            populate.
        mappedData:
          type: object
          additionalProperties: true
          description: >-
            Already-mapped first-class fields; the server protects these from
            being overwritten when re-mapping.
        excessData:
          type: object
          additionalProperties: true
          description: >-
            Previously-unmapped key/value pairs (from `misc`) to re-evaluate for
            promotion to first-class fields.
      additionalProperties: true
      example:
        sourceText: Jane Doe, +1-416-555-0100, jane@example.com, lead from referral
        existingSchema:
          firstName:
            type: string
          email:
            type: string
          phoneNumber:
            type: string
        mappedData:
          firstName: Jane
          email: jane@example.com
          phoneNumber: '+14165550100'
        excessData:
          note: lead from referral
    GenericObjectResponse:
      type: object
      additionalProperties: true
      example:
        success: true
        message: Excess data mapped 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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````