> ## 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.

# Update run

> Update run status and/or result



## OpenAPI

````yaml https://us-central-1.telnyxcloudstorage.com/clawd-docs/openapi/ai/missions.yml patch /ai/missions/{mission_id}/runs/{run_id}
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}:
    patch:
      tags:
        - Missions
      summary: Update run
      description: Update run status and/or result
      operationId: patch_public_missions_missions_mission_id_runs_run_id
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMissionRunRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MissionRunResponse'
        '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 run = await
            client.ai.missions.runs.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            {
              mission_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });


            console.log(run.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
            )
            run = client.ai.missions.runs.update(
                run_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                mission_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(run.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\trun, err := client.AI.Missions.Runs.Update(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\ttelnyx.AIMissionRunUpdateParams{\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\", run.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.RunUpdateParams;
            import com.telnyx.sdk.models.ai.missions.runs.RunUpdateResponse;

            public final class Main {
                private Main() {}

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

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

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

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

            puts(run)
components:
  schemas:
    UpdateMissionRunRequest:
      properties:
        status:
          $ref: '#/components/schemas/RunStatus'
        result_summary:
          title: Result Summary
          type: string
        result_payload:
          title: Result Payload
          additionalProperties: true
          type: object
        error:
          title: Error
          type: string
        metadata:
          title: Metadata
          additionalProperties: true
          type: object
      type: object
      title: UpdateMissionRunRequest
    MissionRunResponse:
      properties:
        data:
          $ref: '#/components/schemas/MissionRunData'
      type: object
      required:
        - data
      title: MissionRunResponse
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    RunStatus:
      type: string
      enum:
        - pending
        - running
        - paused
        - succeeded
        - failed
        - cancelled
      title: RunStatus
    MissionRunData:
      properties:
        run_id:
          type: string
          format: uuid
          title: Run Id
        mission_id:
          type: string
          format: uuid
          title: Mission Id
        status:
          $ref: '#/components/schemas/RunStatus'
        input:
          title: Input
          additionalProperties: true
          type: object
        started_at:
          type: string
          format: date-time
          title: Started At
        finished_at:
          title: Finished At
          type: string
          format: date-time
        result_summary:
          title: Result Summary
          type: string
        result_payload:
          title: Result Payload
          additionalProperties: true
          type: object
        error:
          title: Error
          type: string
        metadata:
          title: Metadata
          additionalProperties: true
          type: object
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - run_id
        - mission_id
        - status
        - started_at
        - updated_at
      title: MissionRunData
    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
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````