# Creates a conversation

You can create a conversation that has been initiated by a contact (ie. user or lead).
The conversation can be an in-app message only.
You can also send a message from a visitor by specifying their `id` value in the `from` field, along with a `type` field value of `lead`.
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: Preview
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"

  - `from.id` (string)
    The identifier for the contact which is given by Intercom. Provide one of `id`, `user_id` or `email`. If you send more than one, `id` is used first, then `user_id`.
    Example: 536e564f316c83104c000020

  - `from.user_id` (string)
    The external identifier you gave the user. Matches users only; for a lead, use `id` or `email`.
    Example: 25

  - `from.email` (string)
    The contact's email. Matches a user or a lead, depending on `type`. Used only when `user_id` isn't sent. If several leads share the email and it's the only identifier sent, the request fails with `multiple_users`; use `id` instead.
    Example: joe@example.com

  - `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.

  - `created_at` (integer)
    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

  - `brand_id` (string)
    The unique identifier of the brand to associate with this conversation.
    Example: 123

## 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, twitter, sms or whatsapp.
    Enum: "email", "inapp", "facebook", "twitter", "sms", "whatsapp"

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

  - `owner` (object)
    Admins are teammate accounts that have access to a workspace.

  - `owner.type` (string)
    String representing the object's type. Always has the value `admin`.
    Example: admin

  - `owner.id` (string)
    The id representing the admin.
    Example: 1295

  - `owner.name` (string)
    The name of the admin.
    Example: Joe Example

  - `owner.email` (string)
    The email of the admin.
    Example: jdoe@example.com

  - `owner.job_title` (string)
    The job title of the admin.
    Example: Associate

  - `owner.away_mode_enabled` (boolean)
    Identifies if this admin is currently set in away mode.
    Example: false

  - `owner.away_mode_reassign` (boolean)
    Identifies if this admin is set to automatically reassign new conversations to the apps default inbox.
    Example: false

  - `owner.away_status_reason_id` (integer)
    The unique identifier of the away status reason. Not returned by List all admins.
    Example: 12345

  - `owner.has_inbox_seat` (boolean)
    Identifies if this admin has a paid inbox seat to restrict/allow features that require them.
    Example: true

  - `owner.team_ids` (array)
    The ids of the teams the admin belongs to. When the workspace has a default team, its id is the last item.
    Example: [814865]

  - `owner.avatar` (object)
    The teammate's avatar image. On List all admins it is only included when `display_avatar` is `true`. Elsewhere it is left out when the teammate has neither an uploaded avatar nor a gravatar.

  - `owner.avatar.type` (string)
    Value is `avatar`. Returned by List all admins only.
    Example: avatar

  - `owner.avatar.image_url` (string)
    The URL of the avatar image.
    Example: https://picsum.photos/200/300

  - `owner.team_priority_level` (object)
    Admin priority levels for teams

  - `owner.team_priority_level.primary_team_ids` (array)
    The primary team ids for the team
    Example: [814865]

  - `owner.team_priority_level.secondary_team_ids` (array)
    The secondary team ids for the team
    Example: [493881]

  - `owner.role` (object)
    The role assigned to this admin. Only present if the admin has a role assigned.

  - `owner.role.type` (string)
    String representing the object's type. Always has the value `role`.
    Example: role

  - `owner.role.id` (string)
    The id of the role.
    Example: 1

  - `owner.role.name` (string)
    The name of the role.
    Example: Support Agent

  - `template` (string)
    The style of the email, such as `plain` or `personal`. Only present when `message_type` is `email`.
    Example: plain

  - `external_id` (string)
    The external identifier of the message, if one was set when the message was created. Only returned for messages started by a contact.
    Example: api:order-1234

  - `whatsapp_message_id` (string)
    The id WhatsApp gave the message. Only present for `whatsapp` messages that WhatsApp accepted.
    Example: wamid.EXAMPLE123

## Response 400 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` (any, required)
    A string indicating the kind of error, used to further qualify the HTTP response code. A few request validation errors send an HTTP status code as an integer here instead, for example `422`.
    Example: unauthorized

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

## 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` (any, required)
    A string indicating the kind of error, used to further qualify the HTTP response code. A few request validation errors send an HTTP status code as an integer here instead, for example `422`.
    Example: unauthorized

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

## 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` (any, required)
    A string indicating the kind of error, used to further qualify the HTTP response code. A few request validation errors send an HTTP status code as an integer here instead, for example `422`.
    Example: unauthorized

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

## 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` (any, required)
    A string indicating the kind of error, used to further qualify the HTTP response code. A few request validation errors send an HTTP status code as an integer here instead, for example `422`.
    Example: unauthorized

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

## Response 422 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` (any, required)
    A string indicating the kind of error, used to further qualify the HTTP response code. A few request validation errors send an HTTP status code as an integer here instead, for example `422`.
    Example: unauthorized

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

