# Run a Fin procedure

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 or Server-Sent Events. If the
procedure pauses for user input, the conversation status becomes awaiting_user_reply —
send the user's response with /fin/reply.

Endpoint: POST /fin/procedures/{procedure_id}/run
Version: Preview
Security: bearerAuth

## Header parameters:

  - `Intercom-Version` (string)
    Intercom API version.By default, it's equal to the version set in the app package.
    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", "Preview"

## Path parameters:

  - `procedure_id` (string, required)
    The ID of the procedure to run.
    Example: "12345"

## Request fields (application/json):

  - `conversation_id` (string, required)
    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` (object, required)
    A user object representing the user in a Fin Agent conversation.

  - `user.id` (string, required)
    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"

  - `user.name` (string)
    The name of the user.
    Example: "John Doe"

  - `user.email` (string)
    The email of the user.
    Example: "john.doe@example.com"

  - `user.attributes` (object)
    A hash of attributes associated with the user.
Attributes can be used by Fin to target content and responses.
Limit to 10 attributes.
    Example: {"plan_type":"Pro","subscription_status":"active"}

  - `message` (object)
    A message exchanged within a Fin Agent conversation.

  - `message.author` (string, required)
    The author that created the message.
    Enum: "user", "agent", "fin"

  - `message.body` (string, required)
    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?"

  - `message.timestamp` (string)
    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"

  - `message.timestamp_ms` (string)
    The timestamp when the message was created, with millisecond precision.
Only present in event responses (fin_replied).
    Example: "2025-01-24T10:01:20.456Z"

  - `conversation_metadata` (object)
    Metadata about the conversation. Only attributes are accepted (no history).

  - `conversation_metadata.attributes` (object)
    A hash of conversation attributes. Limit to 10 attributes.
    Example: {"order_id":"98765"}

  - `settings` (object)
    Optional settings to control Fin's behaviour for this procedure run.

  - `settings.email` (boolean)
    When true, Fin formats its replies as email-style responses. Defaults to false (chat-style).
    Example: true

## Response 200 fields (application/json):

  - `conversation_id` (string)
    The ID of the conversation.
    Example: "ext-123"

  - `user_id` (string)
    The ID of the user.
    Example: "user-456"

  - `procedure_id` (string)
    The ID of the procedure that was run.
    Example: "12345"

  - `status` (string)
    Fin's current status in the conversation workflow.
    Enum: "thinking", "replying", "awaiting_user_reply", "escalated", "resolved", "complete"

  - `created_at_ms` (string)
    The timestamp the response was created at, with millisecond precision.
    Example: "2025-01-24T10:00:00.123Z"

  - `errors` (object)
    Contains error details if any user or conversation attribute updates failed.

  - `errors.user` (object)
    User-related attribute errors.

  - `errors.user.attributes` (object)
    Map of user attribute names to error messages.
    Example: {"invalid_attr":"User attribute 'invalid_attr' does not exist"}

  - `errors.conversation` (object)
    Conversation-related attribute errors.

  - `errors.conversation.attributes` (object)
    Map of conversation attribute names to error messages.
    Example: {"bad_attr":"Conversation attribute 'bad_attr' does not exist"}

  - `sse_subscription_url` (string)
    Optional. A URL to subscribe to Server-Sent Events (SSE) for this conversation, if SSE is enabled. The access token is a JWT with a 3-minute TTL. The token is revoked when Fin sets the conversation to awaiting_user_reply or complete status.
    Example: "https://primary-realtime.intercom-messenger.com/event-stream?channels=fin_agent_api:app123:ext-123&accessToken=eyJhbG...&rewind=2m"

## Response 400 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: "error.list"

  - `request_id` (string,null)
    Example: "f93ecfa8-d08a-4325-8694-89aeb89c8f85"

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: "unauthorized"

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

  - `errors.field` (string,null)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: "email"


