> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/api-reference/monitoring-and-metadata/labels.md).

# Labels

Operations related to Labels for categorizing and organizing platform resources with custom tags. Enable flexible resource organization, filtering, and grouping across segments, campaigns, feeds, and other entities for improved management, reporting, and governance of complex platform configurations across teams and use cases.

## GET /labels/{label\_id}

> Search label by Id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Labels","description":"Operations related to Labels for categorizing and organizing platform resources with custom tags. Enable flexible resource organization, filtering, and grouping across segments, campaigns, feeds, and other entities for improved management, reporting, and governance of complex platform configurations across teams and use cases."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/labels/{label_id}":{"get":{"tags":["Labels"],"parameters":[{"schema":{"type":"integer","format":"int64"},"explode":false,"name":"label_id","description":"The label id","style":"simple","required":true,"in":"path"}],"description":"","operationId":"getLabel","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/LabelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Search label by Id"}}},"components":{"schemas":{"LabelResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["creation_ts","id","name","organisation_id"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## PUT /labels/{label\_id}

> Update label

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Labels","description":"Operations related to Labels for categorizing and organizing platform resources with custom tags. Enable flexible resource organization, filtering, and grouping across segments, campaigns, feeds, and other entities for improved management, reporting, and governance of complex platform configurations across teams and use cases."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/labels/{label_id}":{"put":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/LabelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"style":"simple","description":"The label id","schema":{"type":"integer","format":"int64"},"required":true,"name":"label_id","in":"path","explode":false}],"summary":"Update label","operationId":"updateLabel","requestBody":{"description":"The label to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelResource"}}},"required":true},"description":"","tags":["Labels"]}}},"components":{"schemas":{"LabelResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["creation_ts","id","name","organisation_id"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## DELETE /labels/{label\_id}

> Delete label by Id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Labels","description":"Operations related to Labels for categorizing and organizing platform resources with custom tags. Enable flexible resource organization, filtering, and grouping across segments, campaigns, feeds, and other entities for improved management, reporting, and governance of complex platform configurations across teams and use cases."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/labels/{label_id}":{"delete":{"summary":"Delete label by Id","responses":{"200":{"$ref":"#/components/responses/simple"},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"tags":["Labels"],"parameters":[{"name":"label_id","schema":{"type":"integer","format":"int64"},"required":true,"description":"The label id","explode":false,"style":"simple","in":"path"}],"operationId":"removeLabel","description":""}}},"components":{"responses":{"simple":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}},"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}}}}
```

## GET /labels

> Search labels

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Labels","description":"Operations related to Labels for categorizing and organizing platform resources with custom tags. Enable flexible resource organization, filtering, and grouping across segments, campaigns, feeds, and other entities for improved management, reporting, and governance of complex platform configurations across teams and use cases."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/labels":{"get":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"count":{"type":"integer"},"max_results":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/LabelResource"}},"first_result":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"tags":["Labels"],"description":"","summary":"Search labels","parameters":[{"schema":{"type":"integer","format":"int64"},"explode":true,"required":false,"in":"query","style":"form","description":"The organisation owning the label","name":"organisation_id"},{"description":"The community owning the label","name":"community_id","style":"form","schema":{"type":"integer","format":"int64"},"required":false,"in":"query","explode":true},{"description":"The type if the labelable item","required":false,"style":"form","in":"query","schema":{"type":"array","items":{"$ref":"#/components/schemas/LabelableType"}},"explode":true,"name":"labelable_type"},{"in":"query","description":"The name of the label to search","name":"label_name","required":false,"explode":true,"style":"form","schema":{"type":"string"}},{"in":"query","style":"form","name":"labelable_id","schema":{"type":"integer","format":"int64"},"required":false,"explode":true,"description":"The id the labelable item"},{"schema":{"type":"integer","format":"int32"},"in":"query","required":false,"style":"form","description":"Offset from which the search must be performed","explode":true,"name":"first_result"},{"name":"max_results","required":false,"in":"query","explode":true,"description":"Number of maximum items that shall be return by this search","style":"form","schema":{"type":"integer","format":"int32"}}],"operationId":"findLabels"}}},"components":{"schemas":{"LabelResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["creation_ts","id","name","organisation_id"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]},"LabelableType":{"type":"string","enum":["AD_GROUP","CREATIVE","DISPLAY_CAMPAIGN","EMAIL_CAMPAIGN","GOAL","SEGMENT","SERVICE_ITEM","EXPORT","IMPORT","DATA_CLEAN_ROOM_DATASET"],"readOnly":false}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /labels

> Create label

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Labels","description":"Operations related to Labels for categorizing and organizing platform resources with custom tags. Enable flexible resource organization, filtering, and grouping across segments, campaigns, feeds, and other entities for improved management, reporting, and governance of complex platform configurations across teams and use cases."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/labels":{"post":{"operationId":"createLabel","description":"","requestBody":{"description":"The label to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelResource"}}},"required":true},"summary":"Create label","tags":["Labels"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/LabelResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"LabelResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["creation_ts","id","name","organisation_id"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/api-reference/monitoring-and-metadata/labels.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
