Organize data using tags via API

Organization tags can be managed via the Centaur API, tags are useful mechanism to group cases together. For example, you can tag all cases that are related to a specific task or a specific data source.

📘

API Credentials

The examples in this guide require having API credentials set up. If you haven't done so already, please follow the instructions in API credentials and Initiate API session.

List organization tags

The list of all tags used by your organization can be obtained by calling the GET /tags/public/v1/list endpoint, pagination is supported using the last_sequence_id, and limit parameters. The following example lists the first 10 tags used by your organization:

curl --request GET \
     --url 'https://api.centaurlabs.com/tags/public/v1/list?limit=10' \
     --header 'X-API-KEY: YOUR_API_KEY_HERE' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_TOKEN_HERE'

Add a tag to a case

You can add a tag to one or more cases by calling the POST /tags/public/v1/add endpoint. The following example adds the tag my_tag to the cases with IDs 1, 2, and 3 in the task with ID 999:

curl --request POST \
     --url https://api.centaurlabs.com/tags/public/v1/add \
     --header 'X-API-KEY: YOUR_API_KEY_HERE' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_TOKEN_HERE' \
     --header 'content-type: application/json' \
     --data '
{
  "task_id": 999,
  "tag": "my_tag",
  "problem_ids": [1,2,3]
}'

Remove a tag from a case

Removing tags from one or more cases is straightforward, calling the DELETE /tags/public/v1/delete endpoint passing the same parameters as in the add tags endpoint but via URL parameters. The following example removes the tag my_tag from the cases with IDs 1, and 3 in the task with ID 999:

curl --request DELETE \
     --url 'https://api.centaurlabs.com/tags/public/v1/delete?tag=my_tag&task_id=999&problem_ids=1,3' \
     --header 'X-API-KEY: YOUR_API_KEY_HERE' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_TOKEN_HERE'