# Reply to Fin

`POST /fin/reply`

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

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.15'
  description: This is a subset of the full specification, limited to the `POST /fin/reply` 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: Fin Agent
    description: |-
      Access Fin programmatically via the Fin Agent API endpoints.

      To request access to the Fin Agent API, go to **Settings > Integrations > Fin Agent API** in your workspace and tell us about your use case. Once access is granted, **Fin Agent API** appears under **Fin AI Agent > Deploy**.

      Integration centres on the Fin Agent API endpoints — start a conversation with `/fin/start` and continue it with `/fin/reply`, or drive Fin from your own agent with `/fin/capabilities`, `/fin/ask`, `/fin/procedures/{procedure_id}/run`, and `/fin/escalate` — plus a set of events that notify your application of Fin's status and responses. Events are delivered via webhooks. You can also record a customer satisfaction rating with `/fin/csat`.

      **Pricing**

      Conversations you start with `/fin/start` are billed on **outcomes**: you're charged at most once per conversation, and only when Fin reaches a billable outcome such as a resolution. See [Understanding Fin outcomes](https://www.intercom.com/help/en/articles/13513868-understanding-fin-outcomes).

      **Events**

      Configure a webhook endpoint in the Fin Agent API settings to receive events. See the [setup guide](/docs/guides/fin-agent-api/setup) for configuration details.

      - `fin_status_updated` - Fired when Fin's status changes (escalated, resolved, complete)
      - `fin_replied` - Fired when Fin sends a reply to the user
      - `csat_requested` - Fired when Fin asks the user to rate the conversation (submit the choice with `POST /fin/csat`)

      All webhook requests include an `X-Fin-Agent-API-Webhook-Signature` header for request validation.
paths:
  /fin/reply:
    post:
      summary: Reply to Fin
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
      tags:
        - Fin Agent
      operationId: replyToFin
      description: |-
        Once Fin has returned a response to a user's message, its status will be `awaiting_user_reply`.

        If a user replies, use this endpoint to send this response to Fin.

        To request access to the Fin Agent API, go to **Settings > Integrations > Fin Agent API** in your workspace and tell us about your use case. Once access is granted, **Fin Agent API** appears under **Fin AI Agent > Deploy**.
      responses:
        '200':
          description: Reply sent successfully
          content:
            application/json:
              examples:
                Successful response:
                  value:
                    conversation_id: ext-123
                    intercom_conversation_id: '192837465'
                    user_id: user-456
                    status: thinking
                    created_at_ms: '2025-01-24T10:00:00.123Z'
                Response with attribute errors:
                  value:
                    conversation_id: ext-123
                    intercom_conversation_id: '192837465'
                    user_id: user-456
                    status: thinking
                    created_at_ms: '2025-01-24T10:00:00.123Z'
                    errors:
                      user:
                        attributes:
                          invalid_attr: User attribute 'invalid_attr' does not exist
              schema:
                type: object
                properties:
                  conversation_id:
                    type: string
                    description: The ID of the conversation.
                    example: ext-123
                  intercom_conversation_id:
                    type: string
                    description: The internal Intercom conversation ID, useful for matching this Agent API session to the conversation in Intercom.
                    example: '192837465'
                  user_id:
                    type: string
                    description: The ID of the user.
                    example: user-456
                  status:
                    type: string
                    enum:
                      - thinking
                      - awaiting_user_reply
                      - escalated
                      - resolved
                      - complete
                    description: |
                      Fin's current status in the conversation workflow.
                    example: thinking
                  created_at_ms:
                    type: string
                    format: date-time
                    description: The timestamp the response was created at, with millisecond precision.
                    example: '2025-01-24T10:00:00.123Z'
                  errors:
                    $ref: '#/components/schemas/fin_agent_attribute_errors'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                Invalid request:
                  value:
                    type: error.list
                    request_id: b68959ea-6328-4f70-83cb-e7913dba1542
                    errors:
                      - code: parameter_invalid
                        message: conversation_id is required
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: b68959ea-6328-4f70-83cb-e7913dba1542
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                conversation_id:
                  type: string
                  description: The ID of the conversation.
                  example: '123456'
                message:
                  $ref: '#/components/schemas/fin_agent_message'
                user:
                  $ref: '#/components/schemas/fin_agent_user'
                attachments:
                  type: array
                  description: An array of attachments to include with the message. Maximum of 10 attachments.
                  maxItems: 10
                  items:
                    $ref: '#/components/schemas/fin_agent_attachment'
              required:
                - conversation_id
                - message
                - user
            examples:
              Basic reply:
                value:
                  conversation_id: '123456'
                  message:
                    author: user
                    body: Here's the information you requested.
                    timestamp: '2025-01-24T09:01:00.000Z'
                  user:
                    id: '123456'
                    name: John Doe
                    email: john.doe@example.com
              Reply with attachments:
                value:
                  conversation_id: '123456'
                  message:
                    author: user
                    body: Here's the invoice you asked for.
                    timestamp: '2025-01-24T09:01:00.000Z'
                  user:
                    id: '123456'
                    name: John Doe
                    email: john.doe@example.com
                  attachments:
                    - type: url
                      url: https://example.com/invoice.pdf
