# Creates a conversation

You can create a conversation that has been initiated by a contact (ie. user or lead).
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.

Endpoint: POST /conversations
Version: 2.9
Security: bearerAuth

## Header parameters:

  - `Intercom-Version` (string)

## Request fields (application/json):

  - `from` (object, required)

  - `from.type` (string, required)
    The role associated to the contact - user or lead.
    Enum: "lead", "user", "contact"

  - `from.id` (string, required)
    The identifier for the contact which is given by Intercom.
    Example: 536e564f316c83104c000020

  - `body` (string, required)
    The content of the message. HTML is not supported.
    Example: Hello

  - `subject` (string)
    The title of the email. Only applicable if the message type is email.
    Example: Thanks for everything

  - `attachment_urls` (array)
    A list of image URLs that will be added as attachments. You can include up to 10 URLs.

  - `message_type` (string)
    The kind of message being created. Values: `inapp` (in-app messaging), `email`, `sms`, `whatsapp`, or `facebook`.
    Enum: "inapp", "email", "sms", "whatsapp", "facebook"

## Response 200 fields (application/json):

  - `type` (string, required)
    The type of the message
    Example: user_message

  - `id` (string, required)
    The id representing the message.
    Example: 1488971108

  - `created_at` (integer, required)
    The time the conversation was created.
    Example: 1667560812

  - `subject` (string)
    The subject of the message. Only present if message_type: email.
    Example: Greetings

  - `body` (string, required)
    The message body, which may contain HTML.
    Example: Hello

  - `message_type` (string, required)
    The type of message that was sent. Can be email, inapp, facebook or twitter.
    Enum: "email", "inapp", "facebook", "twitter"

  - `conversation_id` (string)
    The associated conversation_id
    Example: 64619700005570

## Response 401 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

## Response 403 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

## Response 404 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

