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

# Generate report and stream response

> Generate a report from a prompt using the Summation analyst agent,
streaming progress as Server-Sent Events until the report completes.
Generation can take minutes; the stream carries status and content
events, then a terminal event with the result.



## OpenAPI

````yaml https://api.summation.com/openapi.json post /v1/projects/{project_id}/reports/generations
openapi: 3.1.0
info:
  title: summation-api public API
  version: 0.1.0
servers: []
security: []
tags:
  - name: Auth
    description: Machine authentication for API clients.
  - name: Tenant
    description: Organization and tenant context resolved by summation-api.
  - name: Projects
    description: Project resources.
  - name: Conversations
    description: Conversation and message resources.
  - name: Reports
    description: Report resources and report operations.
  - name: Runs
    description: Project run history and execution status.
  - name: Playbooks
    description: Playbook resources.
  - name: Files
    description: Project file resources.
  - name: Catalog Entries
    description: Project-scoped data asset attachments.
  - name: Data Connectors
    description: Reusable external data source connections.
  - name: App Connectors
    description: External app connectors whose tools the agent can use during chat.
  - name: Tables
    description: Canonical table metadata and catalog.
  - name: Views
    description: Canonical Summation view metadata and catalog.
  - name: Query Executions
    description: Read-only SQL query execution.
  - name: Grid
    description: Materialized grid status, sync, and lineage.
  - name: Schedules
    description: Schedule and schedule run inspection.
paths:
  /v1/projects/{project_id}/reports/generations:
    post:
      tags:
        - Reports
      summary: Generate report and stream response
      description: |-
        Generate a report from a prompt using the Summation analyst agent,
        streaming progress as Server-Sent Events until the report completes.
        Generation can take minutes; the stream carries status and content
        events, then a terminal event with the result.
      operationId: generate_report
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            title: Project Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportGenerateRequest'
      responses:
        '200':
          description: >
            Server-Sent Events stream of agent activity.


            Each event is a UTF-8 line prefixed with `event:`, `id:`, or `data:`
            per the SSE spec. The `data:` payload is a JSON object with the
            shape `{"type": <event_type>, "sequence": <int>, "data": <object>}`.


            Event types emitted by the agent:

            - `status` — high-level progress; `data.message` (queued/running
            text) or `data.summary` (short status line)

            - `tool.started` — agent invoked a tool; `data.id`, `data.name`

            - `tool.input` — tool input arguments; `data.id`, `data.name`,
            `data.input`

            - `tool.completed` — tool finished; `data.id`

            - `message.delta` — incremental assistant text; `data.text` (append
            in order)

            - `done` — terminal event; `data.messageId`, `data.content` (final
            assistant message), `data.status` (`complete` / `error` /
            `cancelled`)


            Resumability: when the connection drops before `done`, the same
            stream can be resumed via `GET
            /v1/projects/{project_id}/conversations/{chat_id}/messages/{message_id}/events`.
          content:
            application/json:
              schema: {}
            text/event-stream:
              schema:
                type: string
        '400':
          description: Invalid request or unsupported option.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '401':
          description: Missing, invalid, or expired credentials.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '403':
          description: Authenticated but missing the required scope.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '404':
          description: Resource not found or not accessible.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '500':
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
      security:
        - SummationMachineAuth:
            - agent:write
components:
  schemas:
    ReportGenerateRequest:
      properties:
        message:
          type: string
          minLength: 1
          title: Message
          description: User message to send to the Summation agent.
        display_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Content
          description: >-
            Optional alternate rendering of the message for display; the agent
            still receives message.
        file_ids:
          items:
            type: string
          type: array
          title: File Ids
          description: Project file ids to attach to the message as context.
        mentioned_file_ids:
          items:
            type: string
          type: array
          title: Mentioned File Ids
          description: Project file ids referenced inline in the message.
        model:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Model
          description: >-
            Chat model id to use for this turn, from GET /v1/chat-models.
            Per-request model selection is honored where enabled for the tenant;
            otherwise the default model applies. The reply metadata reports the
            model that ran.
        effort:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
                - xhigh
                - max
            - type: 'null'
          title: Effort
          description: >-
            Reasoning effort for this turn (low, medium, high, xhigh, max).
            Honored under the same tenant setting as model selection; otherwise
            the default effort applies.
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: Optional conversation title; derived from the message when omitted.
      type: object
      required:
        - message
      title: ReportGenerateRequest
    ProblemError:
      description: >-
        Public error envelope (RFC 7807 ``application/problem+json``).


        Mirrors the body produced by :func:`api_error`. Declaring it in the
        contract

        lets generated clients type error handling instead of guessing.
      properties:
        type:
          description: URI reference identifying the problem type.
          title: Type
          type: string
        title:
          description: Short, human-readable summary of the problem type.
          title: Title
          type: string
        status:
          description: HTTP status code.
          title: Status
          type: integer
        detail:
          description: Human-readable explanation specific to this occurrence.
          title: Detail
          type: string
        code:
          description: Stable, machine-readable error code.
          title: Code
          type: string
        request_id:
          description: Correlation id, echoed in the x-request-id header.
          title: Request Id
          type: string
      required:
        - type
        - title
        - status
        - detail
        - code
        - request_id
      title: ProblemError
      type: object
    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
  securitySchemes:
    SummationMachineAuth:
      type: oauth2
      flows:
        clientCredentials:
          scopes:
            agent:read: agent:read
            agent:write: agent:write
          tokenUrl: /v1/auth/m2m/token

````