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

# Get Run Output URL

> Get a download URL for a Flow run structured output

## Behavior

* Returns a presigned URL to download the run's structured output file. The URL expires after `expires_in` seconds (currently 300).
* Only call this once [Get Run](/api-reference/flows/get-run) shows `output_ref` set on the run.
* Returns `404` with code `RUN_NOT_FOUND` if `runId` does not exist, or belongs to a different customer.
* Returns `404` with code `OUTPUT_NOT_AVAILABLE` if the run has not captured structured output — for example if it has not completed yet, or if the Flow doesn't produce structured output.


## OpenAPI

````yaml GET /flow-runs/{runId}/output-url
openapi: 3.0.1
info:
  version: 1.0.0
  title: Diligent Flows
  description: Trigger a Flow run and retrieve its result.
servers:
  - url: https://api.godiligent.ai
    description: Production
  - url: https://api.sandbox.godiligent.ai
    description: Sandbox
security:
  - xApiKey: []
tags:
  - name: Flows
    description: Trigger a Flow run and retrieve its result
paths:
  /flow-runs/{runId}/output-url:
    get:
      tags:
        - Flows
      summary: Get Run Output URL
      description: >-
        Returns a presigned URL to the run's structured output file. Only
        available once the run has completed with a structured output captured.
      operationId: getFlowRunOutputUrl
      parameters:
        - name: runId
          in: path
          description: The run's id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutputUrlResponse'
              example:
                url: https://s3.eu-west-1.amazonaws.com/...
                expires_in: 300
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Run not found, or no structured output captured for this run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                run_not_found:
                  value:
                    code: RUN_NOT_FOUND
                    message: 'Run not found: 8f14e45f-ceea-4c6b-a1b2-3c4d5e6f7890'
                output_not_available:
                  value:
                    code: OUTPUT_NOT_AVAILABLE
                    message: No structured output captured for this run
        '500':
          description: Internal Server Error
      security:
        - xApiKey: []
components:
  schemas:
    OutputUrlResponse:
      type: object
      required:
        - url
        - expires_in
      properties:
        url:
          type: string
          description: Presigned URL to download the run's structured output.
        expires_in:
          type: integer
          description: Seconds until the URL expires.
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            Machine-readable error code, e.g. FLOW_NOT_FOUND, RUN_NOT_FOUND,
            VALIDATION_ERROR.
        message:
          type: string
  securitySchemes:
    xApiKey:
      type: apiKey
      name: X-API-KEY
      in: header

````