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

# Render an existing snapshot into another format

> Renders the requested format from the snapshot's stored inventory and attaches it. Idempotent — an already-rendered format is returned unchanged; existing artifacts are never re-rendered or mutated.

`attribution` is only ever produced here: it additionally performs a live attribution fetch from the upstream intelligence source and stamps the returned artifact's `attribution_fetched_at`. An upstream failure (or an unresolvable component set) refuses to store or freeze anything and responds `502 upstream_unavailable`; an inventory with zero components responds `422 no_components`. A partial upstream fetch (some components unresolved) IS still frozen — the document lists what could not be resolved instead of dropping it silently.



## OpenAPI

````yaml /api-reference/earnie/sbom-openapi.json post /v1/sbom/snapshots/{snapshotId}:render
openapi: 3.0.3
info:
  title: Earnie SBOM API
  description: >-
    Generate SBOM snapshots from a scan, list a project's snapshots, and
    download them as CycloneDX or SPDX documents.
  version: 1.0.0
servers:
  - url: https://{tenant}.earnie.dev
    description: Your Earnie deployment
    variables:
      tenant:
        default: your-company
        description: >-
          Your organization's Earnie address, as shown in your browser when you
          sign in.
security:
  - bearerAuth: []
paths:
  /v1/sbom/snapshots/{snapshotId}:render:
    parameters:
      - name: snapshotId
        in: path
        required: true
        schema:
          type: string
          format: uuid
    post:
      tags:
        - sbom
      summary: Render an existing snapshot into another format
      description: >-
        Renders the requested format from the snapshot's stored inventory and
        attaches it. Idempotent — an already-rendered format is returned
        unchanged; existing artifacts are never re-rendered or mutated.


        `attribution` is only ever produced here: it additionally performs a
        live attribution fetch from the upstream intelligence source and stamps
        the returned artifact's `attribution_fetched_at`. An upstream failure
        (or an unresolvable component set) refuses to store or freeze anything
        and responds `502 upstream_unavailable`; an inventory with zero
        components responds `422 no_components`. A partial upstream fetch (some
        components unresolved) IS still frozen — the document lists what could
        not be resolved instead of dropping it silently.
      operationId: PostV1SbomSnapshotRender
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenderSnapshotRequest'
      responses:
        '200':
          description: The snapshot with the newly-attached (or already-present) artifact.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Snapshot'
        '401':
          description: Not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Missing `scans:write` (`insufficient_permission`), the API key's
            scanner restriction (`module_scope_forbidden`), or the
            organization's `oss` scanner setting (`module_disabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Snapshot not found (`snapshot_not_found`), unsupported format
            (`unsupported_format`), `spdx` for a snapshot without the `oss`
            section (`format_needs_oss`), or — `attribution` only — a reconciled
            inventory with zero components (`no_components`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            `attribution` only: the upstream attribution fetch failed, or no
            fetcher is configured (`upstream_unavailable`). Nothing is stored or
            frozen.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RenderSnapshotRequest:
      type: object
      required:
        - format
      description: Which format to render from an existing snapshot's stored inventory.
      properties:
        format:
          $ref: '#/components/schemas/RenderSnapshotFormat'
    Snapshot:
      type: object
      required:
        - id
        - scan_id
        - project_id
        - generated_at
        - generated_by
        - review_coverage
        - component_count
        - include_vulnerabilities
        - include_crypto
        - includes
        - model_count
        - inventory_schema_version
        - artifacts
      properties:
        id:
          type: string
          format: uuid
        scan_id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        generated_at:
          type: string
          format: date-time
        generated_by:
          $ref: '#/components/schemas/GeneratedBy'
        review_coverage:
          type: number
          format: double
          description: >-
            Share of reviewable finding occurrences with a current decision at
            generation time, 0..1 (soft gate — never blocks). Multiple files of
            one component are separate occurrences.
        component_count:
          type: integer
        include_vulnerabilities:
          type: boolean
        include_crypto:
          type: boolean
          description: Same as `includes` containing `crypto`.
        includes:
          type: array
          description: >-
            The sections this snapshot was generated with. A section that came
            out empty is still listed.
          items:
            $ref: '#/components/schemas/SnapshotSection'
        model_count:
          type: integer
          description: How many identified AI models the snapshot froze.
        inventory_schema_version:
          type: string
        stale:
          type: boolean
          description: >-
            True when the current effective decisions differ from the set
            captured for generation, including withdrawn decisions after
            reopening. Also true when currentness cannot be verified (legacy
            missing capture or unreadable review state). Only set on the newest
            snapshot in a project list; a read-time comparison, not stored
            state.
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/SnapshotArtifact'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code (extensible).
        message:
          type: string
    RenderSnapshotFormat:
      type: string
      enum:
        - cyclonedx
        - spdx
        - attribution
        - report-html
        - report-csv
        - report-xlsx
        - report-pdf
    GeneratedBy:
      type: object
      required:
        - kind
        - id
      description: The actor that generated the snapshot (audit provenance).
      properties:
        kind:
          type: string
          enum:
            - user
            - apikey
        id:
          type: string
          format: uuid
    SnapshotSection:
      type: string
      enum:
        - oss
        - crypto
        - ai
      description: >-
        A section a snapshot holds. `oss` is the open-source components (an
        SBOM), `crypto` the cryptographic assets (a CBOM), `ai` the identified
        AI models (an AIBOM).
    SnapshotArtifact:
      type: object
      required:
        - format
        - checksum
        - size_bytes
      description: One rendered document attached to a snapshot.
      properties:
        format:
          $ref: '#/components/schemas/SnapshotFormat'
        checksum:
          type: string
          description: SHA-256 hex digest of the rendered bytes.
        size_bytes:
          type: integer
          format: int64
        attribution_fetched_at:
          type: string
          format: date-time
          description: >-
            When this artifact's attribution data was fetched from the upstream
            intelligence source. Present only for the `attribution` format;
            absent for `cyclonedx`/`spdx`, whose content comes entirely from the
            stored inventory.
        omitted_sections:
          type: array
          description: >-
            The snapshot's sections this document cannot carry. Present only
            when there is one: an `spdx` document of a snapshot that includes
            `crypto` or `ai`. SPDX 2.3 has no element for a cryptographic asset
            or an AI model, so the document leaves them out, and its `comment`
            counts what it left out. The `cyclonedx` document of the same
            snapshot carries them.
          items:
            $ref: '#/components/schemas/SnapshotSection'
    SnapshotFormat:
      type: string
      enum:
        - cyclonedx
        - spdx
        - attribution
        - export-control
        - cra-sbom-annex
        - report-html
        - report-csv
        - report-xlsx
        - report-pdf
      description: >-
        Rendered SBOM format. `cyclonedx` (1.7) and `spdx` (2.3 Lite) can be
        produced by either generate or render-new-format. `attribution` is the
        OSPO attribution/notice document — it is **render-only**: `POST
        .../scans/{scanId}:generate` always rejects it (`unsupported_format`);
        only `POST .../snapshots/{snapshotId}:render` can produce it. It is
        rendered once from the stored inventory plus a live attribution fetch,
        then frozen like any other artifact — its
        `SnapshotArtifact.attribution_fetched_at` records when that fetch
        happened. `export-control` is a self-contained HTML evidence report
        frozen only when an entitled crypto snapshot is generated; it is
        download-only. `cra-sbom-annex` is a generation-only CycloneDX 1.7
        variant containing cryptographic assets as components. It accompanies a
        product SBOM; it is not a CRA conformity assessment. `report-html`,
        `report-csv`, `report-xlsx` and `report-pdf` are the human-readable
        report of the snapshot: a summary, the components and licenses, the
        vulnerabilities, the crypto inventory and the AI models the snapshot
        holds, and the review state frozen with it. They are **render-only**
        like `attribution`, but need no upstream fetch: both are built from the
        stored inventory alone. `report-html` is one self-contained,
        print-friendly page; `report-csv` is a `.zip` of one UTF-8 CSV per
        section. A section the caller may not see is in none of them.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An Earnie API key, sent as `Authorization: Bearer sk_earnie_...`. Create
        one under Settings > API keys. The key's scopes decide which operations
        it may call.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.