---
title: "Assign new labels to a hostname"
method: PUT
path: "/bulk/hostnames/{hostname}/labels"
tags: ["bulk"]
---

# Assign new labels to a hostname

`PUT /bulk/hostnames/{hostname}/labels`

## Request

- Base URL: `https://cyber-risk.upguard.com/api/public`
- URL: `https://cyber-risk.upguard.com/api/public/bulk/hostnames/{hostname}/labels`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/upguard/apis/upguard-cyberrisk-api/docs/bulk/hostnames/:hostname/labels/put.ts> (a function with typed inputs; its response is checked against the schema)

Assign labels to a hostname replacing the existing ones if any. To remove all labels use an empty array in the request.

This is an add-on endpoint not available to all accounts. Please contact support for information about bulk endpoints and how to upgrade your account.

Required API key permissions: `Admin` (select when creating API key in Account Settings)

## Path parameters

- `hostname` string, hostname, required

## Request body

- string[]

## Response `204`

Successful response is empty

## Other responses

- `403`: Your API key does not have permission to perform this action.
- `422`: An invalid parameter was supplied or a mandatory parameter was missing
- `429`: Too many requests have been made to this endpoint.
- `500`: An internal system error occurred

---

[API](https://skmtc.dev/upguard/apis/upguard-cyberrisk-api.md) - [All operations](https://skmtc.dev/upguard/apis/upguard-cyberrisk-api/llms.txt) - [OpenAPI document](https://skmtc.dev/upguard/apis/upguard-cyberrisk-api/revisions/d044bf6dc61e?raw)
