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

# Link a channel identity to a customer

> API-created identities default verified=false. Passing verified=true asserts your system authenticated the identity (recorded with verifiedAt) and allows it to auto-merge. A (channel, identifier) already claimed by another customer returns 409 with the owning customerId.




## OpenAPI

````yaml POST /customers/{customerId}/identities
openapi: 3.1.0
info:
  title: Protodesk API
  version: 0.1.0
  description: >
    The Protodesk Platform API: sync your customers in, attach your own business
    objects (orders, bookings, listings) to conversations, post and read
    messages across channels, and receive every workspace event via signed
    webhooks or a resumable SSE stream.


    Authenticate every request with a workspace-scoped API key: `Authorization:
    Bearer pk_live_...`. Create endpoints accept an `Idempotency-Key` header so
    retries are always safe. Lists use opaque cursor pagination (`data` /
    `hasMore` / `nextCursor`).


    Task-oriented guides: [docs.protodesk.io](https://docs.protodesk.io).
servers:
  - url: https://api.protodesk.io/v1
    description: Production
  - url: http://localhost:8080/v1
    description: Local development
security: []
tags:
  - name: Customers
    description: People or companies contacting a workspace across channels.
  - name: Conversations
    description: Customer conversations attached to channels and external business objects.
  - name: Messages
    description: Customer, agent, AI, system, and internal messages inside conversations.
  - name: Channel identities
    description: >-
      The same customer across WhatsApp, email, chat, and more — linked
      identities per channel.
  - name: Statuses & priorities
    description: The workspace's conversation statuses and priority levels.
  - name: Assignments
    description: >-
      Who a conversation has been assigned to, over time. Assign via POST
      /conversations/{conversationId}/assign.
  - name: Webhooks
    description: Webhook subscriptions for receiving workspace events.
  - name: Realtime
    description: Server-sent event stream of workspace events.
  - name: API Keys
    description: Create, list, and revoke workspace API keys.
  - name: Account
    description: The workspace and scopes behind your API key.
  - name: System
    description: Service metadata and health endpoints.
paths:
  /customers/{customerId}/identities:
    parameters:
      - name: customerId
        in: path
        required: true
        schema:
          type: string
    post:
      tags:
        - Channel identities
      summary: Link a channel identity to a customer
      description: >
        API-created identities default verified=false. Passing verified=true
        asserts your system authenticated the identity (recorded with
        verifiedAt) and allows it to auto-merge. A (channel, identifier) already
        claimed by another customer returns 409 with the owning customerId.
      operationId: createIdentity
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIdentityRequest'
      responses:
        '201':
          description: Created channel identity.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelIdentity'
        '409':
          description: The identity is already claimed by another customer.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentityConflict'
        default:
          $ref: '#/components/responses/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateIdentityRequest:
      type: object
      required:
        - channel
        - identifier
      properties:
        channel:
          type: string
          description: >-
            Channel the identity belongs to (open string, e.g. whatsapp, slack,
            email).
          example: whatsapp
        identifier:
          type: string
          description: The identity value on that channel.
          example: '+628123456789'
        verified:
          type: boolean
          default: false
          description: >
            True asserts your system authenticated this identity, allowing
            auto-merge. Recorded with verifiedAt.
        claimedEmail:
          type: string
          description: >-
            A claimed (unverified) email; display and merge-suggestion input
            only.
        displayName:
          type: string
        avatarUrl:
          type: string
        primary:
          type: boolean
          default: false
    ChannelIdentity:
      type: object
      required:
        - id
        - customerId
        - channel
        - identifier
        - verified
        - primary
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          example: cid_x6q5vl75f5d53m7oet2k4r5w6a
        customerId:
          type: string
        channel:
          type: string
          example: whatsapp
        identifier:
          type: string
          example: '+628123456789'
        verified:
          type: boolean
        verifiedAt:
          type: string
          format: date-time
          nullable: true
        claimedEmail:
          type:
            - string
            - 'null'
        displayName:
          type:
            - string
            - 'null'
        avatarUrl:
          type:
            - string
            - 'null'
        lastActiveAt:
          type: string
          format: date-time
          nullable: true
        primary:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    IdentityConflict:
      type: object
      description: >
        Returned with 409 when a (channel, identifier) is already claimed. The
        owning customerId is workspace-scoped, so it is safe to return.
      required:
        - error
        - customerId
      properties:
        error:
          $ref: '#/components/schemas/Error'
        customerId:
          type: string
          example: cus_x6q5vl75f5d53m7oet2k4r5w6a
    Error:
      type: object
      required:
        - code
        - message
        - requestId
      properties:
        code:
          type: string
          example: route.not_found
        message:
          type: string
          example: Not found
        requestId:
          type: string
          example: req_x6q5vl75f5d53m7oet2k4r5w6a
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
  headers:
    RequestId:
      description: Request id for tracing this request in logs and support.
      schema:
        type: string
        example: req_x6q5vl75f5d53m7oet2k4r5w6a
    RateLimitLimit:
      description: >-
        Request budget for the route class (read or write) applied to this
        request.
      schema:
        type: integer
        example: 40
    RateLimitRemaining:
      description: Requests remaining in the current budget after this request.
      schema:
        type: integer
        example: 39
    RateLimitReset:
      description: Seconds until the budget refills to its full limit.
      schema:
        type: integer
        example: 1
    RetryAfter:
      description: Seconds to wait before retrying, sent with 429 responses.
      schema:
        type: integer
        example: 1
  responses:
    Error:
      description: >-
        Error response. All /v1 responses carry RateLimit-Limit,
        RateLimit-Remaining, and RateLimit-Reset headers. A 429
        (rate_limit.exceeded) additionally carries Retry-After. Request bodies
        exceeding the route-class limit (1KB reads, 64KB writes) return 413
        (request.body_too_large).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: Protodesk API key
      description: >
        Use a workspace API key in the Authorization header. Keys use
        pk_live_<key_id>_<secret> for production and pk_test_<key_id>_<secret>
        for test mode.

````

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