---
title: "POST /lens"
method: POST
path: "/lens"
tags: ["lens"]
---

# POST /lens

`POST /lens`

Add a new lens migration

## Request body

- LensConfig
  - `DestinationSchemaVersionID` string
  - `Lenses` object[]
    - `Arguments` object
    - `Inverse` boolean
    - `Path` string
  - `SourceSchemaVersionID` string

## Response `200`

Lens info

- SetMigration
  - `lensId` string

## Other responses

- `400` — error
- `default`

## Changes

- **2025-10-17** `4ca188c09b28` — 1 info
  - added the media type `application/json` for the response with the status `200`
- **2025-06-02** `60812f5416c5` — 1 breaking, 1 warning, 4 info
  - removed the media type `application/json` for the response with the status `200`
  - removed the request property `lens`
  - api operation id `add_lens` removed and replaced with `lens_set_migration`
  - added the new optional request property `DestinationSchemaVersionID`
  - …2 more

[Change history](https://skmtc.dev/sourcenetwork/apis/defradb-api/changes/lens/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/7d50ee7dcd85/schema)
