---
title: "Assign or unassign objects to a label"
method: POST
path: "/analytics/v1/labels/{id}/assignments"
tags: ["Labels"]
---

# Assign or unassign objects to a label

`POST /analytics/v1/labels/{id}/assignments`

Assigns or un-assigns objects to the label specified by the ID.

## Path parameters

- `id` string, required

## Request body

- AssignObjectsToLabelRequest — Request to assign or remove objects from a label.
  - `add` LabelAssignmentObject[] — Array of objects to assign to the label.
    - `objectId` string, required — The ID of the object to assign/unassign.
    - `objectType` 'alert' | 'allocation' | 'budget' | 'metric' | 'report' | 'annotation', required — The type of the object.
  - `remove` LabelAssignmentObject[] — Array of objects to unassign from the label.
    - `objectId` string, required — The ID of the object to assign/unassign.
    - `objectType` 'alert' | 'allocation' | 'budget' | 'metric' | 'report' | 'annotation', required — The type of the object.

## Response `200`

OK - Objects assigned/unassigned successfully.

## Other responses

- `400` — Bad Request - The server cannot process the request, often due to a malformed request.
- `401` — Unauthorized - Invalid API key.
- `403` — Forbidden - The client is not authorized to perform the request.
- `404` — Not Found - The requested resource does not exist.

---

[API](https://skmtc.dev/doit/apis/doit-cloud-intelligence.md) · [All operations](https://skmtc.dev/doit/apis/doit-cloud-intelligence/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/doit/doit-cloud-intelligence/revisions/9416402fc119/schema)
