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

# Get Task Trajectory

> Get the trajectory of a task.



## OpenAPI

````yaml /api-reference/tasks.yaml get /tasks/{task_id}/trajectory
openapi: 3.1.0
info:
  title: Tasks
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /tasks/{task_id}/trajectory:
    get:
      tags:
        - Tasks
      summary: Get Task Trajectory
      description: Get the trajectory of a task.
      operationId: get_task_trajectory_tasks__task_id__trajectory_get
      parameters:
        - in: path
          name: task_id
          required: true
          schema:
            format: uuid
            title: Task Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskTrajectoryResponse'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


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


            const response = await
            client.tasks.getTrajectory('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(response.trajectory);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.tasks.get_trajectory(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.trajectory)
components:
  schemas:
    TaskTrajectoryResponse:
      properties:
        trajectory:
          description: The trajectory of the task
          items:
            anyOf:
              - $ref: '#/components/schemas/TrajectoryQueuedEvent'
              - $ref: '#/components/schemas/TrajectoryCreatedEvent'
              - $ref: '#/components/schemas/TrajectoryExceptionEvent'
              - $ref: '#/components/schemas/TrajectoryCancelEvent'
              - $ref: '#/components/schemas/TrajectoryScreenshotEvent'
              - $ref: '#/components/schemas/TrajectoryStartEvent'
              - $ref: '#/components/schemas/TrajectoryFinalizeEvent'
              - $ref: '#/components/schemas/TrajectoryStopEvent'
              - $ref: '#/components/schemas/TrajectoryResultEvent'
              - $ref: '#/components/schemas/TrajectoryManagerInputEvent'
              - $ref: '#/components/schemas/TrajectoryManagerPlanEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorInputEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorResultEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentInputEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentResponseEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentToolCallEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentOutputEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentEndEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentExecuteEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentResultEvent'
              - $ref: '#/components/schemas/TrajectoryToolExecutionEvent'
              - $ref: '#/components/schemas/TrajectoryRecordUIStateEvent'
              - $ref: '#/components/schemas/TrajectoryManagerContextEvent'
              - $ref: '#/components/schemas/TrajectoryManagerResponseEvent'
              - $ref: '#/components/schemas/TrajectoryManagerPlanDetailsEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorContextEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorResponseEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorActionEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorActionResultEvent'
              - $ref: '#/components/schemas/TrajectoryUserMessageEvent'
              - $ref: '#/components/schemas/TrajectoryUnknownEvent'
          title: Trajectory
          type: array
      required:
        - trajectory
      title: TaskTrajectoryResponse
      type: object
    UnauthorizedResponse:
      properties:
        detail:
          default: You are not authorized to access this resource
          description: The detail of the error
          title: Detail
          type: string
        errors:
          default: []
          description: The errors
          items: {}
          title: Errors
          type: array
        status:
          default: 401
          description: The status code of the error
          title: Status
          type: integer
        title:
          default: Unauthorized
          description: The title of the error
          title: Title
          type: string
      title: UnauthorizedResponse
      type: object
    ErrorResponse:
      properties:
        detail:
          description: The detail of the error
          title: Detail
          type: string
        errors:
          description: The errors
          items: {}
          title: Errors
          type: array
        status:
          description: The status code of the error
          title: Status
          type: integer
        title:
          description: The title of the error
          title: Title
          type: string
      required:
        - title
        - status
        - detail
        - errors
      title: ErrorResponse
      type: object
    TrajectoryQueuedEvent:
      properties:
        data:
          $ref: '#/components/schemas/QueuedEvent'
        event:
          const: QueuedEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryQueuedEvent
      type: object
    TrajectoryCreatedEvent:
      properties:
        data:
          $ref: '#/components/schemas/CreatedEvent'
        event:
          const: CreatedEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryCreatedEvent
      type: object
    TrajectoryExceptionEvent:
      properties:
        data:
          $ref: '#/components/schemas/ExceptionEvent'
        event:
          const: ExceptionEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryExceptionEvent
      type: object
    TrajectoryCancelEvent:
      properties:
        data:
          $ref: '#/components/schemas/CancelEvent'
        event:
          const: CancelEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryCancelEvent
      type: object
    TrajectoryScreenshotEvent:
      properties:
        data:
          $ref: '#/components/schemas/ScreenshotEvent'
        event:
          const: ScreenshotEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryScreenshotEvent
      type: object
    TrajectoryStartEvent:
      properties:
        data:
          $ref: '#/components/schemas/StartEvent'
        event:
          const: StartEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryStartEvent
      type: object
    TrajectoryFinalizeEvent:
      properties:
        data:
          $ref: '#/components/schemas/FinalizeEvent'
        event:
          const: FinalizeEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryFinalizeEvent
      type: object
    TrajectoryStopEvent:
      properties:
        data:
          $ref: '#/components/schemas/StopEvent'
        event:
          const: StopEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryStopEvent
      type: object
    TrajectoryResultEvent:
      properties:
        data:
          $ref: '#/components/schemas/TaskAPIResultEvent'
        event:
          const: ResultEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryResultEvent
      type: object
    TrajectoryManagerInputEvent:
      properties:
        data:
          $ref: '#/components/schemas/ManagerInputEvent'
        event:
          const: ManagerInputEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryManagerInputEvent
      type: object
    TrajectoryManagerPlanEvent:
      properties:
        data:
          $ref: '#/components/schemas/ManagerPlanEvent'
        event:
          const: ManagerPlanEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryManagerPlanEvent
      type: object
    TrajectoryExecutorInputEvent:
      properties:
        data:
          $ref: '#/components/schemas/ExecutorInputEvent'
        event:
          const: ExecutorInputEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryExecutorInputEvent
      type: object
    TrajectoryExecutorResultEvent:
      properties:
        data:
          $ref: '#/components/schemas/ExecutorResultEvent'
        event:
          const: ExecutorResultEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryExecutorResultEvent
      type: object
    TrajectoryFastAgentInputEvent:
      properties:
        data:
          $ref: '#/components/schemas/FastAgentInputEvent'
        event:
          const: FastAgentInputEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryFastAgentInputEvent
      type: object
    TrajectoryFastAgentResponseEvent:
      properties:
        data:
          $ref: '#/components/schemas/FastAgentResponseEvent'
        event:
          const: FastAgentResponseEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryFastAgentResponseEvent
      type: object
    TrajectoryFastAgentToolCallEvent:
      properties:
        data:
          $ref: '#/components/schemas/FastAgentToolCallEvent'
        event:
          const: FastAgentToolCallEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryFastAgentToolCallEvent
      type: object
    TrajectoryFastAgentOutputEvent:
      properties:
        data:
          $ref: '#/components/schemas/FastAgentOutputEvent'
        event:
          const: FastAgentOutputEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryFastAgentOutputEvent
      type: object
    TrajectoryFastAgentEndEvent:
      properties:
        data:
          $ref: '#/components/schemas/FastAgentEndEvent'
        event:
          const: FastAgentEndEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryFastAgentEndEvent
      type: object
    TrajectoryFastAgentExecuteEvent:
      properties:
        data:
          $ref: '#/components/schemas/FastAgentExecuteEvent'
        event:
          const: FastAgentExecuteEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryFastAgentExecuteEvent
      type: object
    TrajectoryFastAgentResultEvent:
      properties:
        data:
          $ref: '#/components/schemas/FastAgentResultEvent'
        event:
          const: FastAgentResultEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryFastAgentResultEvent
      type: object
    TrajectoryToolExecutionEvent:
      properties:
        data:
          $ref: '#/components/schemas/ToolExecutionEvent'
        event:
          const: ToolExecutionEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryToolExecutionEvent
      type: object
    TrajectoryRecordUIStateEvent:
      properties:
        data:
          $ref: '#/components/schemas/RecordUIStateEvent'
        event:
          const: RecordUIStateEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryRecordUIStateEvent
      type: object
    TrajectoryManagerContextEvent:
      properties:
        data:
          $ref: '#/components/schemas/ManagerContextEvent'
        event:
          const: ManagerContextEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryManagerContextEvent
      type: object
    TrajectoryManagerResponseEvent:
      properties:
        data:
          $ref: '#/components/schemas/ManagerResponseEvent'
        event:
          const: ManagerResponseEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryManagerResponseEvent
      type: object
    TrajectoryManagerPlanDetailsEvent:
      properties:
        data:
          $ref: '#/components/schemas/ManagerPlanDetailsEvent'
        event:
          const: ManagerPlanDetailsEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryManagerPlanDetailsEvent
      type: object
    TrajectoryExecutorContextEvent:
      properties:
        data:
          $ref: '#/components/schemas/ExecutorContextEvent'
        event:
          const: ExecutorContextEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryExecutorContextEvent
      type: object
    TrajectoryExecutorResponseEvent:
      properties:
        data:
          $ref: '#/components/schemas/ExecutorResponseEvent'
        event:
          const: ExecutorResponseEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryExecutorResponseEvent
      type: object
    TrajectoryExecutorActionEvent:
      properties:
        data:
          $ref: '#/components/schemas/ExecutorActionEvent'
        event:
          const: ExecutorActionEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryExecutorActionEvent
      type: object
    TrajectoryExecutorActionResultEvent:
      properties:
        data:
          $ref: '#/components/schemas/ExecutorActionResultEvent'
        event:
          const: ExecutorActionResultEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryExecutorActionResultEvent
      type: object
    TrajectoryUserMessageEvent:
      properties:
        data:
          $ref: '#/components/schemas/UserMessageEvent'
        event:
          const: UserMessageEvent
          title: Event
          type: string
      required:
        - event
        - data
      title: TrajectoryUserMessageEvent
      type: object
    TrajectoryUnknownEvent:
      properties:
        data:
          additionalProperties: true
          default: {}
          title: Data
          type: object
        event:
          title: Event
          type: string
      required:
        - event
      title: TrajectoryUnknownEvent
      type: object
    QueuedEvent:
      description: Emitted to SSE clients when the task is waiting in the device queue.
      properties:
        id:
          title: Id
          type: string
        status:
          default: queued
          title: Status
          type: string
      required:
        - id
      title: QueuedEvent
      type: object
    CreatedEvent:
      properties:
        id:
          title: Id
          type: string
        streamUrl:
          title: Streamurl
          type: string
      required:
        - id
        - streamUrl
      title: CreatedEvent
      type: object
    ExceptionEvent:
      properties:
        exception:
          title: Exception
          type: string
      required:
        - exception
      title: ExceptionEvent
      type: object
    CancelEvent:
      properties:
        reason:
          title: Reason
          type: string
      required:
        - reason
      title: CancelEvent
      type: object
    ScreenshotEvent:
      properties:
        index:
          title: Index
          type: integer
        url:
          title: Url
          type: string
      required:
        - url
        - index
      title: ScreenshotEvent
      type: object
    StartEvent:
      properties: {}
      title: StartEvent
      type: object
    FinalizeEvent:
      properties:
        reason:
          title: Reason
          type: string
        success:
          title: Success
          type: boolean
      required:
        - success
        - reason
      title: FinalizeEvent
      type: object
    StopEvent:
      properties: {}
      title: StopEvent
      type: object
    TaskAPIResultEvent:
      description: Final result event of a task.
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        steps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Steps
        structured_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Structured Output
        success:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Success
      title: TaskAPIResultEvent
      type: object
    ManagerInputEvent:
      properties: {}
      title: ManagerInputEvent
      type: object
    ManagerPlanEvent:
      properties:
        answer:
          default: ''
          title: Answer
          type: string
        current_subgoal:
          title: Current Subgoal
          type: string
        plan:
          title: Plan
          type: string
        success:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Success
        thought:
          title: Thought
          type: string
      required:
        - plan
        - current_subgoal
        - thought
      title: ManagerPlanEvent
      type: object
    ExecutorInputEvent:
      properties:
        current_subgoal:
          title: Current Subgoal
          type: string
      required:
        - current_subgoal
      title: ExecutorInputEvent
      type: object
    ExecutorResultEvent:
      properties:
        action:
          additionalProperties: true
          title: Action
          type: object
        error:
          title: Error
          type: string
        outcome:
          title: Outcome
          type: boolean
        summary:
          title: Summary
          type: string
      required:
        - action
        - outcome
        - error
        - summary
      title: ExecutorResultEvent
      type: object
    FastAgentInputEvent:
      properties: {}
      title: FastAgentInputEvent
      type: object
    FastAgentResponseEvent:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Code
        thought:
          title: Thought
          type: string
        tool_call_status:
          $ref: '#/components/schemas/ToolCallParseStatus'
          default: no_markup
        usage:
          anyOf:
            - $ref: '#/components/schemas/UsageResult'
            - type: 'null'
          default: null
      required:
        - thought
      title: FastAgentResponseEvent
      type: object
    FastAgentToolCallEvent:
      properties:
        tool_calls_repr:
          title: Tool Calls Repr
          type: string
      required:
        - tool_calls_repr
      title: FastAgentToolCallEvent
      type: object
    FastAgentOutputEvent:
      properties:
        output:
          title: Output
          type: string
      required:
        - output
      title: FastAgentOutputEvent
      type: object
    FastAgentEndEvent:
      properties:
        reason:
          title: Reason
          type: string
        success:
          title: Success
          type: boolean
        tool_call_count:
          default: 0
          title: Tool Call Count
          type: integer
      required:
        - success
        - reason
      title: FastAgentEndEvent
      type: object
    FastAgentExecuteEvent:
      properties:
        instruction:
          title: Instruction
          type: string
      required:
        - instruction
      title: FastAgentExecuteEvent
      type: object
    FastAgentResultEvent:
      properties:
        instruction:
          title: Instruction
          type: string
        reason:
          title: Reason
          type: string
        success:
          title: Success
          type: boolean
      required:
        - success
        - reason
        - instruction
      title: FastAgentResultEvent
      type: object
    ToolExecutionEvent:
      properties:
        success:
          title: Success
          type: boolean
        summary:
          title: Summary
          type: string
        tool_args:
          additionalProperties: true
          title: Tool Args
          type: object
        tool_name:
          title: Tool Name
          type: string
      required:
        - tool_name
        - tool_args
        - success
        - summary
      title: ToolExecutionEvent
      type: object
    RecordUIStateEvent:
      properties:
        index:
          title: Index
          type: integer
        url:
          title: Url
          type: string
      required:
        - url
        - index
      title: RecordUIStateEvent
      type: object
    ManagerContextEvent:
      properties: {}
      title: ManagerContextEvent
      type: object
    ManagerResponseEvent:
      properties:
        response:
          title: Response
          type: string
        usage:
          anyOf:
            - $ref: '#/components/schemas/UsageResult'
            - type: 'null'
          default: null
      required:
        - response
      title: ManagerResponseEvent
      type: object
    ManagerPlanDetailsEvent:
      properties:
        answer:
          default: ''
          title: Answer
          type: string
        full_response:
          default: ''
          title: Full Response
          type: string
        memory_update:
          default: ''
          title: Memory Update
          type: string
        plan:
          title: Plan
          type: string
        progress_summary:
          default: ''
          title: Progress Summary
          type: string
        subgoal:
          title: Subgoal
          type: string
        success:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Success
        thought:
          title: Thought
          type: string
      required:
        - plan
        - subgoal
        - thought
      title: ManagerPlanDetailsEvent
      type: object
    ExecutorContextEvent:
      properties:
        subgoal:
          title: Subgoal
          type: string
      required:
        - subgoal
      title: ExecutorContextEvent
      type: object
    ExecutorResponseEvent:
      properties:
        response:
          title: Response
          type: string
        usage:
          anyOf:
            - $ref: '#/components/schemas/UsageResult'
            - type: 'null'
          default: null
      required:
        - response
      title: ExecutorResponseEvent
      type: object
    ExecutorActionEvent:
      properties:
        action_json:
          title: Action Json
          type: string
        description:
          title: Description
          type: string
        full_response:
          default: ''
          title: Full Response
          type: string
        thought:
          title: Thought
          type: string
      required:
        - action_json
        - thought
        - description
      title: ExecutorActionEvent
      type: object
    ExecutorActionResultEvent:
      properties:
        action:
          additionalProperties: true
          title: Action
          type: object
        error:
          title: Error
          type: string
        full_response:
          default: ''
          title: Full Response
          type: string
        success:
          title: Success
          type: boolean
        summary:
          title: Summary
          type: string
        thought:
          default: ''
          title: Thought
          type: string
      required:
        - action
        - success
        - error
        - summary
      title: ExecutorActionResultEvent
      type: object
    UserMessageEvent:
      description: >-
        Tracks the lifecycle of an external user message: queued → applied |
        dropped.
      properties:
        action:
          title: Action
          type: string
        consumer:
          anyOf:
            - type: string
            - type: 'null'
          title: Consumer
        message_ids:
          items:
            type: string
          title: Message Ids
          type: array
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        step_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Step Number
      required:
        - action
        - message_ids
      title: UserMessageEvent
      type: object
    ToolCallParseStatus:
      description: Classification of tool-call markup in an LLM response.
      enum:
        - valid
        - no_markup
        - malformed
      title: ToolCallParseStatus
      type: string
    UsageResult:
      properties:
        request_tokens:
          title: Request Tokens
          type: integer
        requests:
          title: Requests
          type: integer
        response_tokens:
          title: Response Tokens
          type: integer
        total_tokens:
          title: Total Tokens
          type: integer
      required:
        - request_tokens
        - response_tokens
        - total_tokens
        - requests
      title: UsageResult
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

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