List Taxonomies
Retrieve all taxonomies in your workspace, optionally filtered by role or language.
Endpoint
GET /v1/workspaces/{workspaceId}/taxonomyAuthentication
Requires API key authentication with a valid access token.
Request
curl -X GET \
'https://api.sharely.ai/v1/workspaces/{workspaceId}/taxonomy?includeRoles=true' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'organizationid: your-organization-id'Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string (UUID) | Yes | The unique identifier of the workspace |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
roleId | string (UUID) | No | Filter taxonomies assigned to this role |
languageId | string | No | Filter taxonomies assigned to this language (e.g., "en", "es") |
includeRoles | boolean | No | Include role assignments in response (default: false) |
includeLanguages | boolean | No | Include language assignments in response (default: false) |
includeCategories | boolean | No | Include category assignments in response (default: false) |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token with access token |
organizationid | string (UUID) | Yes | Your organization ID |
Content-Type | string | Yes | Must be application/json |
Response
Success Response (200 OK)
[
{
"id": "taxonomy-uuid-1",
"workspaceId": "workspace-uuid",
"name": "Medical Knowledge",
"description": "Medical specialty taxonomy",
"published": true,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-11-14T15:45:00Z",
"roles": [
{
"id": "role-uuid-1",
"name": "Physician",
"metadata": {
"uniqueCustomerRoleId": "workspace-uuid.physician"
}
}
],
"languages": [
{"languageId": "en"},
{"languageId": "es"}
],
"categoryCount": 12
}
]Response Fields
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Taxonomy unique identifier |
workspaceId | string (UUID) | Parent workspace ID |
name | string | Taxonomy name |
description | string | Taxonomy description |
published | boolean | Whether the taxonomy is active |
createdAt | string (ISO 8601) | Creation timestamp |
updatedAt | string (ISO 8601) | Last update timestamp |
roles | array | Assigned roles (if includeRoles=true) |
languages | array | Assigned languages (if includeLanguages=true) |
categoryCount | number | Number of categories in taxonomy |
Example Usage
List All Taxonomies
const fetch = require('node-fetch');
async function listTaxonomies(workspaceId, accessToken, organizationId) {
const response = await fetch(
`https://api.sharely.ai/v1/workspaces/${workspaceId}/taxonomy`,
{
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'organizationid': organizationId
}
}
);
if (!response.ok) {
throw new Error(`Failed to list taxonomies: ${response.status}`);
}
return await response.json();
}Filter by Role
curl -X GET \
'https://api.sharely.ai/v1/workspaces/{workspaceId}/taxonomy?roleId=role-uuid&includeRoles=true' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'organizationid: your-organization-id'Filter by Language
curl -X GET \
'https://api.sharely.ai/v1/workspaces/{workspaceId}/taxonomy?languageId=en&includeLanguages=true' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'organizationid: your-organization-id'