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

# Recover persisted agent Session state

> Reads the current stored Session, latest Turn and exact-bound approval references under current workspace authority. It does not start execution. Approval decisions are not successful tool results; a prepared Turn is not accepted. Response parts remain a separate cursor-based read.



## OpenAPI

````yaml /openapi-public.json get /agent_sessions/{id}
openapi: 3.1.0
info:
  title: Akua API
  version: 1.0.0
  description: >-
    Public API for managing Akua workspaces, clusters, products, and installs.


    Authenticate with a workspace API token via the `Authorization: Bearer
    sk_akua_...` header.


    A workspace-owned token implies its workspace. Broad tokens select the
    active workspace via the optional `Akua-Context` header.
  contact:
    name: Akua API support
    email: support@akua.dev
    url: https://akua.dev/docs
servers:
  - url: https://api.akua.dev/v1
    description: Production
security: []
tags:
  - name: Auth
    description: Authentication and token management.
  - name: Agent events
    description: Persisted agent transcripts and response recovery.
  - name: Custom domains
    description: Workspace custom domains and routing targets.
  - name: Cloudflare
    description: Cloudflare account credentials and gateway control.
  - name: Clusters
    description: Kubernetes clusters and cluster access operations.
  - name: ComputeConfigs
    description: Workspace compute provider configurations.
  - name: Entitlements
    description: Effective workspace capabilities and limits.
  - name: Dashboards
    description: Dashboard and widget resources.
  - name: Installs
    description: Installation and render operations.
  - name: Machines
    description: Compute machines and lifecycle events.
  - name: Notifications
    description: User notification state.
  - name: Offer Channels
    description: Private offer channels and policy versions.
  - name: Offers
    description: Marketplace offers and redemption tracking.
  - name: Operations
    description: Long-running operation status and controls.
  - name: Order Drafts
    description: Draft checkout orders and checkout sessions.
  - name: Organizations
    description: Organizations, memberships, and managed workspaces.
  - name: Packages
    description: Software packages, versions, and input schemas.
  - name: Products
    description: Marketplace product catalog resources.
  - name: Preview hostnames
    description: Install preview hostnames and routing state.
  - name: Quotas
    description: Workspace quota limits and usage.
  - name: Regions
    description: Available deployment regions.
  - name: Registry
    description: Container registry credentials and repositories.
  - name: Repository change requests
    description: Fork-backed repository change reviews and lifecycle actions.
  - name: Repositories
    description: Source repositories available to the workspace.
  - name: Secrets
    description: Workspace secrets and secret versions.
  - name: Snippets
    description: Reusable snippets and snippet runs.
  - name: Workspace subdomains
    description: Workspace subdomain identity.
  - name: Workspaces
    description: Workspace resources, members, and billing state.
paths:
  /agent_sessions/{id}:
    get:
      tags:
        - Agent events
      summary: Recover persisted agent Session state
      description: >-
        Reads the current stored Session, latest Turn and exact-bound approval
        references under current workspace authority. It does not start
        execution. Approval decisions are not successful tool results; a
        prepared Turn is not accepted. Response parts remain a separate
        cursor-based read.
      operationId: agentEvents.getSession
      parameters:
        - name: id
          in: path
          schema:
            type: string
            pattern: ^(?:ags_)?[a-zA-Z0-9]{1,50}$
          required: true
        - name: akua-context
          in: header
          schema:
            type: string
            minLength: 1
            maxLength: 54
          required: false
      responses:
        '200':
          description: AgentSessionSnapshot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSessionSnapshot'
        '400':
          description: The request is malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBadRequest'
        '401':
          description: Missing, invalid or expired credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorized'
        '403':
          description: The credential may not act in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiForbidden'
        '404':
          description: The resource was not found in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiNotFound'
        '503':
          description: The service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiServiceUnavailable'
      security:
        - BearerAuth: []
components:
  schemas:
    AgentSessionSnapshot:
      type: object
      properties:
        id:
          type: string
          pattern: ^(?:ags_)?[a-zA-Z0-9]{1,50}$
        workspace_id:
          type: string
          pattern: ^(?:ws_)?[a-zA-Z0-9]{1,50}$
        agent_id:
          type: string
          pattern: ^(?:agt_)?[a-zA-Z0-9]{1,50}$
        title:
          type: string
        state:
          type: string
          enum:
            - ACTIVE
            - WAITING_FOR_INPUT
            - WAITING_FOR_PERMISSION
            - COMPLETED
            - FAILED
            - CANCELLED
            - ARCHIVED
        revision:
          type: integer
          minimum: 1
          maximum: 9007199254740991
        high_watermark:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        latest_turn:
          anyOf:
            - type: object
              properties:
                id:
                  type: string
                  pattern: ^(?:atn_)?[a-zA-Z0-9]{1,50}$
                state:
                  type: string
                  enum:
                    - QUEUED
                    - RUNNING
                    - WAITING_FOR_INPUT
                    - WAITING_FOR_PERMISSION
                    - COMPLETED
                    - FAILED
                    - CANCELLED
                revision:
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
                accepted:
                  type: boolean
              required:
                - id
                - state
                - revision
                - accepted
              additionalProperties: false
            - type: 'null'
        approvals:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                pattern: ^(?:apr_)?[a-zA-Z0-9]{1,50}$
              turn_id:
                type: string
                pattern: ^(?:atn_)?[a-zA-Z0-9]{1,50}$
              state:
                type: string
                enum:
                  - PENDING
                  - APPROVED
                  - REJECTED
              title:
                type: string
              summary:
                type: string
              binding:
                type: string
                pattern: ^[a-f0-9]{64}$
              revision:
                type: integer
                minimum: 1
                maximum: 9007199254740991
              after_ui_cursor:
                type: integer
                minimum: 0
              expires_at:
                type: integer
                minimum: 0
            required:
              - id
              - turn_id
              - state
              - title
              - summary
              - binding
              - revision
              - after_ui_cursor
            additionalProperties: false
          maxItems: 64
      required:
        - id
        - workspace_id
        - agent_id
        - state
        - revision
        - high_watermark
        - latest_turn
        - approvals
      additionalProperties: false
    ApiBadRequest:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Validation
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiUnauthorized:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Unauthorized
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiForbidden:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Forbidden
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiNotFound:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - NotFound
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiServiceUnavailable:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - ServiceUnavailable
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiErrorEntry:
      type: object
      properties:
        code:
          type: integer
          description: Machine-readable error code
          examples:
            - 7002
        message:
          type: string
          description: Human-readable error message
          examples:
            - Resource not found
        path:
          type: array
          items:
            type: string
          description: Field path that caused the error, when applicable
          examples:
            - - body
              - name
        metadata:
          type: object
          additionalProperties:
            type: string
      required:
        - code
        - message
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      description: >-
        workspace API token (sk_akua_...) or OAuth2 JWT. Create tokens at
        https://akua.dev/developers/api-tokens
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.