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

# Poll async job

> Get the current status and result of an async job. Poll this endpoint until `status` is `completed` or `failed`. `output` and `memoryDelta` are only populated when `status === 'completed'`.



## OpenAPI

````yaml GET /v1/agent/jobs/{job_id}
openapi: 3.1.0
info:
  title: Kairn API
  version: 1.0.0
  description: >-
    The Kairn API. All requests require an `X-API-Key` header with your tenant
    API key.
servers:
  - url: https://api.kairn.sh
    description: Production
security:
  - ApiKey: []
tags:
  - name: Agent
    description: Invoke agents and stream responses.
  - name: Memory
    description: Read and write per-user agent memory.
  - name: Souls
    description: Manage agent identities.
  - name: Skills
    description: Manage custom skills (instructions and webhook tools).
  - name: Mandates
    description: Schedule autonomous agent tasks.
  - name: Invocations
    description: Inspect past agent runs.
  - name: Sessions
    description: Access multi-turn conversation history.
  - name: Audit
    description: Audit log for all agent activity.
paths:
  /v1/agent/jobs/{job_id}:
    get:
      tags:
        - Agent
      summary: Poll async job
      description: >-
        Get the current status and result of an async job. Poll this endpoint
        until `status` is `completed` or `failed`. `output` and `memoryDelta`
        are only populated when `status === 'completed'`.
      operationId: jobs-get
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
          description: The job ID returned by `POST /v1/agent/invoke/async`.
      responses:
        '200':
          description: Current job status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncJobResponse'
        '404':
          description: Job not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AsyncJobResponse:
      type: object
      properties:
        job_id:
          type: string
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
          description: Current job state. Poll until `completed` or `failed`.
        created_at:
          type: string
          format: date-time
        completed_at:
          type: string
          format: date-time
          nullable: true
        output:
          type: string
          nullable: true
          description: Agent response. Only present when `status` is `completed`.
        error:
          type: string
          nullable: true
          description: Error message. Only present when `status` is `failed`.
        memory_delta:
          type: object
          additionalProperties:
            type: string
          nullable: true
        tokens_input:
          type: integer
          nullable: true
        tokens_output:
          type: integer
          nullable: true
        duration_ms:
          type: integer
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
        error_type:
          type: string
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key

````

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