# Eng Intel: User Labels

Use these operations to interact with [user labels](/improve/eng-intelligence/eng-intelligence.md#group-by-user-label) in Cortex Eng Intelligence.

### Required permissions

Your API key must have the `Configure user labels` permission.

## Operations

## List user labels

> Retrieves a list of all available user labels.\
> \
> API key must have the \`View Eng Intelligence\` permission.

```json
{"openapi":"3.0.1","info":{"title":"Cortex API","version":"v1"},"tags":[{"name":"Eng Intel: User Labels"}],"servers":[{"url":"https://api.getcortexapp.com","description":"Cortex Cloud API host"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","description":"All requests to the Cortex API need to provide an `Authorization: Bearer <token>` header, where `<token>` is an API key created in the Settings page of your workspace.","scheme":"bearer","type":"http"}},"schemas":{"UserLabelListResponse":{"required":["labels","page","total","totalPages"],"type":"object","properties":{"labels":{"type":"array","items":{"$ref":"#/components/schemas/UserLabel"}},"page":{"type":"integer","description":"Current page number, 0-indexed","format":"int32"},"total":{"type":"integer","description":"Total number of results","format":"int32"},"totalPages":{"type":"integer","description":"Total number of pages","format":"int32"}}},"UserLabel":{"required":["id","name","values"],"type":"object","properties":{"description":{"type":"string","description":"Optional description of the user label"},"id":{"type":"string","description":"Unique, immutable, 18-character auto-generated identifier for the user label."},"name":{"type":"string","description":"Unique name for the user label"},"values":{"type":"array","description":"Possible values for the user label","items":{"type":"string","description":"Possible values for the user label"}}}},"TooManyRequestsProblemDetail":{"required":["type","title","status"],"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string","format":"uri-reference"},"retryAfter":{"minimum":0,"type":"integer","description":"The number of seconds until the rate limiting resets.","format":"int32"},"status":{"maximum":599,"minimum":100,"type":"integer","format":"int32","enum":[429]},"title":{"type":"string"},"type":{"type":"string","format":"uri-reference"}}}},"responses":{"TooManyRequests":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/TooManyRequestsProblemDetail"}}},"description":"The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.","headers":{"Retry-After":{"description":"The number of seconds until the rate limiting resets.","schema":{"minimum":0,"type":"integer","format":"int32"}}}}}},"paths":{"/api/v1/eng-intel/labels":{"get":{"description":"Retrieves a list of all available user labels.\n\nAPI key must have the `View Eng Intelligence` permission.","operationId":"listUserLabels","parameters":[{"description":"Number of results to return per page, between 1 and 1000. Default 250.","in":"query","name":"pageSize","required":true,"schema":{"type":"integer","format":"int32","default":250}},{"description":"Page number to return, 0-indexed. Default 0.","in":"query","name":"page","required":true,"schema":{"type":"integer","format":"int32","default":0}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLabelListResponse"}}},"description":"Successfully retrieved user labels"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"List user labels","tags":["Eng Intel: User Labels"]}}}}
```

## Retrieve user label

> Get user label.\
> \
> API key must have the \`View Eng Intelligence\` permission.

```json
{"openapi":"3.0.1","info":{"title":"Cortex API","version":"v1"},"tags":[{"name":"Eng Intel: User Labels"}],"servers":[{"url":"https://api.getcortexapp.com","description":"Cortex Cloud API host"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","description":"All requests to the Cortex API need to provide an `Authorization: Bearer <token>` header, where `<token>` is an API key created in the Settings page of your workspace.","scheme":"bearer","type":"http"}},"schemas":{"UserLabel":{"required":["id","name","values"],"type":"object","properties":{"description":{"type":"string","description":"Optional description of the user label"},"id":{"type":"string","description":"Unique, immutable, 18-character auto-generated identifier for the user label."},"name":{"type":"string","description":"Unique name for the user label"},"values":{"type":"array","description":"Possible values for the user label","items":{"type":"string","description":"Possible values for the user label"}}}},"ErrorResponse":{"required":["message","type"],"type":"object","properties":{"details":{"type":"string"},"gatewayHttpStatus":{"type":"integer","format":"int32"},"httpStatus":{"type":"integer","format":"int32"},"message":{"type":"string"},"requestId":{"type":"string"},"type":{"type":"string","enum":["INTEGRATION_MISSING","INTEGRATION_UNREGISTERED","INTEGRATION_UNSUPPORTED","INTEGRATION_GRAPHQL_ERROR","INTEGRATION_BAD_REQUEST","INTEGRATION_UNAUTHORIZED","INTEGRATION_FORBIDDEN","INTEGRATION_NOT_FOUND","INTEGRATION_UNPROCESSABLE_CONTENT","INTEGRATION_RATE_LIMITED","INTEGRATION_INTERNAL_ERROR","INTEGRATION_NOT_IMPLEMENTED","INTEGRATION_BAD_GATEWAY","INTEGRATION_UNAVAILABLE","INTEGRATION_GATEWAY_TIMEOUT","INTEGRATION_TIMED_OUT","INTEGRATION_CACHE_ERROR","INTEGRATION_UNHANDLED_HTTP_ERROR","INTEGRATION_UNHANDLED_EXCEPTION","INTEGRATION_UNEXPECTED_ERROR","ILLEGAL_ARGUMENT_ERROR","BAD_REQUEST","FORBIDDEN","NOT_FOUND","REQUEST_TIMEOUT","CONFLICT","UNHANDLED_EXCEPTION","UNCATEGORIZED","SERVICE_CREATOR","UNKNOWN_HOST","TOO_MANY_REQUESTS"]}}},"TooManyRequestsProblemDetail":{"required":["type","title","status"],"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string","format":"uri-reference"},"retryAfter":{"minimum":0,"type":"integer","description":"The number of seconds until the rate limiting resets.","format":"int32"},"status":{"maximum":599,"minimum":100,"type":"integer","format":"int32","enum":[429]},"title":{"type":"string"},"type":{"type":"string","format":"uri-reference"}}}},"responses":{"TooManyRequests":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/TooManyRequestsProblemDetail"}}},"description":"The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.","headers":{"Retry-After":{"description":"The number of seconds until the rate limiting resets.","schema":{"minimum":0,"type":"integer","format":"int32"}}}}}},"paths":{"/api/v1/eng-intel/labels/{id}":{"get":{"description":"Get user label.\n\nAPI key must have the `View Eng Intelligence` permission.","operationId":"getUserLabel","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLabel"}}},"description":"Successfully retrieved user label"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"User label not found"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"Retrieve user label","tags":["Eng Intel: User Labels"]}}}}
```

## Update user label assignments

> Assign user label values to user emails in bulk.\
> \
> API key must have the \`Edit user labels\` permission.

```json
{"openapi":"3.0.1","info":{"title":"Cortex API","version":"v1"},"tags":[{"name":"Eng Intel: User Labels"}],"servers":[{"url":"https://api.getcortexapp.com","description":"Cortex Cloud API host"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","description":"All requests to the Cortex API need to provide an `Authorization: Bearer <token>` header, where `<token>` is an API key created in the Settings page of your workspace.","scheme":"bearer","type":"http"}},"schemas":{"BulkUserLabelAssignmentRequest":{"required":["userLabelAssignments"],"type":"object","properties":{"userLabelAssignments":{"type":"object","additionalProperties":{"type":"array","description":"Map of user email to the list of user label values that should be assigned to the user","items":{"$ref":"#/components/schemas/UserLabelValue"}},"description":"Map of user email to the list of user label values that should be assigned to the user"}}},"UserLabelValue":{"required":["id","name","value"],"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"}},"description":"Map of user email to the list of assigned user label values"},"BulkUserLabelAssignmentResponse":{"required":["userLabelAssignments"],"type":"object","properties":{"userLabelAssignments":{"type":"object","additionalProperties":{"type":"array","description":"Map of user email to the list of assigned user label values","items":{"$ref":"#/components/schemas/UserLabelValue"}},"description":"Map of user email to the list of assigned user label values"}}},"TooManyRequestsProblemDetail":{"required":["type","title","status"],"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string","format":"uri-reference"},"retryAfter":{"minimum":0,"type":"integer","description":"The number of seconds until the rate limiting resets.","format":"int32"},"status":{"maximum":599,"minimum":100,"type":"integer","format":"int32","enum":[429]},"title":{"type":"string"},"type":{"type":"string","format":"uri-reference"}}}},"responses":{"TooManyRequests":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/TooManyRequestsProblemDetail"}}},"description":"The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.","headers":{"Retry-After":{"description":"The number of seconds until the rate limiting resets.","schema":{"minimum":0,"type":"integer","format":"int32"}}}}}},"paths":{"/api/v1/eng-intel/labels/users":{"post":{"description":"Assign user label values to user emails in bulk.\n\nAPI key must have the `Edit user labels` permission.","operationId":"updateUserLabelAssignments","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUserLabelAssignmentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUserLabelAssignmentResponse"}}},"description":"Successfully updated user label assignments"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"Update user label assignments","tags":["Eng Intel: User Labels"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortex.io/api/readme/eng-intel-user-labels.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
