---
title: "Replace datasets labels"
method: POST
path: "/datasets/labels/apply"
tags: ["labels"]
---

# Replace datasets labels

`POST /datasets/labels/apply`

Applies the given list of labels to the given datasets. Existing labels are replaced - include labels to be preserved in `labelIds`. Only simple labels can be attached to datasets

## Query parameters

- `workspaceId` integer

## Request body

- AssociateDatasetsLabelsRequest
  - `datasetIds` string[]
  - `labelIds` integer[]

## Response `204`

OK - No content

## Other responses

- `400` — Invalid request, if trying to associate resource labels
- `403` — Operation not allowed

---

[API](https://skmtc.net/seqeralabs/apis/seqera-api.md) · [All operations](https://skmtc.net/seqeralabs/apis/seqera-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/seqeralabs/seqera-api/versions/13316c9fe5ff/schema)
