---
title: "Add a layer"
method: POST
path: "/designs/{uid}/layers"
tags: ["Design authoring"]
---

# Add a layer

`POST /designs/{uid}/layers`

## Request

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

Adds a text, image, AI image, rectangle or circle layer to a design.

## Path parameters

- `uid` string, required

## Request body

- AddLayerRequest
  - `type` 'text' | 'image' | 'ai_image' | 'rectangle' | 'circle', required: The kind of layer to add.
  - `pageIndex` integer: The page of a multipage design. Defaults to the first page.
  - `text` string: The text of a text layer.
  - `imageUrl` string, uri: The image of an image layer.
  - `prompt` string: The prompt of an AI Image layer.
  - `color` string: The text color.
  - `backgroundColor` string: The background color.
  - `fontSize` integer: The font size in pixels.
  - `textAlign` string: The text alignment.
  - `fontFamily` string: The font family.
  - `fontWeight` string: The font weight.
  - `aiModel` string: The model of an AI Image layer.
  - `aiAspectRatio` string: The aspect ratio of an AI Image layer.
  - `x` number: Left position in pixels.
  - `y` number: Top position in pixels.
  - `width` number: Width in pixels.
  - `height` number: Height in pixels.
  - `zIndex` integer: The stacking order.

## Response `200`

The new 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)
