-
-
Notifications
You must be signed in to change notification settings - Fork 0
Tasks
Manage tasks in Teamleader Focus.
The Tasks resource manages standalone tasks β to-do items that can be assigned to users, linked to customers or legacy milestones, and scheduled in the calendar. This is not the same as Project-Tasks, which manages work items inside Projects v2.
Access via Teamleader::tasks().
Not to be confused with Project-Tasks β this resource uses endpoint
tasks; project tasks useprojects-v2/tasks.Only sort field is
name. No other sort fields are recognised.
schedule()validates ISO 8601 datetime format β non-matching strings throw before the request.
unassigned()passesuser_id: nullexplicitly β not an empty filter.
tasks
| Capability | Supported |
|---|---|
| Pagination | β Supported |
| Filtering | β Supported |
| Sorting | β
Supported (name only) |
| Sideloading | β Not supported |
| Creation | β Supported |
| Update | β Supported |
| Deletion | β Supported |
use McoreServices\TeamleaderSDK\Facades\Teamleader;
$tasks = Teamleader::tasks()->list();
$tasks = Teamleader::tasks()->list(
['completed' => false, 'user_id' => 'user-uuid'],
['sort' => [['field' => 'name', 'order' => 'asc']], 'page_size' => 50]
);$task = Teamleader::tasks()->info('task-uuid');Three fields are required and validated:
| Required | Notes |
|---|---|
title |
Task title |
due_on |
YYYY-MM-DD β validated |
work_type_id |
Work type UUID |
$task = Teamleader::tasks()->create([
'title' => 'Follow up with client',
'due_on' => '2025-06-30',
'work_type_id' => 'work-type-uuid',
'description' => 'Discuss renewal options',
'user_id' => 'user-uuid',
'customer' => ['type' => 'company', 'id' => 'company-uuid'],
]);Injects id into the request body.
Teamleader::tasks()->update('task-uuid', ['title' => 'Follow up tomorrow', 'due_on' => '2025-07-01']);Teamleader::tasks()->delete('task-uuid');Teamleader::tasks()->complete('task-uuid');
Teamleader::tasks()->reopen('task-uuid');Schedules a task in the calendar. Both datetimes validated as ISO 8601 (YYYY-MM-DDTHH:MM:SS+HH:MM).
Teamleader::tasks()->schedule(
'task-uuid',
'2025-06-30T09:00:00+02:00',
'2025-06-30T10:00:00+02:00'
);| Method | Filter sent |
|---|---|
forUser(string $userId) |
user_id: $userId |
unassigned() |
user_id: null (explicit null) |
completed() |
completed: true |
incomplete() |
completed: false |
scheduled() |
scheduled: true |
forMilestone(string $milestoneId) |
milestone_id: $milestoneId |
forCustomer(string $type, string $id) |
customer: {type, id} β type validated |
dueBetween(string $from, string $by) |
due_from + due_by β dates validated |
search(string $term) |
term: $term |
byIds(array $ids) |
ids: $ids |
Teamleader::tasks()->incomplete();
Teamleader::tasks()->forUser('user-uuid');
Teamleader::tasks()->forCustomer('company', 'company-uuid');
Teamleader::tasks()->dueBetween('2025-06-01', '2025-06-30');| Filter | Type | Description |
|---|---|---|
ids |
array | Filter by task UUIDs |
user_id |
string|null | Assigned user UUID; pass null for unassigned |
milestone_id |
string | Legacy milestone UUID |
completed |
bool | Completion status |
scheduled |
bool | Scheduled in calendar |
due_by |
string | Due on or before this date (YYYY-MM-DD) |
due_from |
string | Due on or after this date (YYYY-MM-DD) |
term |
string | Searches in description |
customer |
object |
{type: contact|company, id: uuid} β type validated |
use InvalidArgumentException;
// Missing required field
try {
Teamleader::tasks()->create(['title' => 'Test', 'due_on' => '2025-06-30']);
// missing work_type_id
} catch (InvalidArgumentException $e) {
// 'work_type_id is required for creating a task'
}
// Invalid datetime on schedule()
try {
Teamleader::tasks()->schedule('task-uuid', '2025-06-30 09:00:00', '2025-06-30 10:00:00');
} catch (InvalidArgumentException $e) {
// 'starts_at must be in ISO 8601 format (e.g., 2025-02-04T16:00:00+00:00)'
}
// Invalid customer type
try {
Teamleader::tasks()->forCustomer('team', 'uuid');
} catch (InvalidArgumentException $e) {
// 'Invalid customer type. Must be one of: contact, company'
}- Project Tasks β Tasks inside Projects v2 (different endpoint, different fields)
-
Legacy Milestones β Tasks can be linked to legacy milestones via
milestone_id -
Work Types β
work_type_idrequired on create - Time Tracking β Log time against tasks
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