Skip to main content

List Test Case Labels (API)

Retrieve your workspace’s Test Case label names and page through the list for imports, automation, and Vansah integrations.

Retrieve the Test Case label names available in your Vansah workspace. Use the names to prepare imports, automation, or label filters in your integration.

Endpoint

Action

Method

Endpoint

List Test Case label names

GET

/api/v2/category/labels

Add the endpoint path to your Vansah base URL.

Before you begin

These examples use Bash and cURL. Set VANSAH_URL to your Vansah base URL without a trailing slash and VANSAH_TOKEN to your Vansah API token. Send the token directly in the Authorization header, without a Bearer prefix. Keep it private.

Use a token for the workspace you want to read. The list is workspace-wide; you do not need a Jira space key.

1. Retrieve label names

Endpoint: GET /api/v2/category/labels

curl --request GET --get \
--url "$VANSAH_URL/api/v2/category/labels" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Accept: application/json" \
--data-urlencode "startAt=0" \
--data-urlencode "limit=100"

Send query parameters in the URL. This request has no JSON body.

Query parameter

Type

Example value

Use

startAt

Number

0

Optional number of records to skip. Defaults to 0. Use a whole number of zero or greater.

limit

Number

100

Optional page size. Defaults to 1000 when omitted. Use a positive whole number.

Names are sorted alphabetically and deleted label records are excluded. There is no label-name search or Jira space filter on this endpoint.

2. Read the response

Endpoint: GET /api/v2/category/labels

Example successful response, HTTP 200:

{
"success": true,
"message": "Labels returned successfully",
"pagination": {
"total": 3,
"startAt": 0,
"limit": 100
},
"data": [
{
"name": "Functional"
},
{
"name": "Regression"
},
{
"name": "Smoke"
}
]
}

Each item in data contains a label’s name. There are no label identifiers or linked Test Cases in this response.

JSON path

Meaning

pagination.total

Total number of active label records in the workspace.

pagination.startAt

Number of records skipped.

pagination.limit

Page size used for this response.

An empty data array is successful. It means there are no records at that offset, including when the workspace has no active labels.

3. Retrieve more pages

Endpoint: GET /api/v2/category/labels

For a page size of 100, use startAt=100 for the second page, then 200. Keep limit=100 on each page:

curl --request GET --get \
--url "$VANSAH_URL/api/v2/category/labels" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Accept: application/json" \
--data-urlencode "startAt=100" \
--data-urlencode "limit=100"

Stop when you have retrieved the total number of labels or receive an empty array.

For help applying labels in Vansah, see Labels for Test Cases.

Troubleshooting

HTTP status or issue

What to check

400 — One or more validation errors found.

Read JSON path data.errors. startAt and limit must be numeric.

401 — authentication failed

Check the base URL, raw API token, expiry, and connected Jira access.

403 — account blocked

Ask your administrator to review the account’s Vansah access.

Empty list

Check that the token belongs to the correct workspace and retry with startAt=0.

400 — Something went wrong while Getting All Vansah Labels

Retry. If the problem continues, contact Vansah Support with the endpoint and response, without your API token.

Example HTTP 400 response:

{
"success": false,
"errorCode": 1390,
"message": "Something went wrong while Getting All Vansah Labels",
"data": []
}
Did this answer your question?