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

# Get Instance Plan

> Reconstruct the current plan for an agent instance.

Replays plan-related log events (PLAN_CREATED, PLAN_UPDATED,
STEP_STARTED, STEP_COMPLETED) to build the current plan state.

Returns:
    Instance plan with ordered steps and their statuses.

Raises:
    NotFoundError: If instance not found or belongs to another organization.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json get /agents/instances/{instance_id}/plan
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /agents/instances/{instance_id}/plan:
    get:
      tags:
        - agent-instances
      summary: Get Instance Plan
      description: |-
        Reconstruct the current plan for an agent instance.

        Replays plan-related log events (PLAN_CREATED, PLAN_UPDATED,
        STEP_STARTED, STEP_COMPLETED) to build the current plan state.

        Returns:
            Instance plan with ordered steps and their statuses.

        Raises:
            NotFoundError: If instance not found or belongs to another organization.
      operationId: agent-instances-get_instance_plan
      parameters:
        - name: instance_id
          in: path
          required: true
          schema:
            type: string
            title: Instance Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstancePlan'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    InstancePlan:
      properties:
        instance_id:
          type: string
          title: Instance Id
        steps:
          items:
            $ref: '#/components/schemas/PlanStep'
          type: array
          title: Steps
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
      type: object
      required:
        - instance_id
      title: InstancePlan
      description: |-
        Reconstructed plan for an agent instance, derived from log events.

        Attributes:
            instance_id: Agent instance this plan belongs to.
            steps: Ordered list of plan steps with current status.
            created_at: When the plan was first created.
            updated_at: When the plan was last modified.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PlanStep:
      properties:
        title:
          type: string
          title: Title
        status:
          type: string
          title: Status
          default: planned
        started_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
      type: object
      required:
        - title
      title: PlanStep
      description: |-
        A single step in an agent instance plan.

        Attributes:
            title: Human-readable description of the step.
            status: Current step status (planned, in_progress, completed, failed, skipped).
            started_at: When the step began execution.
            completed_at: When the step finished.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````