---
title: "Update lens (partial)"
method: PATCH
path: "/lenses/{key}"
tags: ["lenses"]
---

# Update lens (partial)

`PATCH /lenses/{key}`

Update selected metadata fields for the specified lens. Note that if you are updating the lens library, you must use PUT (which accepts multipart/form-data).

## Path parameters

- `key` string, required

## Request body

- object — The lens to update.
  - `description` string — A description of the lens. Leave empty if you want to use the description provided by the lens publisher (i.e. sourceDescription).
  - `isPublished` boolean — Default false. When set to true, the lens is available to all users.
  - `name` string — A unique name for the lens. Max 60 characters; case insensitive; allows alpha-numeric characters, underscore (_) and dash (-). Leave empty if you want to use the name provided by the lens publisher (i.e. sourceName).
  - `version` string — A version for the lens. Leave empty if you want to use the version provided by the lens publisher (i.e. sourceVersion).
  - `owner` string — The name of the user to assign as the owner. Defaults to the user that created it

## Response `200`

Success, returns the updated lens.

- LensesResponse — A user interface component which renders subject/sample data with a particular visual representation.
  - `description` string — A description of the lens.
  - `helpEmail` string — The email address where a user can go to get more help about the lens. A lens may choose to display this information to the user e.g. if the user clicks a "help" icon attached to the lens.
  - `helpUrl` string — The url where a user can go to get more help about the lens. A lens may choose to display this information to the user e.g. if the user clicks a "help" icon attached to the lens.
  - `id` string — The lens id.
  - `isCustom` boolean — True for any lens which is installed by an administrator (rather than pre-installed in Refocus).
  - `isPublished` boolean — True when the lens is available to users.
  - `lensEventApiVersion` integer — The API version for the Lens Event API, e.g. 1, 2, etc.
  - `name` string — The name of lens. Max 60 characters; case insensitive; allows alpha-numeric characters, underscore (_) and dash (-).
  - `sourceDescription` string — The original lens publisher's description of the lens.
  - `sourceName` string — The original lens publisher's name of the lens.
  - `sourceVersion` string — The original lens publisher's version of the lens.
  - `thumbnailUrl` string — Optional thumbnail image to represent the lens.
  - `installedBy` string — TODO
  - `createdBy` string — Id of the User who created this Lens.
  - `createdAt` string — TODO
  - `updatedAt` string — TODO
  - `apiLinks` HATEOAS[] — Hypertext As The Engine Of Application State.
    - `href` string, required — URL of the related HATEOAS link you can use for subsequent calls.
    - `rel` string, required — Link relation that describes how this link relates to the previous call.
    - `method` string, required — The HTTP method required for the related call.

## Other responses

- `400` — Bad Request
- `401` — Authentication Error
- `403` — Forbidden
- `404` — Resource Not Found
- `default` — Error

---

[API](https://skmtc.dev/salesforce/apis/refocus-api.md) · [All operations](https://skmtc.dev/salesforce/apis/refocus-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/salesforce/refocus-api/revisions/42c2153b047e/schema)
