> ## Documentation Index
> Fetch the complete documentation index at: https://ara-90a60a07.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Export session trajectory

> Export the full session trajectory conforming to the Agent Trajectory Interchange Format (ATIF v1.7, RFC 0001). Contains sequential steps, user messages, agent reasoning, tool calls, environment observations, and token/cost metrics.

<sub>Scope: `sessions:read`</sub>



## OpenAPI

````yaml /openapi.json get /v3/organizations/{orgId}/sessions/{sessionId}/trajectory
openapi: 3.1.0
info:
  title: Ara API
  version: 3.0.0
  description: >-
    The Ara HTTP API. Drive cloud software-engineering agents: open sessions
    against your repositories, stream their work, and manage the secrets,
    knowledge, skills, and automations they run with.


    All requests authenticate with an `ara_` API key sent as a bearer token.
    Every resource is scoped to an organization; resolve your `org_id` once with
    `GET /v3/self`.
servers:
  - url: https://api.reasonmachines.ai
security:
  - araApiKey: []
tags:
  - name: Devices
    description: >-
      Owned Mac and headless Device identity, bounded enrollment and root
      grants.
  - name: Account
    description: Verify a key and resolve the organization it belongs to.
  - name: Projects
    description: >-
      Discover existing workspace projects to target when creating and listing
      sessions.
  - name: Sessions
    description: >-
      A session is one run of an agent against a repository: it reproduces the
      task, writes the code, verifies it, and opens a pull request or merge
      request.
  - name: Secrets
    description: >-
      Encrypted credentials injected into the agent's sandbox. Write-only:
      values can be set but never read back.
  - name: Knowledge
    description: Durable notes the agent consults while it works.
  - name: Memory
    description: >-
      Editable repository notes that are projected into native memory; generated
      memory remains read-only.
  - name: Skills
    description: >-
      Reusable instruction bundles Ara selects semantically from their
      descriptions for matching agent tasks.
  - name: Automations
    description: Recurring or one-time triggers that open sessions on a timetable.
  - name: Change Request Reviews
    description: >-
      Automated senior-engineer reviews posted on pull requests and merge
      requests.
  - name: Repositories
    description: Connected repositories, their indexing state, and generated wikis.
  - name: Git Connections
    description: Linked source-control accounts and the repositories they expose.
  - name: Consumption
    description: 'Billing-aligned usage: daily consumption and billing cycles.'
  - name: Metrics
    description: Aggregate analytics over sessions, change requests, and usage.
  - name: Audit Logs
    description: An append-only record of changes made within the organization.
  - name: Organizations
    description: The top-level tenant. Create, read, update, and delete organizations.
  - name: Members
    description: People in an organization and their pending invites.
  - name: Service Users
    description: Machine principals that own API keys for headless access.
  - name: Roles
    description: Role assignments that govern what each member can do.
  - name: Attachments
    description: >-
      Files uploaded to the organization and shared with sessions, downloaded
      via short-lived signed URLs.
  - name: Guardrails
    description: >-
      Per-repository automation limits and the violations recorded when a limit
      is hit.
  - name: MCP Servers
    description: >-
      Org-level Model Context Protocol servers exposed to the agent. Secret
      values are write-only.
  - name: Settings
    description: 'Organization configuration: namespaced settings and the run tag policy.'
  - name: Blueprints
    description: >-
      Read-only declarative manifests of an organization's agents (identity, run
      config, triggers, suite), with credentials redacted.
  - name: IP Access List
    description: >-
      Source-network allow-list that, when enabled, restricts the organization's
      API surface to a set of CIDR ranges.
  - name: Groups
    description: Manually-curated member groups carrying optional per-day resource limits.
  - name: Provider Credentials
    description: >-
      Configure Bring-Your-Own-Key (BYOK) API keys and subscription credentials
      for model providers. Secret values are write-only.
paths:
  /v3/organizations/{orgId}/sessions/{sessionId}/trajectory:
    parameters:
      - $ref: '#/components/parameters/orgId'
      - name: sessionId
        description: The session id.
        in: path
        required: true
        schema:
          type: string
    get:
      tags:
        - Sessions
      summary: Export session trajectory
      description: >-
        Export the full session trajectory conforming to the Agent Trajectory
        Interchange Format (ATIF v1.7, RFC 0001). Contains sequential steps,
        user messages, agent reasoning, tool calls, environment observations,
        and token/cost metrics.


        <sub>Scope: `sessions:read`</sub>
      operationId: getSessionTrajectory
      parameters:
        - in: query
          name: format
          schema:
            type: string
          description: 'Trajectory format to export. Supported values: atif (default).'
      responses:
        '200':
          description: The complete ATIF trajectory for the session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AtifTrajectory'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - araApiKey:
            - sessions:read
