-
-
Notifications
You must be signed in to change notification settings - Fork 0
Teams
Read team information in Teamleader Focus.
The Teams resource provides read-only access to the teams defined in your Teamleader account. Teams are groups of users and can be used to assign and filter work across deals, projects, planning, and other resources.
Teams cannot be created, updated, or deleted through the API. The info() method is not supported β use list() with an ids filter to retrieve a specific team.
teams
| Capability | Supported |
|---|---|
| Pagination | β Not supported |
| Filtering | β Supported |
| Sorting | β Supported |
| Sideloading | β Not supported |
| Creation | β Not supported |
| Update | β Not supported |
| Deletion | β Not supported |
Note on pagination: All matching teams are returned in a single response. There is no
page_size/page_numbersupport on this resource.
Note on
info(): Callinginfo()on this resource throws aBadMethodCallException. UsebyIds()to retrieve a specific team.
Returns teams matching the given filters, with optional sorting.
use McoreServices\TeamleaderSDK\Facades\Teamleader;
// All teams
$teams = Teamleader::teams()->list();
// Filter by name
$teams = Teamleader::teams()->list([
'term' => 'Sales',
]);
// Filter by team leader
$teams = Teamleader::teams()->list([
'team_lead_id' => 'user-uuid',
]);
// Sorted by name ascending
$teams = Teamleader::teams()->list([], [
'sort' => [['field' => 'name', 'order' => 'asc']],
]);Shorthand for list(['term' => $term]).
$teams = Teamleader::teams()->search('Design');Shorthand for list(['ids' => $ids]). Use this instead of info() to retrieve specific teams.
$teams = Teamleader::teams()->byIds(['uuid-1', 'uuid-2']);Shorthand for list(['team_lead_id' => $teamLeadId]).
$teams = Teamleader::teams()->byTeamLead('user-uuid');Returns all teams sorted by name.
$teams = Teamleader::teams()->sortedByName(); // asc
$teams = Teamleader::teams()->sortedByName('desc'); // descFilter by an array of team UUIDs.
$teams = Teamleader::teams()->list([
'ids' => ['uuid-1', 'uuid-2'],
]);Search filter on team name.
$teams = Teamleader::teams()->list([
'term' => 'Support',
]);Filter by the UUID of the team leader (a user).
$teams = Teamleader::teams()->list([
'team_lead_id' => 'user-uuid',
]);The only available sort field is name.
| Field | Description |
|---|---|
name |
Sort alphabetically by team name |
$teams = Teamleader::teams()->list([], [
'sort' => [['field' => 'name', 'order' => 'asc']],
]);String shorthand is also accepted and normalised to the array format:
$teams = Teamleader::teams()->list([], [
'sort' => 'name',
]);[
'data' => [
[
'id' => 'team-uuid',
'name' => 'Sales',
'team_lead' => [
'type' => 'user',
'id' => 'user-uuid',
],
],
],
]$teams = Teamleader::teams()->sortedByName();
$options = array_column($teams['data'], 'name', 'id');
// ['uuid-1' => 'Design', 'uuid-2' => 'Sales', ...]// info() is not supported β use byIds() instead
$result = Teamleader::teams()->byIds(['team-uuid']);
$team = $result['data'][0] ?? null;$teams = Teamleader::teams()->byTeamLead('user-uuid');
foreach ($teams['data'] as $team) {
echo $team['name'] . "\n";
}Teams change infrequently. Cache them to avoid unnecessary API calls:
$teams = Cache::remember('tl_teams', 3600, function () {
return Teamleader::teams()->sortedByName();
});use BadMethodCallException;
use McoreServices\TeamleaderSDK\Exceptions\TeamleaderException;
// info() throws immediately β don't call it
try {
$team = Teamleader::teams()->info('team-uuid'); // throws BadMethodCallException
} catch (BadMethodCallException $e) {
// Use byIds() instead
$result = Teamleader::teams()->byIds(['team-uuid']);
}
// Standard error handling for list()
try {
$teams = Teamleader::teams()->list(['term' => 'Sales']);
} catch (TeamleaderException $e) {
Log::error('Teamleader error', ['message' => $e->getMessage()]);
}- Users β Team leaders and members are users
- Departments β Departments organise users; teams group them differently
- Deals β Deals can be assigned to teams
- Filtering β Filter and sort reference
Last Updated: August 2026 β’ SDK Version: 2.2.2 β’ Made with β€οΈ by MCore Services
- Departments
- Users
- Teams
- Custom Fields
- Work Types
- Document Templates
- Currencies
- Notes
- Email Tracking
- Closing Days
- Day Off Types
- Days Off
- User Schedules
- Invoices
- Credit Notes
- Subscriptions
- Payment Methods
- Payment Terms
- Tax Rates
- Withholding Tax Rates
- Commercial Discounts
Next Gen Projects
Legacy Projects