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

# Update a contact

> Change a person’s profile; it shows in every campaign they are in. The fields you send are written as given (`null` or an empty string clears one), the rest stay. Pass the `version` you read: if the contact changed since, the request fails with 409 `contact_version_conflict`. The email cannot change.

Requires one of the following scopes: `contacts:write`, `contacts:all`, `all:all`.



## OpenAPI

````yaml /openapi.json patch /v1/contacts/{id}
openapi: 3.0.0
info:
  title: MailBeast Public API
  description: >-
    Task-shaped REST API for campaigns, leads, deliverability, verification and
    lead discovery. Authenticate with an API key (`Authorization: Bearer
    mb_live_…`); the workspace is resolved from the key.
  version: '1'
  contact: {}
servers:
  - url: https://api.mailbeast.ai
security: []
tags:
  - name: API Keys
    description: Create, list and delete API keys programmatically.
  - name: Campaigns
    description: Create, configure, launch and monitor email campaigns.
  - name: Subsequences
    description: >-
      Follow-up flows of a campaign that start on a lead status, a reply, an
      open, a click or a finished sequence - from the same mailbox, in the same
      thread.
  - name: Leads
    description: Add, read, update and bulk-manage a campaign’s leads.
  - name: Contacts
    description: >-
      The people of the workspace, one per email across all campaigns: list,
      upsert, update and delete.
  - name: Workspace
    description: Read usage, subscription and workspace identity.
  - name: Email Accounts
    description: >-
      Connect and manage the sending mailboxes your campaigns send from
      (SMTP/IMAP or native OAuth).
  - name: Analytics
    description: Engagement reporting – per campaign, over time, and across the workspace.
  - name: Lead Finder
    description: >-
      Discover new companies and leads. List past searches and poll a running
      search’s progress.
paths:
  /v1/contacts/{id}:
    patch:
      tags:
        - Contacts
      summary: Update a contact
      description: >-
        Change a person’s profile; it shows in every campaign they are in. The
        fields you send are written as given (`null` or an empty string clears
        one), the rest stay. Pass the `version` you read: if the contact changed
        since, the request fails with 409 `contact_version_conflict`. The email
        cannot change.


        Requires one of the following scopes: `contacts:write`, `contacts:all`,
        `all:all`.
      operationId: contacts_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
            format: uuid
            example: 019a7c3e-5b21-7d40-9e1f-2a3b4c5d6e7f
        - name: Idempotency-Key
          in: header
          description: >-
            Optional. A unique key you generate (max 255 chars, such as a UUID)
            that makes this request safe to retry. Retrying with the same key
            replays the original response instead of repeating the operation.
            Reusing a key with a different body returns `422`.
          required: false
          schema:
            type: string
            maxLength: 255
            example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContactApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactApiDto'
        '400':
          description: The request body or parameters failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              example:
                error:
                  type: invalid_request_error
                  code: validation_failed
                  message: One or more fields are invalid.
                  status: 400
                  requestId: e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f
                  details:
                    - name should not be empty
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              example:
                error:
                  type: authentication_error
                  code: unauthenticated
                  message: Missing or invalid API key.
                  status: 401
                  requestId: e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f
        '403':
          description: >-
            The key lacks a required scope, or the plan does not include API
            access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              example:
                error:
                  type: authorization_error
                  code: permission_denied
                  message: This API key is missing the required scope.
                  status: 403
                  requestId: e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f
        '404':
          description: The resource does not exist in your workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              example:
                error:
                  type: invalid_request_error
                  code: not_found
                  message: Resource not found.
                  status: 404
                  requestId: e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f
        '409':
          description: >-
            The request conflicts with current state - e.g. a request with the
            same Idempotency-Key is still being processed, or the operation
            partially applied.


            The request conflicts with current state - e.g. a request with the
            same Idempotency-Key is still being processed, or the operation
            partially applied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              example:
                error:
                  type: invalid_request_error
                  code: conflict
                  message: The request conflicts with an existing resource.
                  status: 409
                  requestId: e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f
        '422':
          description: >-
            The Idempotency-Key was already used with a different request body.
            Use a new key for a new operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              example:
                error:
                  type: invalid_request_error
                  code: idempotency_key_reused
                  message: >-
                    The Idempotency-Key was already used with a different
                    request body. Use a new key for a new operation.
                  status: 422
                  requestId: e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f
        '429':
          description: >-
            Rate limit exceeded - retry after the interval in the Retry-After
            header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
              example:
                error:
                  type: rate_limit_error
                  code: rate_limited
                  message: >-
                    Too many requests. Retry after the interval in the
                    Retry-After header.
                  status: 429
                  requestId: e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f
                  retryAfter: 30
      security:
        - ApiKey: []
