๐Ÿท๏ธ Labels API: How to Use It

๐Ÿ” What is the Labels API?

The Labels API (v2) allows you to manage custom classification tags (called labels) in your Clara account. Labels are useful for organizing transactions, users, or workflows based on internal categorization (e.g., "Client A", "Internal Event", "R&D", etc.).

With this API, you can:

  • Create, update, and delete labels
  • Retrieve all existing labels or a specific one
  • Bulk-delete labels when no longer needed

๐Ÿ“Œ Available Endpoints

OperationEndpointMethod
List all labels/v2/labelsGET
Get label by UUID/v2/labels/{uuid}GET
Create multiple label/v2/labelsPOST
Update a label/v2/labels/{uuid}PATCH
Delete a label/v2/labels/{uuid}DELETE
Delete multiple labels/v2/labels/deletePOST

1๏ธโƒฃ List all labels

Use this endpoint to retrieve all the labels that have been created in your organization.
You can use this data to show label options in a UI, filter transactions by label, or review current classification structures.

๐Ÿ”— Endpoint

GET /v2/labels

๐Ÿ“ค cURL Request

curl -X GET \
"https://public-api.mx.clara.com/api/v2/labels" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

๐Ÿ“ฅ Sample JSON Response

[
  {
    "uuid": "label-123",
    "name": "Marketing",
    "description": "Marketing-related expenses",
    "status": "ACTIVE"
  }
]

2๏ธโƒฃ Get Label by UUID

Use this to fetch full details for a specific label, including its name, description, status, and metadata.

๐Ÿ”— Endpoint

GET /v2/labels/{uuid}

๐Ÿ“ค cURL Request

curl -X GET \
"https://public-api.mx.clara.com/api/v2/labels/label-123" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

๐Ÿ“ฅ Sample JSON Response

 {
    "uuid": "label-123",
    "name": "Marketing",
    "description": "Marketing-related expenses",
    "status": "ACTIVE"
  }

3๏ธโƒฃ Create multiple Labels

Use this to create a new label, specifying its name and an optional description. You can later assign this label to transactions or users.

๐Ÿ”— Endpoint

POST /v2/labels

๐Ÿ“ค cURL Request

curl -X POST \
"https://public-api.mx.clara.com/api/v2/labels" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "name": "Events",
  "description": "Internal event budgets"
}'

๐Ÿ“ฅ Sample JSON Response

{
  "uuid": "label-789",
  "name": "Events",
  "description": "Internal event budgets",
  "status": "ACTIVE"
}

4๏ธโƒฃ Update a Label details

Use this endpoint to modify an existing label, such as changing the label name or updating its description.

๐Ÿ”— Endpoint

PATCH /v2/labels/{uuid}

๐Ÿ“ค cURL Request

curl -X PATCH \
"https://public-api.mx.clara.com/api/v2/labels/label-789" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "name": "Events & Sponsorships",
  "description": "Updated name and scope"
}'

5๏ธโƒฃ Delete a single Label

Use this to delete a single label by UUID. This is useful when a label is no longer relevant or has been replaced by another.

โš ๏ธ Note: Deleting a label doesn't remove it from historical data, but it will no longer be assignable.

๐Ÿ”— Endpoint

DELETE /v2/labels/{uuid}

๐Ÿ“ค cURL Request

curl -X DELETE \
"https://public-api.mx.clara.com/api/v2/labels/label-789" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

6๏ธโƒฃ Delete Multiple Labels

Use this endpoint to bulk-delete labels. This is especially useful for cleanup tasks or automated workflows where multiple labels must be removed at once.

๐Ÿ”— Endpoint

POST /v2/labels/delete

๐Ÿ“ค cURL Request

curl -X POST \
"https://public-api.mx.clara.com/api/v2/labels/delete" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "uuids": ["label-123", "label-456"]
}'

๐Ÿ’ก Tip: Labels can be used across transactions, reports, and internal workflows for custom tracking and analysis.

โš ๏ธ Note: Once deleted, a label cannot be reassigned to new entities.