# Get Messages

Called during synchronization to pull in the messages from the conversation in your system.
Messages which have already been synchronized will be ignored. New messages will be pulled into Fin's version of the Conversation.

Endpoint: POST /get_messages
Version: 0.0.1
Security: BearerAuth

## Request fields (application/json):

  - `conversation_id` (string)
    ID of the conversation in your system
    Example: conv_456

  - `after_id` (string)
    ID of the last seen message ID from the external system. As an optimization, the external service may choose to return only messages created after this.
    Example: msg_101

## Response 200 fields (application/json):

  - `data` (array)

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

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

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

  - `data.body` (string)
    Message content in HTML format. Can be null or empty if attachments are provided.
    Example: <p>Hi! I'd like to know more about your pricing plans.</p>

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

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

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

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

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

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

  - `data.author.attributes` (object)
    Attributes associated with the end-user
    Example: {"plan_type":"enterprise","signup_date":"2024-01-15","is_premium":true}

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

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

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

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

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

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

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

  - `error` (object)
    The error returned by the API. This is an RFC 7807 problem details object: [https://www.rfc-editor.org/rfc/rfc7807.html](https://www.rfc-editor.org/rfc/rfc7807.html).

  - `error.type` (string)
    A URI reference that identifies the problem type.

  - `error.title` (string)
    A short, human-readable summary of the problem type.

  - `error.status` (integer)
    The HTTP status code generated by the origin server for this occurrence of the problem.

  - `error.detail` (string)
    A human-readable explanation specific to this occurrence of the problem.

  - `error.instance` (string)
    A URI reference that identifies the specific occurrence of the problem.

