Skip to content

Create tag

Endpoint

POST /organizations/{org_id}/tags

This endpoint creates a new tag within the specified organization.

Request

Replace {org_id} with your Organization ID.

Headers

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

Body (JSON)

The request body requires a JSON object defining the new tag.

Refer to the #definitions/createTagInput schema in Swagger. Key fields:

  • title (string, required): The name of the tag.
  • color (string, optional): A hex color code (e.g., #3498db) for the tag.

Example Body:

{
"title": "High Priority",
"color": "#e74c3c"
}

Code samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/tags`;
const tagData = {
title: "JS Created Tag", // Required
color: "#9b59b6" // Optional: Purple
};
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
headers.append('Content-Type', 'application/json');
fetch(apiUrl, {
method: 'POST',
headers: headers,
body: JSON.stringify(tagData)
})
.then(response => {
return response.json().then(data => { // Attempt to parse JSON regardless of status
if (!response.ok) {
console.error("Failed to create tag:", data);
throw new Error(`HTTP error! status: ${response.status}`);
}
return data; // Pass successful data along
});
})
.then(data => {
console.log('Successfully created tag:');
console.log(JSON.stringify(data, null, 2));
// Use data.data.id to get the new tag ID
})
.catch(error => {
console.error('Error creating tag:', error.message);
});

Response

A successful request returns a 200 OK or 201 Created status code and a JSON object containing the details of the newly created tag, including its assigned id.

{
"data": {
"id": "new_tag_id_xyz",
"title": "Python Tag",
"color": "#f1c40f",
"template": 0,
"active_process": 0,
"auto_generated": false,
"created_at": "2024-05-21T20:00:00Z",
"deleted_at": null
}
}

Make note of the returned id to manage this tag later.


Tags > Update tag

The PUT endpoint enables updating an existing tag’s properties like title and color within an organization by sending a JSON request with the new values and receiving the updated tag details in response.

Groups > Create group

A POST endpoint that creates organizational groups by accepting JSON data containing group name description members and guests while providing code samples in multiple programming languages and returning the newly created group details.

Tags > List tags

The GET endpoint allows retrieval of organizational tags with optional filtering and sorting capabilities returning tag details such as ID title color and usage statistics through authenticated API requests.

Tags > Get tag

The GET endpoint enables retrieval of specific tag details through unique IDs with optional related data inclusion and returns a JSON response containing tag information along with error handling for invalid requests or permissions.