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

# Update a contact

> Updates a contact's display name and/or custom fields — useful for enriching contacts from a CRM. Custom fields are merged key by key: provided keys overwrite, a `null` value removes the key, and keys you don't send are kept. At least one of `name` or `customFields` is required.

Rate limit: 30 requests per minute.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/v1/contacts/{contactId}
openapi: 3.1.0
info:
  title: Adraa Inbox API
  description: >-
    Public REST API for Adraa Inbox. Assign agents to conversations and send
    messages from your own systems. Authenticate every request with a workspace
    API token.
  version: 1.0.0
  contact:
    email: support@adraa.ai
servers:
  - url: https://api.inbox.adraa.ai
    description: Production
security:
  - apiToken: []
paths:
  /api/v1/contacts/{contactId}:
    patch:
      summary: Update a contact
      description: >-
        Updates a contact's display name and/or custom fields — useful for
        enriching contacts from a CRM. Custom fields are merged key by key:
        provided keys overwrite, a `null` value removes the key, and keys you
        don't send are kept. At least one of `name` or `customFields` is
        required.


        Rate limit: 30 requests per minute.
      operationId: updateContact
      parameters:
        - $ref: '#/components/parameters/contactId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 120
                  description: New display name.
                  example: Sara Al-Harbi
                customFields:
                  type: object
                  description: >-
                    Keys to merge into the contact's custom fields (max 50 per
                    request). Values may be strings (max 500 chars), numbers,
                    booleans, or `null` to remove the key.
                  additionalProperties:
                    type:
                      - string
                      - number
                      - boolean
                      - 'null'
                  example:
                    crmId: LEAD-2041
                    plan: pro
                    legacyField: null
      responses:
        '200':
          description: The updated contact profile
          content:
            application/json:
              schema:
                type: object
                properties:
                  contact:
                    $ref: '#/components/schemas/ContactProfile'
                  flows:
                    type: array
                    items:
                      $ref: '#/components/schemas/FlowRun'
                  notes:
                    type: array
                    items:
                      $ref: '#/components/schemas/ContactNote'
        '400':
          description: Invalid body — neither name nor customFields provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ContactNotFound'
components:
  parameters:
    contactId:
      name: contactId
      in: path
      required: true
      description: ID of the contact. List contacts with `GET /api/v1/contacts` to find it.
      schema:
        type: string
        example: cmbxgy7kq0002ph01u2v3w4x5
  schemas:
    ContactProfile:
      type: object
      properties:
        id:
          type: string
          example: cmbxgy7kq0002ph01u2v3w4x5
        name:
          type: string
          example: Sara Al-Harbi
        email:
          type:
            - string
            - 'null'
          example: sara@example.com
        phone:
          type:
            - string
            - 'null'
          example: '+966501234567'
        countryIso:
          type:
            - string
            - 'null'
          example: SA
        avatarUrl:
          type:
            - string
            - 'null'
          example: null
        channels:
          type: array
          items:
            type: string
          example:
            - whatsapp
            - web
        conversationCount:
          type: integer
          example: 3
        openCount:
          type: integer
          example: 1
        firstContactAt:
          type: string
          format: date-time
          description: When the contact first messaged the workspace.
          example: '2026-04-18T09:12:00.000Z'
        customFields:
          type: object
          description: >-
            Free-form key/value data attached to the contact — set by the chat
            widget or through `PATCH /api/v1/contacts/{contactId}`.
          additionalProperties: true
          example:
            crmId: LEAD-2041
            plan: pro
    FlowRun:
      type: object
      properties:
        runId:
          type: string
          example: cmbxh4n3c0005ph01c0d1e2f3
        flowId:
          type: string
          example: cmbxh5o4d0006ph01g4h5i6j7
        flowName:
          type: string
          example: Order status lookup
        conversationId:
          type:
            - string
            - 'null'
          example: cmbxgz9pq0003ph01m4n5o6p7
        status:
          type: string
          description: Run status, e.g. `running`, `completed`, `failed`.
          example: completed
        startedAt:
          type: string
          format: date-time
          example: '2026-06-11T08:30:00.000Z'
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
          example: '2026-06-11T08:31:12.000Z'
    ContactNote:
      type: object
      properties:
        id:
          type: string
          example: cmbxh3m2b0004ph01y6z7a8b9
        body:
          type: string
          example: VIP customer — fast-track any shipping issues.
        createdAt:
          type: string
          format: date-time
          example: '2026-06-10T14:02:00.000Z'
        agent:
          type: object
          nullable: true
          description: >-
            The agent who wrote the note, or `null` when the note was added
            through the API (author shown as "API").
          properties:
            id:
              type: string
              example: cmbxgwq1e0000ph01i0j1k2l3
            nickname:
              type: string
              example: sara
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable explanation.
            details:
              description: Field-level details for validation errors.
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_API_TOKEN
              message: Invalid or revoked API token
    ContactNotFound:
      description: Contact does not exist or has never messaged this workspace
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: CONTACT_NOT_FOUND
              message: Contact not found
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer
      description: >-
        Workspace API token created in Settings → API. Tokens start with
        `adraa_`.

````