remagicaDocs home
API referenceLibrary

Create a label

POST
/library/labels

Needs a key withlibrary:write

Adds an asset label to the workspace (names are unique, any case).

Requires scope library:write.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Request Body

application/json
  1. body
color?string

The label's colour.

Default"gray"
Value in"gray""red""orange""yellow""green""teal""blue""purple""pink"
name*string
Length1 <= length <= 40

Response Body

The label.

application/json
  1. response

One of the workspace's asset labels.

color*string

The label's colour.

Value in"gray""red""orange""yellow""green""teal""blue""purple""pink"
id*string
Length1 <= length <= 128
name*string
itemCount*integer

How many assets (not deleted) have it.

Example Request
curl -X POST 'https://api.remagica.com/api/v1/library/labels' \  -H 'Content-Type: application/json' \  -d '{  "name": "Approved"}'
Example Response
{  "color": "gray",  "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",  "name": "Autumn campaign",  "itemCount": 1}