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

# Download Content

> Download the content of a config instance.

| Scope                   | Required |
| ----------------------- | -------- |
| `config_instances:read` | Yes      |


## OpenAPI

````yaml /references/platform-api/2026-05-06.yaml get /config_instances/{config_instance_id}/content
openapi: 3.0.3
info:
  title: Miru Platform API
  description: The API between Miru and any external client
  version: 2026-05-06.rainier
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  x-release-version: 2026-05-06.rainier-beta.3
  x-git-commit:
    sha: 79734a65778aea4131f502774643d1d69a262542
    url: >-
      https://github.com/mirurobotics/openapi/commit/79734a65778aea4131f502774643d1d69a262542
    message: >-
      fix(release/stainless): publish stainless.yml asset for platform and
      device (#57)


      ## Summary


      The release workflow publishes a `stainless.yml` asset alongside each

      spec release for downstream Stainless SDK pipelines. It worked for `cli`

      and `frontend` audiences but silently skipped `platform` and `device`.


      **Root cause:** `STAINLESS_CONFIG` in `tools/release/stainless.py`

      pointed `device` and `platform` at a nested layout

      (`tools/stainless/{device,platform}/stainless.yml`) that never existed.

      The actual files have lived at the flat

      `tools/stainless/{device,platform}.yml` since commit `214bf44`

      (2026-03-04, "refactor(stainless): simplify config names to platform.yml

      and device.yml"). The mismatch was masked by `build_stainless_target`

      silently returning `None` when the source file was missing, so every

      platform and device release shipped without its `stainless.yml` asset.


      ## Changes


      1. **Fix the two paths in `STAINLESS_CONFIG`** to point at the flat

      `tools/stainless/{platform,device}.yml` layout that exists on disk.

      2. **Replace the silent `if not src.exists(): return None`** with `raise

      FileNotFoundError(...)` so a future mapped-but-missing config fails

      loudly. Audiences not in the dict (agent, mqtt, webhooks) still return

      `None` cleanly — that's the legitimate "no Stainless SDK for this

      audience" case.

      3. **Add regression tests:**

      - `test_known_audiences_have_real_files_on_disk` — parametrized over

      `STAINLESS_CONFIG.items()`, asserts each path resolves to an existing

      file. This is the test that would have caught the original bug.

      - `test_missing_src_for_mapped_audience_raises` — replaces the old

      `test_missing_src_returns_none`, pins the new loud-error contract.

      - `test_unmapped_audience_returns_none_cleanly` — pins the preserved

      clean-skip behaviour for unmapped audiences.


      Two existing build-target tests in

      `tools/release/tests/test_release_build.py` were rewired to mock

      `build_stainless_target`; they had been silently riding on the old

      skip-on-missing-source behaviour and would have failed under the new

      contract. The functional integration is already covered by

      `test_build_target_calls_stainless`.


      No CI workflow edits, no file restructuring under `tools/stainless/`, no

      historical-tag backfilling.


      ## Test plan


      - [ ] Unit tests pass (`tools/release/tests/`)

      - [ ] Preflight passes

      - [ ] Manual `./build/build-release.sh --snapshot` validation produces

      `platform.stainless.yml` and `device.stainless.yml` under `build/dist/`


      ---------


      Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
    author: ben-miru
    branch: HEAD
    dirty: false
  x-build:
    built_at: '2026-05-06T22:31:02.715859+00:00'
servers:
  - url: https://api.mirurobotics.com/beta
    description: Miru Platform API
security:
  - ApiKeyAuth: []
paths:
  /config_instances/{config_instance_id}/content:
    parameters:
      - $ref: '#/components/parameters/MiruVersion'
    get:
      tags:
        - Config Instances
      summary: Download Content
      description: Download the content of a config instance.
      operationId: getConfigInstanceContent
      parameters:
        - $ref: '#/components/parameters/config_instance_id'
        - $ref: '#/components/parameters/disposition'
      responses:
        '200':
          description: >-
            Successfully retrieved the config instance content. The Content-Type
            header is set according to the instance format.
          headers:
            Content-Disposition:
              description: >-
                Header indicating whether the file is returned inline or as an
                attachment.
              schema:
                type: string
                example: inline
            Content-Type:
              description: The MIME type of the instance content.
              schema:
                type: string
                example: application/json
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: The raw config instance content.
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from miru_platform_sdk import Miru

            client = Miru(
                api_key=os.environ.get("MIRU_API_KEY"),  # This is the default and can be omitted
            )
            response = client.config_instances.download(
                config_instance_id="cfg_inst_123",
            )
            print(response)
            content = response.read()
            print(content)
components:
  parameters:
    MiruVersion:
      name: Miru-Version
      in: header
      required: true
      schema:
        type: string
        example: 2026-05-06.rainier
      description: The API version the client was built against.
    config_instance_id:
      name: config_instance_id
      in: path
      required: true
      description: The unique identifier of the config instance.
      schema:
        type: string
        example: cfg_inst_123
    disposition:
      name: disposition
      in: query
      required: false
      description: >-
        Controls the Content-Disposition behavior. Use `inline` to display in
        browser or `attachment` to trigger a file download.
      schema:
        type: string
        enum:
          - inline
          - attachment
        default: inline
        example: inline
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: The API key to use for authentication.

````