# Attach a contact to a conversation

`POST /conversations/{conversation_id}/customers`

> This is a subset of the full specification, limited to the `POST /conversations/{conversation_id}/customers` operation.
>
> You can find the full specification here: /_bundle/docs/references/@2.15/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.15'
  description: This is a subset of the full specification, limited to the `POST /conversations/{conversation_id}/customers` operation.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Conversations
    description: Everything about your Conversations
    externalDocs:
      description: What is a conversation?
      url: https://www.intercom.com/help/en/articles/4323904-what-is-a-conversation
paths:
  /conversations/{conversation_id}/customers:
    post:
      summary: Attach a contact to a conversation
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: conversation_id
          in: path
          required: true
          description: The identifier for the conversation as given by Intercom.
          example: '123'
          schema:
            type: string
      tags:
        - Conversations
      operationId: attachContactToConversation
      description: |-
        You can add participants who are contacts to a conversation, on behalf of either another contact or an admin.

        **Contacts without an email**

        If you add a contact via the email parameter and there is no user/lead found on that workspace with he given email, then we will create a new contact with `role` set to `lead`.
      responses:
        '200':
          description: Attach a contact to a conversation
          content:
            application/json:
              examples:
                Attach a contact to a conversation:
                  value:
                    customers:
                      - type: user
                        id: 6762f19b1bb69f9f2193bbd4
              schema:
                $ref: '#/components/schemas/conversation_participants_response'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: 9dc7c1a0-b818-472c-adf6-3e327f22f541
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: API plan restricted
          content:
            application/json:
              examples:
                API plan restricted:
                  value:
                    type: error.list
                    request_id: 99f72599-ac98-4b1e-af96-808654b6383e
                    errors:
                      - code: api_plan_restricted
                        message: Active subscription needed.
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not found
          content:
            application/json:
              examples:
                Not found:
                  value:
                    type: error.list
                    request_id: 86fd8b2e-7048-4fbd-9fb0-d73085d7210b
                    errors:
                      - code: not_found
                        message: Resource Not Found
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/attach_contact_to_conversation_request'
            examples:
              attach_a_contact_to_a_conversation:
                summary: Attach a contact to a conversation
                value:
                  admin_id: 991267731
                  customer:
                    intercom_user_id: 6762f19b1bb69f9f2193bbd4
              not_found:
                summary: Not found
                value:
                  admin_id: 991267733
                  customer:
                    intercom_user_id: 6762f19e1bb69f9f2193bbd5
components:
  schemas:
    attach_contact_to_conversation_request:
      title: Assign Conversation Request
      type: object
      description: Payload of the request to assign a conversation
      properties:
        admin_id:
          type: string
          description: The `id` of the admin who is adding the new participant.
          example: '12345'
        customer:
          type: object
          oneOf:
            - title: Intercom User ID
              properties:
                intercom_user_id:
                  type: string
                  description: The identifier for the contact as given by Intercom.
                  example: 6329bd9ffe4e2e91dac76188
                customer:
                  $ref: '#/components/schemas/customer_request'
              required:
                - intercom_user_id
            - title: User ID
              properties:
                user_id:
                  type: string
                  description: The external_id you have defined for the contact who is being added as a participant.
                  example: 6329bd9ffe4e2e91dac76188
                customer:
                  $ref: '#/components/schemas/customer_request'
              required:
                - user_id
            - title: Email
              properties:
                email:
                  type: string
                  description: The email you have defined for the contact who is being added as a participant.
                  example: winstonsmith@truth.org
                customer:
                  $ref: '#/components/schemas/customer_request'
              required:
                - email
    conversation_participants_response:
      title: Conversation Participants Response
      type: object
      description: The participants of the conversation, returned after attaching or detaching a contact
      properties:
        customers:
          type: array
          description: The conversation participants after the change
          items:
            type: object
            properties:
              type:
                type: string
                description: The role of the participant. Can be "user" or "lead"
                example: user
              id:
                type: string
                description: The unique identifier for the participant
                example: 6762f1a61bb69f9f2193bbd8
            required:
              - type
              - id
          example:
            - type: user
              id: 6762f1a61bb69f9f2193bbd8
      required:
        - customers
    customer_request:
      type: object
      nullable: true
      oneOf:
        - title: Intercom User ID
          properties:
            intercom_user_id:
              type: string
              description: The identifier for the contact as given by Intercom.
              example: 6329bd9ffe4e2e91dac76188
          required:
            - intercom_user_id
        - title: User ID
          properties:
            user_id:
              type: string
              description: The external_id you have defined for the contact who is being added as a participant.
              example: 2e91dac761886329bd9ffe4e
          required:
            - user_id
        - title: Email
          properties:
            email:
              type: string
              description: The email you have defined for the contact who is being added as a participant.
              example: sam.sung@example.com
          required:
            - email
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              field:
                type: string
                nullable: true
                description: Optional. Used to identify a particular field or query parameter that was in error.
                example: email
            required:
              - code
      required:
        - type
        - errors
    intercom_version:
      description: Intercom API version.</br>By default, it's equal to the version set in the app package.
      type: string
      example: '2.15'
      default: '2.15'
      enum:
        - '1.0'
        - '1.1'
        - '1.2'
        - '1.3'
        - '1.4'
        - '2.0'
        - '2.1'
        - '2.2'
        - '2.3'
        - '2.4'
        - '2.5'
        - '2.6'
        - '2.7'
        - '2.8'
        - '2.9'
        - '2.10'
        - '2.11'
        - '2.12'
        - '2.13'
        - '2.14'
        - '2.15'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
