Skip to content

Get tag

Endpoint

GET /organizations/{org_id}/tags/{tag_id}

Fetches a single tag by its ID within your organization.

Request

Replace {org_id} with your Organization ID and {tag_id} with the tag’s ID.

Headers

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient

Query parameters (optional)

  • with (string): Set to statistics to include usage counts (active/archived templates and processes).

Code samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const tagId = 'TAG_ID_TO_GET';
const queryParams = '?with=statistics';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/tags/${tagId}${queryParams}`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, { method: 'GET', headers })
.then(response => {
return response.json().then(data => {
if (!response.ok) {
console.error(`Failed to get tag ${tagId}:`, data);
throw new Error(`HTTP error! status: ${response.status}`);
}
return data;
});
})
.then(data => {
console.log(`Successfully retrieved tag ${tagId}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error getting tag ${tagId}:`, error.message);
});

Response

A successful request returns a 200 OK status and a JSON object with the tag details inside data.

{
"data": {
"id": "TAG_ID_TO_GET",
"title": "Urgent",
"color": "#e74c3c",
"auto_generated": false,
"created_at": "2024-01-15T10:00:00Z",
"deleted_at": null,
"statistics": {
"data": {
"active_template": 5,
"archived_template": 2,
"active_process": 12,
"archived_process": 3
}
}
}
}

The statistics object only appears when you pass with=statistics. If the tag isn’t found or you don’t have access, you’ll get a 404 or 403 error.


Tags > List tags

Retrieve all tags in your organization with optional name filtering and pagination. You can also…

Tasks > Get task

Tallyfy’s API lets you fetch any single task by its ID using a GET request and optionally…

Tags > Delete tag

Tallyfy’s DELETE API endpoint at /organizations/[org_id]/tags/[tag_id] permanently removes a…

Templates > Get template

Tallyfy’s API lets you fetch full details of any process template by its unique ID using a GET…