# Run a Fin procedure

`POST /fin/procedures/{procedure_id}/run`

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

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.18'
  description: This is a subset of the full specification, limited to the `POST /fin/procedures/{procedure_id}/run` 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`.

      **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 (awaiting_user_reply, 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/procedures/{procedure_id}/run:
    post:
      summary: Run a Fin procedure
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: procedure_id
          in: path
          required: true
          description: The ID of the procedure to run.
          schema:
            type: string
          example: '12345'
      tags:
        - Fin Agent
      operationId: runFinProcedure
      description: |-
        Deterministically run a specific procedure on a new conversation. Calling this endpoint
        guarantees that the named procedure runs — there is no non-deterministic routing.

        Fin's progress is delivered asynchronously via events. If the
        procedure pauses for user input, the conversation status becomes `awaiting_user_reply` —
        send the user's response with [`/fin/reply`](/docs/references/rest-api/api.intercom.io/fin-agent/replytofin).

        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: Procedure run started successfully
          content:
            application/json:
              examples:
                Successful response:
                  value:
                    conversation_id: ext-123
                    intercom_conversation_id: '192837465'
                    user_id: user-456
                    procedure_id: '12345'
                    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
                    procedure_id: '12345'
                    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
                  procedure_id:
                    type: string
                    description: The ID of the procedure that was run.
                    example: '12345'
                  status:
                    type: string
                    enum:
                      - thinking
                      - replying
                      - awaiting_user_reply
                      - escalated
                      - resolved
                      - complete
                    description: |
                      Fin's status when the request was accepted. Always `thinking`; later statuses arrive as events.
                    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:
                Not available in this API version:
                  value:
                    type: error.list
                    request_id: b68959ea-6328-4f70-83cb-e7913dba1542
                    errors:
                      - code: intercom_version_invalid
                        message: Requested resource is not available in current API version
              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
                Token not authorized:
                  value:
                    type: error.list
                    request_id: b68959ea-6328-4f70-83cb-e7913dba1542
                    errors:
                      - code: token_unauthorized
                        message: Not authorized to access resource
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              examples:
                Fin Agent API not enabled:
                  value:
                    type: error.list
                    request_id: b68959ea-6328-4f70-83cb-e7913dba1542
                    errors:
                      - code: api_plan_restricted
                        message: Fin Agent API is not enabled for your app.
                Wrong credentials for the Fin Agent API:
                  value:
                    type: error.list
                    request_id: b68959ea-6328-4f70-83cb-e7913dba1542
                    errors:
                      - code: forbidden
                        message: Use your workspace's Fin Agent API key to call the Fin Agent API
              schema:
                $ref: '#/components/schemas/error'
        '422':
          description: The request could not be processed. The response body maps each field name to its error message, or uses `base` for request-level failures. Values are usually strings. When a required field inside an object, such as `user.id`, is missing or invalid, the error is a nested object keyed by the inner field.
          content:
            application/json:
              examples:
                Conversation ID missing:
                  value:
                    errors:
                      conversation_id: Conversation ID is required
                Procedure not found:
                  value:
                    errors:
                      procedure_id: Procedure not found
                Procedure not live:
                  value:
                    errors:
                      procedure_id: Procedure is not live
                Procedure not available on the Fin Agent API channel:
                  value:
                    errors:
                      procedure_id: Procedure is not available on the Fin Agent API channel
                Procedure not available for this user:
                  value:
                    errors:
                      procedure_id: Procedure is not available for this user
                No Fin profile:
                  value:
                    errors:
                      base: No Fin profile is configured to handle this conversation. Configure a Fin profile and retry.
                Conversation already exists:
                  value:
                    errors:
                      conversation_id: Fin session already exists for this conversation. Please use /reply to continue the conversation.
                Invalid environment on a Fin for Platforms workspace:
                  value:
                    errors:
                      environment: Invalid environment
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    description: Validation messages keyed by the field they apply to, or `base` for request-level failures.
                    example:
                      conversation_id: Conversation ID is required
                    additionalProperties: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                conversation_id:
                  type: string
                  description: Your external conversation ID. Fin creates a conversation for this ID. If a conversation already exists for it, use `/fin/reply` instead.
                  example: ext-123
                user:
                  $ref: '#/components/schemas/fin_agent_user'
                message:
                  type: object
                  description: Optional message posted to the conversation before the procedure runs. Only `body` is required.
                  properties:
                    body:
                      type: string
                      description: The body of the message.
                      example: Starting your refund request.
                    author:
                      type: string
                      enum:
                        - user
                        - agent
                        - fin
                      description: Accepted but has no effect. The trigger message is always posted as an operator message.
                      example: agent
                  required:
                    - body
                conversation_metadata:
                  type: object
                  description: Metadata about the conversation. Only attributes are accepted (no history).
                  properties:
                    attributes:
                      type: object
                      description: |
                        A hash of conversation attributes. Limit to 20 attributes.
                      maxProperties: 20
                      additionalProperties: true
                      example:
                        order_id: '98765'
                environment:
                  type: string
                  description: The identifier of the environment to start the conversation in. Only Fin for Platforms workspaces use it; other workspaces ignore it. Use the same value as `messenger_environment` in your Messenger installation. Defaults to the workspace's default environment. On a Fin for Platforms workspace, an identifier that matches no environment returns a 422 error.
                  example: a1b2c3d4e5
              required:
                - conversation_id
                - user
            examples:
              Basic procedure run:
                value:
                  conversation_id: ext-123
                  user:
                    id: '123456'
                    name: John Doe
                    email: john.doe@example.com
              Procedure run with trigger message and attributes:
                value:
                  conversation_id: ext-123
                  user:
                    id: '123456'
                    name: John Doe
                    email: john.doe@example.com
                  message:
                    author: agent
                    body: Starting your refund request.
                  conversation_metadata:
                    attributes:
                      order_id: '98765'
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
              data:
                type: object
                nullable: true
                additionalProperties: true
                description: Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
                example:
                  required_permissions:
                    - read_conversations
            required:
              - code
      required:
        - type
        - errors
    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_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>If you omit the header, the API uses the version set in your app package, and 1.0 if none is set.
      type: string
      example: '2.18'
      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'
        - '2.16'
        - '2.17'
        - '2.18'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
