---
title: "POST /collections/migrations"
method: POST
path: "/collections/migrations"
tags: ["collection"]
---

# POST /collections/migrations

`POST /collections/migrations`

Set a lens migration between collection versions

## Request body

- LensConfig
  - `DestinationCollectionVersionID` string
  - `Lenses` object[]
    - `Arguments` object
    - `Inverse` boolean
    - `Path` string
  - `SourceCollectionVersionID` string

## Response `200`

Lens info

- SetMigration
  - `lensId` string

## Other responses

- `400` — error

## Changes

- **2026-03-02** `8c167ee47363` — 1 info
  - api operation id `collection_set_migration` removed and replaced with `set_collection_migration`
- **2026-01-07** `0408d77222e0` — 2 warning, 2 info
  - removed the request property `DestinationSchemaVersionID`
  - removed the request property `SourceSchemaVersionID`
  - added the new optional request property `DestinationCollectionVersionID`
  - added the new optional request property `SourceCollectionVersionID`
- **2025-12-16** `5b868ebf9e61` — 1 info
  - endpoint added
- **2025-06-02** `60812f5416c5` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/sourcenetwork/apis/defradb-api/changes/collections/migrations/post.md)

---

[API](https://skmtc.dev/sourcenetwork/apis/defradb-api.md) · [All operations](https://skmtc.dev/sourcenetwork/apis/defradb-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sourcenetwork/defradb-api/revisions/659e79583f79/schema)
