Skip to content

Create group

Endpoint

POST /organizations/{org_id}/groups

This endpoint creates a new group 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 group.

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

  • name (string, required): The name of the group.
  • description (string, optional): A description for the group.
  • members (array of integers, optional): An array of User IDs for members to add to the group.
  • guests (array of strings, optional): An array of email addresses for guests to add to the group.

Minimal Example Body:

{
"name": "Project Alpha Team"
}

Example Body with Members/Guests:

{
"name": "Onboarding Specialists",
"description": "Team responsible for new client onboarding.",
"members": [1001, 1005, 1008],
"guests": ["client.liaison@partner.com"]
}

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/groups`;
const groupData = {
name: "Marketing Campaign Crew",
description: "Cross-functional team for the Q3 campaign.",
members: [1002, 1003],
guests: ["freelancer@design.co"]
};
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(groupData)
})
.then(response => {
return response.json().then(data => {
if (!response.ok) {
console.error("Failed to create group:", data);
throw new Error(`HTTP error! status: ${response.status}`);
}
return data;
});
})
.then(data => {
console.log('Successfully created group:');
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error('Error creating group:', 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 group, including its assigned id.

{
"data": {
"id": "new_group_id_789",
"name": "Onboarding Specialists",
"description": "Team responsible for new client onboarding.",
"logo": null,
"members": [1001, 1005, 1008],
"guests": ["client.liaison@partner.com"],
"created_at": "2024-05-21T18:00:00Z",
"updated_at": "2024-05-21T18:00:00Z",
"deleted_at": null
}
}

Make note of the returned id to manage this group later (get, update, delete).


Groups > Update group

The PUT endpoint allows updating a group’s details including name description members and guests while returning the modified group data upon successful completion with appropriate status codes.

Tags > Create tag

A POST endpoint that creates organization tags with specified title and color properties through multiple programming language examples including JavaScript Python Java and Go.

Guests > Create guest

The POST endpoint creates guest users in an organization by accepting JSON data with required email and optional fields like name and company details while returning the newly created guest’s information upon success.

Groups > List groups

The GET endpoint allows retrieving organization-specific groups with their details such as IDs names descriptions logos member lists and timestamps through authenticated API requests using various programming languages.