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

# Get plan

> Get the plan (all steps) for a run



## OpenAPI

````yaml https://us-central-1.telnyxcloudstorage.com/clawd-docs/openapi/ai/missions.yml get /ai/missions/{mission_id}/runs/{run_id}/plan
openapi: 3.1.0
info:
  title: Telnyx AI Missions API
  version: 2.0.0
  description: >-
    API for tracking multi-step AI agent activities with missions, runs, plans,
    and events.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /ai/missions/{mission_id}/runs/{run_id}/plan:
    get:
      tags:
        - Missions
      summary: Get plan
      description: Get the plan (all steps) for a run
      operationId: get_public_missions_missions_mission_id_runs_run_id_plan
      parameters:
        - name: mission_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Mission Id
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Run Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const plan = await
            client.ai.missions.runs.plan.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            {
              mission_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });


            console.log(plan.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            plan = client.ai.missions.runs.plan.retrieve(
                run_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                mission_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(plan.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tplan, err := client.AI.Missions.Runs.Plan.Get(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\ttelnyx.AIMissionRunPlanGetParams{\n\t\t\tMissionID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", plan.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.ai.missions.runs.plan.PlanRetrieveParams;

            import
            com.telnyx.sdk.models.ai.missions.runs.plan.PlanRetrieveResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    PlanRetrieveParams params = PlanRetrieveParams.builder()
                        .missionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                        .runId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                        .build();
                    PlanRetrieveResponse plan = client.ai().missions().runs().plan().retrieve(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            plan = telnyx.ai.missions.runs.plan.retrieve(
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              mission_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
            )

            puts(plan)
components:
  schemas:
    PlanResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/PlanStepData'
          type: array
          title: Data
      type: object
      required:
        - data
      title: PlanResponse
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    PlanStepData:
      properties:
        step_id:
          title: Step Id
          type: string
        run_id:
          type: string
          format: uuid
          title: Run Id
        parent_step_id:
          title: Parent Step Id
          type: string
        sequence:
          type: integer
          title: Sequence
        description:
          title: Description
          type: string
        status:
          $ref: '#/components/schemas/StepStatus'
        started_at:
          type: string
          format: date-time
          title: Started At
        completed_at:
          title: Completed At
          type: string
          format: date-time
        metadata:
          title: Metadata
          additionalProperties: true
          type: object
      type: object
      required:
        - step_id
        - run_id
        - sequence
        - description
        - status
      title: PlanStepData
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
    StepStatus:
      type: string
      enum:
        - pending
        - in_progress
        - completed
        - skipped
        - failed
      title: StepStatus
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````