Add label to group
POST
/api/v1/groups/labels/add
const url = 'http://localhost:3000/api/v1/groups/labels/add';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"labelSelector":{"environment":"production","region":"us-west"},"key":"tier","value":"edge"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/groups/labels/add \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "labelSelector": { "environment": "production", "region": "us-west" }, "key": "tier", "value": "edge" }'Adds a label to all devices matching a selector.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
labelSelector
required
Label selector to match devices
object
key
additional properties
string
Example
{ "environment": "production", "region": "us-west"} key
required
Label key to add
string
Example
tier value
required
Label value to add
string
Example
edgeResponses
Section titled “ Responses ”Label added successfully
Media type application/json
object
affected
required
Number of devices affected by the operation
number
deviceIds
required
IDs of affected devices
Array<string>
Example
{ "affected": 15, "deviceIds": [ "550e8400-e29b-41d4-a716-446655440000", "550e8400-e29b-41d4-a716-446655440001" ]}Bad Request
Unauthorized
Forbidden — caller lacks required permission