Skip to content

Create label

POST /container/<containerId>/label

Description

Create a new label.

Path parameters

Param Description
containerId Container Id.

Query parameters

none

Body

Param Type Required Description
name string Yes Name of the label.

Return codes

Error code Reason
201 Success.
400 Invalid body.
401 Invalid or missing token.
403 Insufficient permissions (required: API+CONTAINER_ADMIN).
404 Container not found.

Example

Curl request:

curl \
    -X POST 'https://api.infrasonar.com/container/123/label' \
    -H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
    -H 'Content-Type: application/json' \
    --data-raw '{
    "name": "my-host.local"
}'

Response:

{
    "labelId": 456
}