Migrations API

Automate a model migration from draft through shadow traffic to cutover

The Migrations API drives the model migration lifecycle programmatically: create a migration linked to an eval suite, move it through shadowing while reading the baseline-versus-candidate comparison, and complete it by rewriting the routing policies you select. Reverting restores the rewritten policies and skips any edited since the cutover.

State transitions go through PATCH with exactly one action per request: a status change, an eval suite link, or a shadow_sample_rate change.

Base URL

https://api-gateway.merge.dev

Authentication

Authenticate with your gateway API key as a bearer token, the same mg_ key you use for /v1/responses. The organization is derived from the key.

Authorization: Bearer mg_<your_api_key>

Any active gateway key for your organization can drive the full migration lifecycle, including completion. Treat keys used in automation with the same care as a deploy credential.