---
title: "GET /sites/{site_id}/database/migrations/{name}"
method: GET
path: "/sites/{site_id}/database/migrations/{name}"
tags: ["database"]
---

# GET /sites/{site_id}/database/migrations/{name}

`GET /sites/{site_id}/database/migrations/{name}`

Returns the contents of a named migration for the specified branch.

## Query parameters

- `branch` string

## Response `200`

OK

- DatabaseMigrationDetail — A migration with its file contents
  - `version` integer — The migration version number
  - `name` string — The migration name
  - `path` string — The path to the migration file in the deploy bundle
  - `content` string — The raw contents of the migration file

## Other responses

- `404` — Migration, database, or branch not found
- `423` — Database is disabled
- `default` — error

## Changes

- **2025-10-01** `dd4e48196663` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/netlify/apis/netlify-s-api-documentation/changes/sites/:site_id/database/migrations/:name/get.md)

---

[API](https://skmtc.dev/netlify/apis/netlify-s-api-documentation.md) · [All operations](https://skmtc.dev/netlify/apis/netlify-s-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/netlify/netlify-s-api-documentation/revisions/71540d1b5d9d/schema)
