Parcha DownloadReport API

The DownloadReport API from Parcha — 2 operation(s) for downloadreport.

OpenAPI Specification

parcha-downloadreport-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Parcha Admin DownloadReport API
  version: 1.0.0
  description: API for managing Parcha jobs and checks
servers:
- url: https://api.parcha.ai/api/v1
  description: Agent Hub API server
- url: https://demo.parcha.ai/api/v1
  description: Sandbox API server
- url: https://us1.parcha.ai/api/v1
  description: Legacy API server
- url: http://{your-company-domain}.parcha.ai/api/v1
  description: Custom Enterpris server (your company's API server)
security:
- bearerAuth: []
tags:
- name: DownloadReport
paths:
  /downloadReport:
    post:
      security:
      - bearerAuth: []
      summary: Download report
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportDownloadRequest'
      responses:
        '200':
          description: Report downloaded successfully
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '401':
          description: Unauthorized
        '404':
          description: Report not found
      tags:
      - DownloadReport
  /api/v1/downloadReport:
    post:
      summary: Download Report
      description: "Download a report for a specific case and agent.\n\nArgs:\n    report_request: Request containing case_id and agent_key\nReturns:\n    StreamingResponse: The PDF report content with appropriate headers\n    or JSONResponse: Error message if download fails"
      operationId: download_report_api_v1_downloadReport_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportDownloadRequest_2'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
      tags:
      - DownloadReport
components:
  schemas:
    ReportDownloadRequest_2:
      properties:
        case_id:
          type: string
          title: Case Id
        agent_key:
          type: string
          title: Agent Key
        force_refresh_report:
          type: boolean
          title: Force Refresh Report
          default: false
        download_test_report:
          type: boolean
          title: Download Test Report
          default: false
        report_version:
          type: string
          title: Report Version
          default: v1
      type: object
      required:
      - case_id
      - agent_key
      title: ReportDownloadRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    ReportDownloadRequest:
      type: object
      required:
      - case_id
      - agent_key
      properties:
        case_id:
          type: string
          description: The unique identifier of the case
        agent_key:
          type: string
          description: The key of the agent to use for generating the report
        force_refresh_report:
          type: boolean
          default: false
          description: If true, forces regeneration of the report even if cached
        download_test_report:
          type: boolean
          default: false
          description: If true, returns a placeholder test report (useful for testing the endpoint)
        report_version:
          type: string
          enum:
          - v1
          - v2
          default: v1
          description: The report version to use. Use "v2" for the latest Parcha 2.0 report format with enhanced styling and layout.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from your Parcha account settings. Include as Bearer token in the Authorization header.