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

# Update a contact

> Updates an existing contact by ID using the same upsert logic as `POST /api/contacts`.
The `_id` is taken from the URL — any `_id` in the body is ignored.

Accepts the same **native** or **legacy** body formats as `POST /api/contacts`.
Returns the updated, enriched contact.




## OpenAPI

````yaml /openapi.yaml post /api/contacts/{contactId}
openapi: 3.0.3
info:
  title: Aptly API
  version: '1.0'
  description: >
    The Aptly API lets you read and write cards on any Aptly board from external
    systems.


    All requests require an API key passed as the `x-token` header.

    API keys are scoped to your company and work across all boards.
servers:
  - url: https://core-api.getaptly.com
    description: Production
security:
  - ApiKeyHeader: []
paths:
  /api/contacts/{contactId}:
    post:
      tags:
        - Contacts
      summary: Update a contact
      description: >
        Updates an existing contact by ID using the same upsert logic as `POST
        /api/contacts`.

        The `_id` is taken from the URL — any `_id` in the body is ignored.


        Accepts the same **native** or **legacy** body formats as `POST
        /api/contacts`.

        Returns the updated, enriched contact.
      operationId: updateContact
      parameters:
        - name: contactId
          in: path
          required: true
          schema:
            type: string
          description: The contact's `_id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                firstname:
                  type: string
                lastname:
                  type: string
                email:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                  description: One or more email addresses.
                phone:
                  type: array
                  items:
                    type: object
                    properties:
                      number:
                        type: string
                      type:
                        type: string
                        enum:
                          - mobile
                          - work
                          - home
                typeId:
                  type: string
                  description: Contact type ID.
                contactType:
                  type: string
                  description: Contact type name (alternative to `typeId`).
                isCompany:
                  type: boolean
                title:
                  type: string
                company:
                  type: string
                imageUrl:
                  type: string
                  description: Absolute URL to a JPG or PNG photo.
                customFields:
                  type: object
                  description: Map of custom field ID to value.
            example:
              firstname: Jane
              lastname: Smith
              email: jane@example.com
      responses:
        '200':
          description: Updated contact.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          description: Invalid input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or missing API key.
      security:
        - ApiKeyHeader: []
        - DelegateToken: []
components:
  schemas:
    Contact:
      type: object
      properties:
        _id:
          type: string
          description: MongoDB ObjectId of the contact.
        uuid:
          type: string
        firstname:
          type: string
        lastname:
          type: string
        fullName:
          type: string
          description: >-
            Computed display name (first + last, or company name for org
            records).
        duogram:
          type: string
          description: Two-letter initials derived from first and last name.
        photoId:
          type: string
          nullable: true
        imageUrl:
          type: string
          nullable: true
          description: CDN thumbnail URL for the contact's photo, or null if none.
        email:
          type: string
        phone:
          type: string
        typeId:
          type: string
        companyId:
          type: string
        address:
          type: object
        title:
          type: string
        alerts:
          type: array
          items:
            type: object
        company:
          type: string
          description: Company name — populated when isCompany is true.
        isCompany:
          type: boolean
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-token
    DelegateToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Delegate token issued by the platform. Format: `DelegateToken <token>`'

````