# Publish analysis report

Publishes (signs) an analysis report, making it the official final report.
This operation:
1. Marks the report as finalized/signed
2. Generates PDF and DOC versions of the report
3. Stores the final report files

**Important:** Once published, the report becomes the official clinical
document. The published report can be retrieved using the
`/v1/analysis/signed_report_file` endpoint.
**Note:** The report must have variants added before it can be published.

Endpoint: POST /v1/analysis/report/publish
Version: 96
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `analysis_id` (string, required)
    The analysis (case) ID to publish the report for
    Example: 12345

## Response 200:

  - `200` (unknown)
    Report published successfully

## Response 200 fields (application/json):

  - `report_id` (string)
    The ID of the generated/published report
    Example: 67890

  - `report_file` (string)
    URL to the generated PDF report file
    Example: https://s3.amazonaws.com/bucket/reports/analysis_12345_report.pdf

  - `error` (string)
    Error message if report generation failed
    Example: null

## Response 400:

  - `400` (unknown)
    Bad request - report cannot be published

## Response 400 fields (application/json):

  - `error` (string, required)
    Error type
    Example: Not Found

  - `message` (string, required)
    Human-readable error description
    Example: Analysis with ID 12345 was not found

## Response 401:

  - `401` (unknown)
    Authentication failed - invalid or missing token

## Response 401 fields (application/json):

  - `error` (string, required)
    Error type
    Example: Not Found

  - `message` (string, required)
    Human-readable error description
    Example: Analysis with ID 12345 was not found

## Response 404:

  - `404` (unknown)
    Analysis not found

## Response 404 fields (application/json):

  - `error` (string, required)
    Error type
    Example: Not Found

  - `message` (string, required)
    Human-readable error description
    Example: Analysis with ID 12345 was not found

## Response 429:

  - `429` (unknown)
    Rate limit exceeded

## Response 429 fields (application/json):

  - `error` (string, required)
    Error type
    Example: Not Found

  - `message` (string, required)
    Human-readable error description
    Example: Analysis with ID 12345 was not found

## Response 429 headers (application/json):

  - `Retry-After` (integer)
    Number of seconds to wait before retrying

