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

# POST /lens

`POST /lens`

Add a lens to the lens store

## Request body

- AddLensRequest
  - `lens` object
    - `Lenses` object[]
      - `Arguments` object
      - `Inverse` boolean
      - `Path` string

## Response `200`

Lens CID

- AddLensResponse
  - `lensId` string

## Other responses

- `400` — error

## Changes

> 53 revisions in range; 1 could not be searched.

- **2026-03-02** `8c167ee47363` — 1 info
  - api operation id `lens_add` removed and replaced with `add_lens`
- **2025-12-16** `5b868ebf9e61` — 3 warning, 2 info
  - removed the request property `DestinationSchemaVersionID`
  - removed the request property `Lenses`
  - removed the request property `SourceSchemaVersionID`
  - api operation id `lens_set_migration` removed and replaced with `lens_add`
  - …1 more
- **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/659e79583f79/schema)