components:
  schemas:
    UpdateContactApiDto:
      type: object
      properties:
        version:
          type: integer
          minimum: 0
          description: >-
            Version the edit is based on (from the contact); a newer one → 409
            contact_version_conflict
        firstName:
          type: string
          nullable: true
          maxLength: 128
        lastName:
          type: string
          nullable: true
          maxLength: 128
        companyName:
          type: string
          nullable: true
          maxLength: 256
        jobTitle:
          type: string
          nullable: true
          maxLength: 128
        website:
          type: string
          nullable: true
          maxLength: 512
        linkedinProfile:
          type: string
          nullable: true
          maxLength: 512
        location:
          type: string
          nullable: true
          maxLength: 128
        tags:
          type: array
          nullable: true
          items:
            type: string
            minLength: 1
            maxLength: 64
          maxItems: 50
          example:
            - vip
        customFields:
          type: object
          description: >-
            Custom fields by key (`{{custom_<key>}}` in templates). A key you
            send is set, a key you leave out is kept. On an update `null` or
            `""` clears that key and `customFields: null` clears them all; on an
            upsert empty values are ignored and `mode` decides whether existing
            values change. A value of an image or url field must be an absolute
            http(s) URL.
          nullable: true
        customFieldLabels:
          type: object
          description: >-
            Labels of NEW custom fields of the workspace (key → label), as the
            lead editor sends them. An existing field keeps its own label.
        customFieldTypes:
          type: object
          description: >-
            Types of NEW custom fields of the workspace (key → text | url |
            number | date | image). An existing field keeps its own type.
      required:
        - version
    ContactApiDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 019a7c3e-5b21-7d40-9e1f-2a3b4c5d6e7f
        email:
          type: string
          example: anna@northwind.io
        firstName:
          type: string
          nullable: true
          example: Anna
        lastName:
          type: string
          nullable: true
          example: Berg
        companyName:
          type: string
          nullable: true
          example: Northwind
        jobTitle:
          type: string
          nullable: true
          example: Head of Sales
        website:
          type: string
          nullable: true
          example: northwind.io
        linkedinProfile:
          type: string
          nullable: true
        location:
          type: string
          nullable: true
          example: Berlin
        tags:
          example:
            - vip
          type: array
          items:
            type: string
        customFields:
          type: object
          additionalProperties: true
          example:
            industry: SaaS
        status:
          type: string
          enum:
            - not_contacted
            - scheduled
            - email_sent
            - failed
            - skipped
            - lead_replied_interested
            - lead_replied_meeting_request
            - lead_replied_out_of_office
            - lead_replied_bounce
            - lead_replied_wrong_person
            - lead_replied_not_interested
            - lead_replied_unsubscribed
            - lead_replied_uncategorized
            - lead_converted
            - lead_lost
            - blacklisted
            - null
          nullable: true
          description: >-
            `blacklisted` while the address or its domain is on the workspace
            blocklist; otherwise the furthest status of the person across their
            campaigns; null if they are in no campaign, or if every campaign row
            of theirs was blocked and the block was lifted later.
        doNotContact:
          type: boolean
          description: >-
            Unsubscribed, blocked or bounced. An unsubscribe or a bounce stops
            the campaign where it happened, a block (the workspace blocklist)
            stops every campaign; adding the person to a campaign from Contacts
            skips them.
        inSequence:
          type: boolean
          description: Some campaign still has emails to send this person.
        verification:
          $ref: '#/components/schemas/ContactVerificationApiView'
        provider:
          type: string
          example: google
          description: Mailbox provider of the address.
        emailsSent:
          type: number
          example: 3
          description: Emails sent to the person across all campaigns.
        repliedAt:
          type: string
          format: date-time
          nullable: true
        campaigns:
          description: Campaigns the person is in, newest first.
          type: array
          items:
            $ref: '#/components/schemas/ContactCampaignApiDto'
        version:
          type: number
          example: 2
          description: >-
            Pass it back in PATCH; a newer version → 409
            `contact_version_conflict`.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - email
        - tags
        - customFields
        - doNotContact
        - inSequence
        - verification
        - provider
        - emailsSent
        - campaigns
        - version
        - createdAt
        - updatedAt
    ApiErrorDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBodyDto'
      required:
        - error
    ContactVerificationApiView:
      type: object
      properties:
        status:
          type: string
          example: valid
        subStatus:
          type: string
          nullable: true
        verifiedAt:
          type: string
          format: date-time
          nullable: true
      required:
        - status
    ContactCampaignApiDto:
      type: object
      properties:
        campaignId:
          type: string
          format: uuid
          example: a7d4e2f1-08b3-4c65-9e7a-1b2c3d4e5f60
        campaignName:
          type: string
          example: Q4 Product Launch Outreach
        leadId:
          type: string
          format: uuid
          description: >-
            The person’s lead in that campaign
            (`/v1/campaigns/{campaignId}/leads/{leadId}`).
          example: c9e5b1a3-7f24-4d80-a6b9-2e4f8c0d1a37
        leadStatus:
          type: string
          enum:
            - not_contacted
            - scheduled
            - email_sent
            - failed
            - skipped
            - lead_replied_interested
            - lead_replied_meeting_request
            - lead_replied_out_of_office
            - lead_replied_bounce
            - lead_replied_wrong_person
            - lead_replied_not_interested
            - lead_replied_unsubscribed
            - lead_replied_uncategorized
            - lead_converted
            - lead_lost
            - blacklisted
          example: email_sent
        inSequence:
          type: boolean
          description: >-
            The campaign (or one of its subsequences) still has emails to send
            this person.
      required:
        - campaignId
        - campaignName
        - leadId
        - leadStatus
        - inSequence
    ApiErrorBodyDto:
      type: object
      properties:
        type:
          type: string
          example: authorization_error
          description: Broad error class.
        code:
          type: string
          example: permission_denied
          description: Stable machine-readable code to switch on.
        message:
          type: string
          example: This API key is missing the required scope.
        status:
          type: number
          example: 403
        requestId:
          type: string
          example: e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f
          description: Correlation id - quote it in support requests.
        details:
          description: Field-level validation messages (present on validation errors).
          example:
            - name should not be empty
          type: array
          items:
            type: string
        retryAfter:
          type: number
          description: Seconds to wait before retrying (present on 429 responses).
          example: 30
      required:
        - type
        - code
        - message
        - status
        - requestId
  securitySchemes:
    ApiKey:
      scheme: bearer
      bearerFormat: mb_live_…
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.