---
title: "Import a signed MIF bundle"
method: POST
path: "/api/interchange/import"
tags: ["Interchange"]
---

# Import a signed MIF bundle

`POST /api/interchange/import`

## Request

- Base URL: `http://localhost:38200`
- URL: `http://localhost:38200/api/interchange/import`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `token`

Accepts a MIF `.tar.gz` bundle as a multipart upload, verifies its Ed25519 manifest signature and per-blob content hashes, and upserts the contained contexts/links/chunks into the caller's tenant (idempotent on the bundle's portable ref, which becomes `contexts.external_id`). Wire format: `docs/interchange/mif-spec.md`.

## Response `200`

Import result.

- object
  - `mif_version` string
  - `source` object
    - `key_id` string
    - `exported_at` string, date-time
  - `contexts` object
    - `upserted` integer
    - `created` integer
    - `updated` integer
  - `links` object
    - `created` integer
    - `skipped` integer
  - `chunks` object
    - `upserted` integer
  - `provenance_recorded` integer

## Other responses

- `400`: Validation failure, no file uploaded, invalid/unsupported MIF package, or unsupported signing algorithm/version.
- `401`: Missing/invalid credentials, or no resolvable tenant context.
- `413`: Upload exceeds the 100 MB limit.
- `422`: Manifest signature invalid, or a blob's content hash doesn't match.

---

[API](https://skmtc.dev/contextq/apis/contextq-api.md) · [All operations](https://skmtc.dev/contextq/apis/contextq-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contextq/apis/contextq-api/revisions/7afc44056a22?raw)