components:
  parameters:
    orgId:
      name: orgId
      in: path
      required: true
      description: Organization id or slug. Resolve it with `GET /v3/self`.
      schema:
        type: string
  schemas:
    AtifTrajectory:
      type: object
      properties:
        schema_version:
          type: string
          default: ATIF-v1.7
          description: ATIF schema version.
        session_id:
          type: string
          description: Run-scoped session identifier.
        trajectory_id:
          type: string
          description: Unique identifier for this trajectory document.
        agent:
          $ref: '#/components/schemas/AtifAgent'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/AtifStep'
        final_metrics:
          $ref: '#/components/schemas/AtifFinalMetrics'
        notes:
          type: string
        extra:
          type: object
      required:
        - schema_version
        - agent
        - steps
      description: >-
        Full session trajectory conforming to the Agent Trajectory Interchange
        Format (ATIF v1.7, RFC 0001).
    AtifAgent:
      type: object
      properties:
        name:
          type: string
        version:
          type: string
        model_name:
          type: string
        extra:
          type: object
      required:
        - name
        - version
    AtifStep:
      type: object
      properties:
        step_id:
          type: integer
          description: 1-based sequential step index.
        timestamp:
          type: string
          format: date-time
        source:
          type: string
          enum:
            - system
            - user
            - agent
          description: Originator of the step.
        model_name:
          type:
            - string
            - 'null'
        reasoning_effort:
          anyOf:
            - oneOf:
                - type: string
                - type: number
            - type: 'null'
        message:
          description: Message content or dialogue text.
          oneOf:
            - type: string
            - type: array
              items: {}
        reasoning_content:
          type:
            - string
            - 'null'
          description: Model internal reasoning content.
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/AtifToolCall'
        observation:
          $ref: '#/components/schemas/AtifObservation'
        metrics:
          $ref: '#/components/schemas/AtifMetrics'
        extra:
          type: object
      required:
        - step_id
        - source
        - message
    AtifFinalMetrics:
      type: object
      properties:
        total_prompt_tokens:
          type:
            - integer
            - 'null'
        total_completion_tokens:
          type:
            - integer
            - 'null'
        total_cached_tokens:
          type:
            - integer
            - 'null'
        total_cost_usd:
          type:
            - number
            - 'null'
        total_steps:
          type: integer
        extra:
          type: object
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        required_scope:
          type: string
          description: >-
            The capability required when the request was denied for a missing
            scope.
    AtifToolCall:
      type: object
      properties:
        tool_call_id:
          type: string
          description: Unique identifier for this specific tool call.
        function_name:
          type: string
          description: Name of the function/tool invoked.
        arguments:
          type: object
          description: Arguments passed to the tool.
        extra:
          type: object
      required:
        - tool_call_id
        - function_name
        - arguments
    AtifObservation:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/AtifObservationResult'
      required:
        - results
    AtifMetrics:
      type: object
      properties:
        prompt_tokens:
          type:
            - integer
            - 'null'
        completion_tokens:
          type:
            - integer
            - 'null'
        cached_tokens:
          type:
            - integer
            - 'null'
        cost_usd:
          type:
            - number
            - 'null'
        extra:
          type: object
    AtifObservationResult:
      type: object
      properties:
        source_call_id:
          type:
            - string
            - 'null'
          description: Matching tool_call_id from tool_calls.
        content:
          anyOf:
            - description: Output returned by the tool.
              oneOf:
                - type: string
                - type: array
                  items: {}
            - type: 'null'
        extra:
          type: object
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: prompt_required
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: session_not_found
  securitySchemes:
    araApiKey:
      type: http
      scheme: bearer
      bearerFormat: ara_<hex>
      description: >-
        Your `ara_` API key from Settings > Ara API. Keys are capability-scoped:
        run, mcp:read, mcp:write, secrets:read, secrets:write, sessions:read,
        sessions:debug, knowledge:read, memory:read, memory:write, skills:read,
        skills:write, repos:read, repos:write, reviews:read, reviews:write,
        deployment:read, analytics:read, org:read, org:write, attachments:read,
        attachments:write, guardrails:read, guardrails:write, automations:read,
        automations:write, agent_auth:read. mcp:write manages MCP server
        configuration only; it does not authorize remote MCP-tool execution.
        sessions:debug is privileged: it expands diagnostic session events only
        for organization owners/admins.

````