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

# Resume a previously paused or crashed agent run

> Resumes a run from its last checkpoint. The response is an SSE stream whose first
event is `run-started`, followed by the same domain events as the original streaming
endpoint (e.g. `plan`, `step`, `answer` for AutoRag).

Concurrency: each call rotates the run's session id. If a second resume request
arrives while a first is in flight, the first wrapper exits silently on its next
checkpoint write; only the latest resume continues streaming events to its caller.

Terminal states are surfaced via HTTP status codes:
  - 410 Gone: run is Completed (the final answer is in the body) OR Expired
    (its resume cache is gone or no longer loadable). The body carries the original
    question and, for Completed runs, the rendered result.
  - 422 Unprocessable Content: run is in a Failed state
  - 404 Not Found: run does not exist or is not owned by the caller




## OpenAPI

````yaml /api-reference/openapi.yml post /query/runs/{runId}/resume
openapi: 3.0.3
info:
  title: DataLinks
  version: 2.2.3
servers:
  - url: https://api.datalinks.com/api/v1
    description: production server
security:
  - bearerAuth: []
  - openId:
      - implicit
paths:
  /query/runs/{runId}/resume:
    post:
      tags:
        - agentRuns
      summary: Resume a previously paused or crashed agent run
      description: >
        Resumes a run from its last checkpoint. The response is an SSE stream
        whose first

        event is `run-started`, followed by the same domain events as the
        original streaming

        endpoint (e.g. `plan`, `step`, `answer` for AutoRag).


        Concurrency: each call rotates the run's session id. If a second resume
        request

        arrives while a first is in flight, the first wrapper exits silently on
        its next

        checkpoint write; only the latest resume continues streaming events to
        its caller.


        Terminal states are surfaced via HTTP status codes:
          - 410 Gone: run is Completed (the final answer is in the body) OR Expired
            (its resume cache is gone or no longer loadable). The body carries the original
            question and, for Completed runs, the rendered result.
          - 422 Unprocessable Content: run is in a Failed state
          - 404 Not Found: run does not exist or is not owned by the caller
      operationId: resumeAgentRun
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: SSE stream of lifecycle and domain events for the resumed run.
          content:
            text/event-stream:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '410':
          description: Run is already completed or its checkpoint expired.
        '422':
          description: Run is in a failed state.
components:
  responses:
    Unauthorized:
      description: >-
        Unauthorized. This error occurs if the authentication token is missing
        or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      required:
        - error_code
        - message
      type: object
      properties:
        error_code:
          type: string
          example: UNAUTHORIZED
        error_message:
          type: string
          example: ''
        message:
          type: string
          example: Missing authentication token
        sub_errors:
          type: array
          items:
            required:
              - code
              - message
            type: object
            properties:
              code:
                type: string
              message:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      description: >
        Use a Bearer token for authentication. Submit the token using the
        `Authorization`

        header: `Authorization: Bearer <token>`.
      scheme: bearer
    openId:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://login.datalinks.com/realms/datalinks-realm/protocol/openid-connect/auth
          scopes:
            openid: openid

````