components:
  schemas:
    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
    fin_agent_message:
      title: Fin Agent Message
      type: object
      description: A message exchanged within a Fin Agent conversation.
      x-tags:
        - Fin Agent
      properties:
        author:
          type: string
          enum:
            - user
            - agent
            - fin
          description: The author that created the message.
          example: user
        body:
          type: string
          description: |
            The body of the message. Accepts both plain text and HTML format.
            When sending a message to Fin, this should contain the user's message.
            Fin's response will be returned as HTML.
          example: How can I see my account details?
        timestamp:
          type: string
          format: date-time
          description: |
            The timestamp when the message was created.
            Used to deduplicate messages sent within a 5 minute window.
            Ideally should include milliseconds for higher precision.
          example: '2025-01-24T10:01:20.000Z'
        timestamp_ms:
          type: string
          format: date-time
          description: |
            The timestamp when the message was created, with millisecond precision.
            Only present in webhook event responses (fin_replied).
          example: '2025-01-24T10:01:20.456Z'
      required:
        - author
        - body
        - timestamp
    fin_agent_user:
      title: Fin Agent User
      type: object
      description: A user object representing the user in a Fin Agent conversation.
      x-tags:
        - Fin Agent
      properties:
        id:
          type: string
          description: |
            The ID of the user. This value will be used to uniquely identify the user
            during a conversation with Fin. Maps to the user_id field on the Intercom User object.
          example: '123456'
        name:
          type: string
          description: The name of the user.
          example: John Doe
        email:
          type: string
          format: email
          description: The email of the user.
          example: john.doe@example.com
        attributes:
          type: object
          description: |
            A hash of attributes associated with the user.
            Attributes can be used by Fin to target content and responses.
            Limit to 10 attributes.
          additionalProperties: true
          example:
            plan_type: Pro
            subscription_status: active
      required:
        - id
    fin_agent_attachment:
      title: Fin Agent Attachment
      type: object
      description: |
        An attachment object representing a file or URL attachment included with a message.
        Attachments can be used to provide additional context to Fin.
        Maximum of 10 attachments per request.
      x-tags:
        - Fin Agent
      properties:
        type:
          type: string
          enum:
            - url
            - file
          description: The type of attachment.
          example: url
        url:
          type: string
          format: uri
          description: The URL of the attachment. Required when type is 'url'. Must be publicly accessible.
          example: https://example.com/document.pdf
        name:
          type: string
          description: The name of the file. Required when type is 'file'.
          example: screenshot.png
        content_type:
          type: string
          description: The MIME type of the file. Required when type is 'file'.
          example: image/png
        data:
          type: string
          format: byte
          description: Base64-encoded file data. Required when type is 'file'.
          example: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk...
      required:
        - type
    fin_agent_attribute_errors:
      title: Fin Agent Attribute Errors
      type: object
      description: Contains error details if any user or conversation attribute updates failed.
      x-tags:
        - Fin Agent
      properties:
        user:
          type: object
          description: User-related attribute errors.
          properties:
            attributes:
              type: object
              description: Map of user attribute names to error messages.
              additionalProperties:
                type: string
              example:
                invalid_attr: User attribute 'invalid_attr' does not exist
        conversation:
          type: object
          description: Conversation-related attribute errors.
          properties:
            attributes:
              type: object
              description: Map of conversation attribute names to error messages.
              additionalProperties:
                type: string
              example:
                bad_attr: Conversation attribute 'bad_attr' does not exist
    intercom_version:
      description: Intercom API version.</br>By default, it's equal to the version set in the app package.
      type: string
      example: '2.15'
      default: '2.15'
      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'
        - '2.13'
        - '2.14'
        - '2.15'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
