> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Get migration

GET https://api-gateway.merge.dev/v1/migrations/{migration_id}

Get a single migration with its most-recent events embedded, plus the
advisory eval-gate verdict when a suite is linked.

Reference: https://docs.merge.dev/merge-gateway/migrations-api/migrations/get-migration

## Authentication

- `Authorization` header (bearer token, required) — Your gateway API key (mg_ prefix), the same key used for /v1/responses

## Request

### Path parameters

- `migration_id` (string, required)

## Response

### 200

Successful Response

- `id` (string, required)
- `baseline_model` (string, required)
- `candidate_model` (string, required)
- `status` (string, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `shadow_daily_budget_usd` (double, optional, nullable)
- `shadow_sample_rate` (double, optional, default: 1)
- `cutover_mode` (string, optional, default: policy_rewrite)
- `created_by` (string, optional, nullable)
- `experiment_suite_id` (string, optional, nullable)
- `events` (list of MigrationEventOut, optional)
- `eval_gate` (map from string to any, optional, nullable)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### MigrationEventOut

- `id` (string, required)
- `migration_id` (string, required)
- `actor` (string, required)
- `event` (string, required)
- `created_at` (datetime, required)
- `old_status` (string, optional, nullable)
- `new_status` (string, optional, nullable)
- `detail` (map from string to any, optional, nullable)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "id": "string",
  "baseline_model": "string",
  "candidate_model": "string",
  "status": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "shadow_daily_budget_usd": 1.1,
  "shadow_sample_rate": 1,
  "cutover_mode": "policy_rewrite",
  "created_by": "string",
  "experiment_suite_id": "string",
  "events": [
    {
      "id": "string",
      "migration_id": "string",
      "actor": "string",
      "event": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "old_status": "string",
      "new_status": "string",
      "detail": {}
    }
  ],
  "eval_gate": {}
}
```

**SDK Code**

```python
import requests

url = "https://api-gateway.merge.dev/v1/migrations/migration_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-gateway.merge.dev/v1/migrations/migration_id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-gateway.merge.dev/v1/migrations/migration_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-gateway.merge.dev/v1/migrations/migration_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-gateway.merge.dev/v1/migrations/migration_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-gateway.merge.dev/v1/migrations/migration_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-gateway.merge.dev/v1/migrations/migration_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway.merge.dev/v1/migrations/migration_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```