Overview
Add labels to a specific asset by its ID. This endpoint enables programmatic labeling of individual assets based on custom logic, security findings, or business rules. Unlike the bulk endpoint (PATCH /v1/asset/labels), this endpoint targets a single asset, making it ideal for:
- Programmatic labeling based on scan results or vulnerability findings
- Building custom asset classification pipelines
- Event-driven labeling (e.g., label assets when specific conditions are met)
Quick Example
Request Body
labels array contains all labels you want to add to the asset. Existing labels are preserved - this endpoint always appends.
Response
Success Response
Error Responses
Asset Not Found:Use Cases
1. Manual Asset Review
After reviewing an asset, mark it as reviewed:2. Security Assessment
Label assets after vulnerability assessment:3. Incident Response
Quickly label compromised or suspicious assets:4. Asset Ownership
Assign ownership or team responsibility:Behavior & Important Notes
Label Appending
This endpoint always appends labels. It never removes existing labels:- Existing labels:
["prod", "api"] - Adding labels:
["critical"] - Result:
["prod", "api", "critical"]
Duplicate Prevention
Adding labels that already exist is safe - they won’t be duplicated:- Existing labels:
["prod", "api"] - Adding labels:
["api", "critical"] - Result:
["prod", "api", "critical"](not["prod", "api", "api", "critical"])
Empty Labels Array
Sending an empty labels array has no effect:Getting the Asset ID
You can retrieve asset IDs from:From Enumeration Contents
id field:
From Asset Details
Authorizations
Headers
Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team
Path Parameters
Body
application/json
Response
Example response