Skip to content

Export/Import Schema Reference

Response models for the export/import API, defined in admin_lambda/models/export_models.py.

Current schema version: 1.0.0 (EXPORT_VERSION constant).

Full Export Response Structure

FullExportResponse
├── metadata: ExportMetadata
└── data: FullExportData
    ├── configs: ConfigsExportData
    ├── aliases: AliasesExportData
    ├── infra: InfraExportData
    ├── queries: QueriesExportData
    ├── merchandising: MerchandisingExportData
    ├── feature_flags: FeatureFlagsExportData
    └── pixel: PixelExportData

Single-category endpoints return { metadata: ExportMetadata, data: <CategoryExportData> }.

All models use ConfigDict(frozen=True).


ExportMetadata

Included in every export response.

Field Type Description
exported_at datetime ISO 8601 timestamp of export
export_version string Schema version (currently "1.0.0")
source_account string system_account_id
source_index string index_name
index_id string {system_account_id}-{index_name}
included_categories string[] Categories present in this export
warnings string[] Non-fatal issues (e.g., failed infra fetch)

ConfigsExportData

Endpoint: GET /export/configs

Field Type Description
index_settings_record object Serialized IndexSettings persistence record

The full IndexSettings record includes create_index_config, search_config, collections_config, add_docs_config, agentic_config, and all other fields on the canonical model.


AliasesExportData

Endpoint: GET /export/aliases

Field Type Description
index_settings_record object Serialized IndexSettings persistence record

Alias configuration is stored within IndexSettings (index_aliases field).


InfraExportData

Endpoint: GET /export/infra

Field Type Description
control_plane_index_record object | null Serialized control-plane index record; null if fetch failed

When the control-plane read fails, the field is null and a warning is added to metadata.warnings.

This category is export-only and is never imported.


QueriesExportData

Endpoint: GET /export/queries

Field Type Description
query_config_records object[] Serialized QuerySearchConfigRecord persistence records
redirect_records object[] Serialized redirect records (currently always [])

Each query config record includes normalized_query, pk, sk, created_at, updated_at, updated_by, and the full config payload.


MerchandisingExportData

Endpoint: GET /export/merchandising

Field Type Description
config_record object | null Serialized MerchandisingIndexConfig or null if no config exists
view_records object[] Serialized MerchandisingViewRecord models across all TriggerContext values
global_rules_records object[] Serialized MerchandisingGlobalRulesRecord models across all TriggerContext values

FeatureFlagsExportData

Endpoint: GET /export/feature-flags

Field Type Description
index_settings_record object Serialized IndexSettings persistence record
static_feature_flags object Contents of the static feature flags file

PixelExportData

Endpoint: GET /export/pixel

Field Type Description
index_settings_record object Serialized IndexSettings persistence record

Pixel configuration (pixel_id) is stored within IndexSettings.


Example: Full Export Response

{
  "metadata": {
    "exported_at": "2026-02-22T10:30:00Z",
    "export_version": "1.0.0",
    "source_account": "acc-123",
    "source_index": "products",
    "index_id": "acc-123-products",
    "included_categories": [
      "configs", "aliases", "infra", "queries",
      "merchandising", "feature-flags", "pixel"
    ],
    "warnings": []
  },
  "data": {
    "configs": {
      "index_settings_record": {
        "system_account_id": "acc-123",
        "index_name": "products",
        "search_config": { "limit": 10 },
        "collections_config": { "enabled": true },
        "create_index_config": { "model": "hf/e5-base-v2", "type": "structured" }
      }
    },
    "aliases": {
      "index_settings_record": {
        "index_aliases": { "doc_writes": null, "doc_reads": null, "analytics": null }
      }
    },
    "infra": {
      "control_plane_index_record": {
        "storage_class": "marqo.balanced",
        "inference_type": "marqo.GPU",
        "number_of_inferences": 2,
        "number_of_replicas": 1,
        "marqo_version": "2.15.0"
      }
    },
    "queries": {
      "query_config_records": [
        {
          "normalized_query": "red shoes",
          "search_config_overrides": { "limit": 20 },
          "created_at": "2026-01-15T00:00:00Z",
          "updated_at": "2026-01-15T00:00:00Z"
        }
      ],
      "redirect_records": []
    },
    "merchandising": {
      "config_record": {
        "system_account_id": "acc-123",
        "index_details": { "index_name": "products", "index_url": "https://..." }
      },
      "view_records": [],
      "global_rules_records": []
    },
    "feature_flags": {
      "index_settings_record": {
        "feature_flags": { "enable_hybrid_search": true }
      },
      "static_feature_flags": { "global_flag_a": true }
    },
    "pixel": {
      "index_settings_record": {
        "pixel_id": "px-abc123"
      }
    }
  }
}

Design notes

Why serialized records, not projections? Export captures the canonical persistence model as-is. This keeps the export/import contract simple: import writes back the same record shape. There is no lossy transformation.

Why separate configs/aliases/pixel/feature-flags all reference index_settings_record? Different import operations extract different fields from the same IndexSettings record. Exporting the full record for each category avoids implicit coupling between what gets exported and what gets imported — each category is self-contained.