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

# Grounded search-result summary

> Rehydrates candidates from one catalog revision and optionally generates a Gemini summary with allowlisted citations.



## OpenAPI

````yaml https://raw.githubusercontent.com/prefeitura-rio/app-catalogo/refs/heads/main/docs/openapi-v3.json post /api/public/search-summary
openapi: 3.0.0
info:
  contact:
    name: Prefeitura do Rio de Janeiro
    url: https://github.com/prefeitura-rio/app-catalogo
  description: >-
    Discovery layer unificada da Prefeitura do Rio de Janeiro. Indexa serviços
    públicos, cursos, vagas e oportunidades MEI com busca full-text e
    recomendação personalizada por perfil de cidadão.
  title: app-catalogo
  version: '1.0'
servers:
  - url: https://services.staging.app.dados.rio/catalogo
    description: Staging
  - url: https://services.pref.rio/catalogo
    description: Produção
security: []
paths:
  /api/public/search-summary:
    post:
      tags:
        - busca
      summary: Grounded search-result summary
      description: >-
        Rehydrates candidates from one catalog revision and optionally generates
        a Gemini summary with allowlisted citations.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/models.SearchSummaryRequest'
        description: Search summary context
        required: true
        x-max-body-bytes: 16384
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.SearchSummaryResponse'
          description: OK
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '400':
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
          description: Bad Request
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '409':
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
          description: Conflict
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '413':
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
          description: Request Entity Too Large
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '504':
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
          description: Gateway Timeout
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
components:
  schemas:
    models.SearchSummaryRequest:
      properties:
        candidate_ids:
          items:
            format: uuid
            type: string
          maxItems: 10
          minItems: 1
          type: array
          uniqueItems: true
        catalog_revision:
          type: string
          minLength: 1
          maxLength: 256
          pattern: '^catalog-v2:'
        query:
          type: string
          minLength: 1
          maxLength: 256
          pattern: \S
      required:
        - candidate_ids
        - catalog_revision
        - query
      type: object
      additionalProperties: false
    models.SearchSummaryResponse:
      properties:
        generated:
          type: boolean
        query:
          type: string
        segments:
          items:
            $ref: '#/components/schemas/models.SearchSummarySegment'
          maxItems: 20
          type: array
      required:
        - generated
        - query
        - segments
      type: object
      additionalProperties: false
    models.SearchSummarySegment:
      properties:
        slug:
          type: string
          minLength: 1
          maxLength: 500
        text:
          type: string
          minLength: 1
          maxLength: 16000
          pattern: \S
        url:
          format: uri
          type: string
          minLength: 1
          maxLength: 2048
      required:
        - text
      type: object
      additionalProperties: false
  headers:
    X-Request-ID:
      description: Canonical UUID used to correlate the response with application logs.
      schema:
        format: uuid
        type: string

````