> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chatsailer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve the routing trace for a conversation

> Why the agent went where it did: every routing edge it considered, which conditions passed, and the values they compared.

The most useful part is the edges that *lost*. An agent that will not leave a step has almost always failed a condition comparing a field that was never collected, and `likely_cause` names it.

Pass `since` to scope this to one turn — without it the trace covers every run on the conversation.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/conversations/{conversation_id}/trace
openapi: 3.1.0
info:
  description: >-
    The Sailer REST API for CRM, conversations, and campaigns.


    **Authentication.** Send a scoped token as `Authorization: Bearer
    sk_live_...`.

    Tokens are workspace-scoped; the workspace is implied by the token, so no

    tenant header is needed. A workspace administrator creates and revokes them;

    the secret is shown once at creation and cannot be recovered afterwards.


    **Pagination.** Collections return `{data, meta, links}`. Follow
    `links.next`

    until it is `null`; treat the cursor as opaque.


    **Errors.** Every non-2xx response is `{"error": {...}}` with a stable
    `code`.

    Quote `error.request_id` when contacting support.


    **Custom fields.** Workspace-defined fields appear under `custom_fields`,
    keyed

    by `field_key`. Read a record to see which keys a workspace uses; a
    dedicated

    field-discovery endpoint is not part of this release.
  title: Sailer API
  version: 1.0.0
servers:
  - url: https://api.chatsailer.com
security:
  - SailerApiToken: []
tags:
  - description: Token introspection and workspace capabilities.
    name: Meta
  - description: >-
      People you talk to. Called *leads* in older Sailer surfaces; `contact` is
      the current name.
    name: Contacts
  - description: Companies that contacts belong to (B2B accounts).
    name: Organizations
  - description: Opportunities moving through a pipeline.
    name: Deals
  - description: Pipelines and their stages.
    name: Pipelines
  - description: Field definitions, including custom fields.
    name: Fields
  - description: Free-text annotations on CRM records.
    name: Notes
  - description: Scheduled and logged CRM activities.
    name: Activities
  - description: Per-entity label catalogs.
    name: Tags
  - description: Message threads with contacts, across every channel.
    name: Conversations
  - description: Outbound campaigns and their participants.
    name: Campaigns
paths:
  /v1/conversations/{conversation_id}/trace:
    get:
      tags:
        - Conversations
      summary: Retrieve the routing trace for a conversation
      description: >-
        Why the agent went where it did: every routing edge it considered, which
        conditions passed, and the values they compared.


        The most useful part is the edges that *lost*. An agent that will not
        leave a step has almost always failed a condition comparing a field that
        was never collected, and `likely_cause` names it.


        Pass `since` to scope this to one turn — without it the trace covers
        every run on the conversation.
      operationId: get_conversation_trace
      parameters:
        - in: path
          name: conversation_id
          required: true
          schema:
            description: Unique identifier for a conversation.
            examples:
              - conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4
            pattern: ^conv_[0-9a-f]{32}$
            title: Conversation Id
            type: string
        - description: >-
            Only decisions recorded at or after this time. Without it the trace
            covers every run on the conversation, which on a long thread is a
            great deal of history.
          in: query
          name: since
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            description: >-
              Only decisions recorded at or after this time. Without it the
              trace covers every run on the conversation, which on a long thread
              is a great deal of history.
            title: Since
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationTrace'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - SailerApiToken: []
components:
  schemas:
    ConversationTrace:
      description: Why the agent went where it did, on one stretch of a conversation.
      properties:
        conversation_id:
          description: Unique identifier for a conversation.
          examples:
            - conv_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4
          pattern: ^conv_[0-9a-f]{32}$
          title: Conversation Id
          type: string
        decisions:
          items:
            $ref: '#/components/schemas/RoutingDecision'
          title: Decisions
          type: array
        likely_cause:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Set when edges lost because a field they compare was never collected
            — the answer to 'why is it stuck here'.
          title: Likely Cause
        object:
          const: conversation_trace
          default: conversation_trace
          title: Object
          type: string
        run_ids:
          description: >-
            The AI runs this trace covers. A single turn spans several when the
            agent replans.
          items:
            description: Unique identifier for an inference run.
            examples:
              - run_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4
            pattern: ^run_[0-9a-f]{32}$
            type: string
          title: Run Ids
          type: array
      required:
        - conversation_id
        - run_ids
      title: ConversationTrace
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    RoutingDecision:
      description: One edge the agent considered, taken or not.
      properties:
        conditions:
          items:
            $ref: '#/components/schemas/GateCondition'
          title: Conditions
          type: array
        edge_id:
          title: Edge Id
          type: string
        taken:
          title: Taken
          type: boolean
        to:
          anyOf:
            - type: string
            - type: 'null'
          description: Where the edge leads, by name.
          title: To
      required:
        - edge_id
        - taken
      title: RoutingDecision
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    GateCondition:
      description: One condition a routing edge compared, and how it came out.
      properties:
        actual:
          anyOf:
            - type: string
            - type: 'null'
          title: Actual
        expected:
          anyOf:
            - type: string
            - type: 'null'
          title: Expected
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        note:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Set when the condition compared a field that has no value yet — the
            commonest reason an agent refuses to move on.
          title: Note
        operator:
          anyOf:
            - type: string
            - type: 'null'
          title: Operator
        passed:
          title: Passed
          type: boolean
      required:
        - passed
      title: GateCondition
      type: object
  securitySchemes:
    SailerApiToken:
      description: >-
        A workspace API token. Create one in Settings → API. Send it as
        `Authorization: Bearer sk_live_...`.
      scheme: bearer
      type: http

````