# Creates a conversation

`POST /conversations`

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

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.12'
  description: This is a subset of the full specification, limited to the `POST /conversations` 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:
    post:
      summary: Creates a conversation
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
      tags:
        - Conversations
      operationId: createConversation
      description: |-
        You can create a conversation that has been initiated by a contact (ie. user or lead).

        **Sending for visitors**

        You can also send a message from a visitor by specifying their `user_id` or `id` value in the `from` field, along with a `type` field value of `contact`.
        This visitor will be automatically converted to a contact with a lead role once the conversation is created.

        This will return the Message model that has been created.
      responses:
        '200':
          description: conversation created
          content:
            application/json:
              examples:
                conversation created:
                  value:
                    type: user_message
                    id: '403918075'
                    created_at: 1736201609
                    body: Hello there
                    message_type: inapp
                    conversation_id: '33'
              schema:
                allOf:
                  - $ref: '#/components/schemas/message'
                required:
                  - conversation_id
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: 68b68480-5c50-454e-ad59-2bd75b9c30d6
                    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: 6e605cf9-4fe7-4998-b328-61754971a35b
                    errors:
                      - code: api_plan_restricted
                        message: Active subscription needed.
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Contact Not Found
          content:
            application/json:
              examples:
                Contact Not Found:
                  value:
                    type: error.list
                    request_id: 804d10f9-c9c9-4280-a1ae-3f7a2f2d9a87
                    errors:
                      - code: not_found
                        message: User Not Found
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create_conversation_request'
            examples:
              conversation_created:
                summary: conversation created
                value:
                  from:
                    type: user
                    id: 677c55876abd011ad17ff510
                  body: Hello there
              contact_not_found:
                summary: Contact Not Found
                value:
                  from:
                    type: user
                    id: 123_doesnt_exist
                  body: Hello there
components:
  schemas:
    create_conversation_request:
      description: Conversations are how you can communicate with users in Intercom. They are created when a contact replies to an outbound message, or when one admin directly sends a message to a single contact.
      type: object
      title: Create Conversation Request Payload
      properties:
        from:
          type: object
          properties:
            type:
              type: string
              enum:
                - lead
                - user
              description: The role associated to the contact - user or lead.
              example: user
            id:
              type: string
              description: The identifier for the contact which is given by Intercom.
              format: uuid
              minLength: 24
              maxLength: 24
              example: 536e564f316c83104c000020
          required:
            - type
            - id
        body:
          type: string
          description: The content of the message. HTML is not supported.
          example: Hello
        subject:
          type: string
          description: The title of the email. Only applicable if the message type is email.
          example: Thanks for everything
        attachment_urls:
          type: array
          description: A list of image URLs that will be added as attachments. You can include up to 10 URLs.
          items:
            type: string
            format: uri
          maxItems: 10
        created_at:
          type: integer
          format: date-time
          description: The time the conversation was created as a UTC Unix timestamp. If not provided, the current time will be used. This field is only recommneded for migrating past conversations from another source into Intercom.
          example: 1671028894
        message_type:
          type: string
          description: 'The kind of message being created. Values: `inapp` (in-app messaging), `email`, `sms`, `whatsapp`, or `facebook`.'
          enum:
            - inapp
            - email
            - sms
            - whatsapp
            - facebook
          example: inapp
      required:
        - from
        - body
    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.12'
      default: '2.12'
      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'
        - Preview
    message:
      type: object
      title: Message
      x-tags:
        - Messages
      description: Message are how you reach out to contacts in Intercom. They are created when an admin sends an outbound message to a contact.
      properties:
        type:
          type: string
          description: The type of the message
          example: user_message
        id:
          type: string
          description: The id representing the message.
          example: '1488971108'
        created_at:
          type: integer
          format: date-time
          description: The time the conversation was created.
          example: 1667560812
        subject:
          type: string
          description: 'The subject of the message. Only present if message_type: email.'
          example: Greetings
        body:
          type: string
          description: The message body, which may contain HTML.
          example: Hello
        message_type:
          type: string
          enum:
            - email
            - inapp
            - facebook
          description: The type of message that was sent. Can be email, inapp or facebook.
          example: inapp
        conversation_id:
          type: string
          description: The associated conversation_id
          example: '64619700005570'
      required:
        - type
        - id
        - created_at
        - body
        - message_type
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
