Workspace owners can use Labels to grant users access to groups of resources. When you add a Label to a Source or Personas Space, any users to whom you assign that Label gain access to those resources.
To create or configure labels, go to the Labels tab in your Workspace settings. Only Workspace Owners can manage labels for the entire Workspace.
Creates a new label.
• When called, this endpoint may generate the Label Created
event in the audit trail.
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
required | object (label) The new label to create in the Workspace. |
Created
Resource not found
Validation failure
Too many requests
{- "label": {
- "key": "environment",
- "value": "yolo",
- "description": "an environment for courageous devs"
}
}
{- "data": {
- "label": {
- "key": "environment",
- "value": "yolo",
- "description": "an environment for courageous devs"
}
}
}
Returns a list of all available labels.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.labels.listLabels()) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "labels": [
- {
- "key": "environment",
- "value": "dev",
- "description": ""
}, - {
- "key": "environment",
- "value": "prod",
- "description": ""
}, - {
- "key": "type",
- "value": "web",
- "description": "labels source as web"
}
]
}
}
Deletes a label.
• When called, this endpoint may generate the Label Deleted
event in the audit trail.
The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.labels.deleteLabel('environment', 'yolo')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "status": "SUCCESS"
}
}