---
title: "Update a layer"
method: PATCH
path: "/designs/{uid}/layers/{layerId}"
tags: ["Design authoring"]
---

# Update a layer

`PATCH /designs/{uid}/layers/{layerId}`

## Request

- Base URL: `https://api.dynapictures.com`
- URL: `https://api.dynapictures.com/designs/{uid}/layers/{layerId}`
- Auth: HTTP bearer

Changes the position, size, text or styles of a layer. Only the fields you send change.

## Path parameters

- `uid` string, required
- `layerId` string, required

## Request body

- PatchLayerRequest: Only the fields you send change.
  - `x` number: Left position in pixels.
  - `y` number: Top position in pixels.
  - `width` number: Width in pixels.
  - `height` number: Height in pixels.
  - `text` string: The new text.
  - `styles` object: CSS-like style properties to merge into the layer.

## Response `200`

The updated layer.

- LayerResult
  - `designUid` string, required: The ID of the design.
  - `layer` object, required: The layer as stored in the design.

## Other responses

- `400`: The request is invalid. `message` says why.
- `401`: The API key is missing or wrong.
- `403`: The plan limit is reached, the trial has expired, or the key has no access to this resource.
- `404`: The resource does not exist, or the key has no access to it.

---

[API](https://skmtc.dev/dynapictures/apis/dynapictures-api.md) - [All operations](https://skmtc.dev/dynapictures/apis/dynapictures-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dynapictures/apis/dynapictures-api/revisions/a9820777cfb3?raw)
