> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-codex-docs-audit-20260719-0149.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Agent Task

> Get the status and result of an agent task by ID. `params.contextId` identifies the session containing the task.



## OpenAPI

````yaml post /a2a/agents/{id}/v1/tasks:get
openapi: 3.1.0
info:
  title: Agno API Reference
  description: The all-in-one, private, secure agent platform that runs in your cloud.
  version: 2.7.4
servers: []
security: []
paths:
  /a2a/agents/{id}/v1/tasks:get:
    post:
      tags:
        - A2A
      summary: Get Agent Task
      description: >-
        Get the status and result of an agent task by ID. `params.contextId`
        identifies the session containing the task.
      operationId: get_agent_task
      parameters:
        - name: id
          in: path
          required: true
          schema:
            title: Id
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetTaskRequest'
            example:
              jsonrpc: '2.0'
              id: request-123
              method: tasks/get
              params:
                id: task-456
                contextId: context-789
      responses:
        '200':
          description: Agent task retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTaskSuccessResponse'
              example:
                id: request-123
                jsonrpc: '2.0'
                result:
                  contextId: context-789
                  id: task-456
                  kind: task
                  status:
                    state: completed
        '400':
          description: >-
            Missing task or context ID, or task polling requested for a remote
            agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: Agent, session, or task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '501':
          description: Task polling is not supported for this agent type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotImplementedResponse'
      security:
        - {}
        - HTTPBearer: []
components:
  schemas:
    GetTaskRequest:
      description: Represents a JSON-RPC request for the `tasks/get` method.
      properties:
        id:
          anyOf:
            - type: string
            - type: integer
          title: Id
        jsonrpc:
          const: '2.0'
          default: '2.0'
          title: Jsonrpc
          type: string
        method:
          const: tasks/get
          default: tasks/get
          title: Method
          type: string
        params:
          $ref: '#/components/schemas/A2ARequest_TaskQueryParams'
      required:
        - id
        - params
      title: GetTaskRequest
      type: object
    GetTaskSuccessResponse:
      description: Represents a successful JSON-RPC response for the `tasks/get` method.
      properties:
        id:
          anyOf:
            - type: string
            - type: integer
            - type: 'null'
          default: null
          title: Id
        jsonrpc:
          const: '2.0'
          default: '2.0'
          title: Jsonrpc
          type: string
        result:
          $ref: '#/components/schemas/Task'
      required:
        - result
      title: GetTaskSuccessResponse
      type: object
    BadRequestResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: BadRequestResponse
      example:
        detail: Bad request
        error_code: BAD_REQUEST
    UnauthenticatedResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: UnauthenticatedResponse
      example:
        detail: Unauthenticated access
        error_code: UNAUTHENTICATED
    ForbiddenResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
      type: object
      required:
        - detail
      title: ForbiddenResponse
      example:
        detail: Insufficient permissions
    NotFoundResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: NotFoundResponse
      example:
        detail: Not found
        error_code: NOT_FOUND
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    NotImplementedResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
      type: object
      required:
        - detail
      title: NotImplementedResponse
      example:
        detail: Operation not supported for this resource type
    A2ARequest_TaskQueryParams:
      description: >-
        Defines parameters for querying a task, with an option to limit history
        length.
      properties:
        historyLength:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Historylength
        id:
          title: Id
          type: string
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Metadata
        contextId:
          type: string
          title: Context ID
          description: Agno session ID containing the task.
      required:
        - id
        - contextId
      title: TaskQueryParams
      type: object
    Task:
      properties:
        artifacts:
          anyOf:
            - items:
                $ref: '#/components/schemas/Artifact'
              type: array
            - type: 'null'
          title: Artifacts
        contextId:
          type: string
          title: Contextid
        history:
          anyOf:
            - items:
                $ref: '#/components/schemas/Message'
              type: array
            - type: 'null'
          title: History
        id:
          title: Id
          type: string
        kind:
          type: string
          const: task
          title: Kind
          default: task
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        status:
          $ref: '#/components/schemas/TaskStatus'
      type: object
      required:
        - contextId
        - id
        - status
      title: Task
      description: >-
        Represents a single, stateful operation or conversation between a client
        and an agent.
    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
    Artifact:
      properties:
        artifactId:
          type: string
          title: Artifactid
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        extensions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Extensions
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        parts:
          items:
            $ref: '#/components/schemas/Part'
          type: array
          title: Parts
      type: object
      required:
        - artifactId
        - parts
      title: Artifact
      description: >-
        Represents a file, data structure, or other resource generated by an
        agent during a task.
    Message:
      properties:
        contextId:
          anyOf:
            - type: string
            - type: 'null'
          title: Contextid
        extensions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Extensions
        kind:
          const: message
          default: message
          title: Kind
          type: string
        messageId:
          title: Messageid
          type: string
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        parts:
          items:
            $ref: '#/components/schemas/Part'
          type: array
          title: Parts
        referenceTaskIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Referencetaskids
        role:
          $ref: '#/components/schemas/Role'
        taskId:
          anyOf:
            - type: string
            - type: 'null'
          title: Taskid
      type: object
      required:
        - messageId
        - parts
        - role
      title: Message
      description: >-
        Represents a single message in the conversation between a user and an
        agent.
    TaskStatus:
      properties:
        message:
          anyOf:
            - $ref: '#/components/schemas/Message'
            - type: 'null'
        state:
          $ref: '#/components/schemas/TaskState'
        timestamp:
          anyOf:
            - type: string
            - type: 'null'
          title: Timestamp
          examples:
            - '2023-10-27T10:00:00Z'
      type: object
      required:
        - state
      title: TaskStatus
      description: Represents the status of a task at a specific point in time.
    Part:
      anyOf:
        - $ref: '#/components/schemas/TextPart'
        - $ref: '#/components/schemas/FilePart'
        - $ref: '#/components/schemas/DataPart'
      title: Part
    Role:
      type: string
      enum:
        - agent
        - user
      title: Role
      description: >-
        Identifies the sender of the message. `user` for the client, `agent` for
        the service.
    TaskState:
      type: string
      enum:
        - submitted
        - working
        - input-required
        - completed
        - canceled
        - failed
        - rejected
        - auth-required
        - unknown
      title: TaskState
      description: Defines the lifecycle states of a Task.
    TextPart:
      properties:
        kind:
          const: text
          default: text
          title: Kind
          type: string
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        text:
          title: Text
          type: string
      type: object
      required:
        - text
      title: TextPart
      description: Represents a text segment within a message or artifact.
    FilePart:
      properties:
        file:
          anyOf:
            - $ref: '#/components/schemas/FileWithBytes'
            - $ref: '#/components/schemas/FileWithUri'
          title: File
        kind:
          const: file
          default: file
          title: Kind
          type: string
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - file
      title: FilePart
      description: >-
        Represents a file segment within a message or artifact. The file content
        can be

        provided either directly as bytes or as a URI.
    DataPart:
      properties:
        data:
          additionalProperties: true
          title: Data
          type: object
        kind:
          const: data
          default: data
          title: Kind
          type: string
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - data
      title: DataPart
      description: >-
        Represents a structured data segment (e.g., JSON) within a message or
        artifact.
    FileWithBytes:
      properties:
        bytes:
          title: Bytes
          type: string
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - bytes
      title: FileWithBytes
      description: >-
        Represents a file with its content provided directly as a base64-encoded
        string.
    FileWithUri:
      properties:
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        uri:
          title: Uri
          type: string
      type: object
      required:
        - uri
      title: FileWithUri
      description: Represents a file with its content located at a specific URI.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````