# Create Message

Used during synchronization to push new messages into your helpdesk. These messages may come from either the end-user or Fin.
Note that the author of the Fin messages will be the agent selected to represent Fin on initial setup of the integration.

Endpoint: POST /messages
Version: 0.0.1
Security: BearerAuth

## Request fields (application/json):

  - `conversation_id` (string)
    ID of the parent conversation
    Example: conv_456

  - `message_type` (string)
    Type of message
    Enum: "comment"

  - `body` (string)
    Message content in HTML format.
Supported HTML tags are:
- Paragraphs `<p>`
- Heading 1, Heading 2 `<h1>` `<h2>` (note h3 to h6 appears as a h2)
- Bold `<b>`
- Italic `<i>`
- Links `<a>`
- Images `<img>` (can be linked)
- Line breaks `<br>`
- Code blocks `<code>`
- Unordered lists `<ul>`
- Ordered lists `<ol>`
    Example: <p>Hi! I'd like to know more about your pricing plans.</p>

  - `author` (object)
    The user who authored the message.

  - `author.id` (string)
    Unique identifier for the user in your system
    Example: user_123456

  - `author.user_type` (string)
    Type of user
    Enum: "end_user", "agent"

  - `visibility` (string)
    Message visibility
    Enum: "public", "private"

  - `created_at` (string)
    ISO 8601 timestamp
    Example: 2025-10-27T14:30:00.000Z

  - `object_id` (string)
    Unique identifier for the message in our system
    Example: 123456

  - `attachments` (array)
    Array of attachments (can be empty)

  - `attachments.url` (string)
    URL where the attachment can be accessed.
Must be HTTPS. Consider using signed URLs with expiration for sensitive files.
    Example: https://example.com/files/pricing-guide.pdf

  - `attachments.filetype` (string)
    File type/extension.
    Example: pdf

  - `attachments.filename` (string)
    Display name for the file
    Example: Pricing Guide 2025

## Response 201 fields (application/json):

  - `id` (string, required)
    Unique identifier for the message in your system
    Example: msg_001

  - `conversation_id` (string, required)
    ID of the parent conversation
    Example: conv_456

  - `message_type` (string, required)
    Type of message
    Enum: "comment"

  - `body` (string, required)
    Message content in HTML format
    Example: <p>Thank you for reaching out! I'd be happy to explain our pricing plans.</p>

  - `author` (any, required)
    The user who authored the message.

  - `author.id` (string, required)
    Unique identifier for the user in your system
    Example: user_123456

  - `author.user_type` (string, required)
    Type of user
    Enum: "end_user"

  - `author.name` (string)
    User's display name
    Example: Jane Doe

  - `author.email` (string)
    User's email address
    Example: jane.doe@example.com

  - `author.photo_url` (string)
    URL to user's avatar/profile picture (displayed in Fin Messenger)
    Example: https://example.com/avatars/jane.jpg

  - `author.alias` (string)
    Agent's display alias (shown to end-users instead of real name)
    Example: Support Jane

  - `visibility` (string, required)
    Who can see the message:
- `public` - Visible to end-users (appears in Fin Messenger)
- `private` - Only visible to agents (internal notes)
    Enum: "public", "private"

  - `created_at` (string, required)
    When the message was created (ISO 8601 UTC)
    Example: 2025-10-27T14:35:00.000Z

  - `attachments` (array)
    Files attached to the message

  - `attachments.url` (string)
    URL where the attachment can be accessed.
Must be HTTPS. Consider using signed URLs with expiration for sensitive files.
    Example: https://example.com/files/pricing-guide.pdf

  - `attachments.filetype` (string)
    File type/extension.
    Example: pdf

  - `attachments.filename` (string)
    Display name for the file
    Example: Pricing Guide 2025

