-
-
Notifications
You must be signed in to change notification settings - Fork 0
Project Lines
Unified view of tasks, materials, and groups within a project.
Project Lines provides a single endpoint to list all line items in a project (tasks, materials, and groups) and to manage group membership. For creating, updating, or deleting individual items use their dedicated resources.
Access via Teamleader::projectLines().
list()throws withoutproject_idβ it is required in every call.Filter structure is nested: optional filters go inside a
filterkey, not at the top level.Fluent interface is available β chain
forProject(), filter methods, then callget().
projects-v2/projectLines
| Capability | Supported |
|---|---|
| Pagination | β Not supported |
| Filtering | β
Supported (project_id required; optional filter.types, filter.assignees) |
| Sorting | β Not supported |
| Sideloading | β Not supported |
| Creation | β Use projectTasks, materials, groups
|
| Update | β Use specific resources |
| Deletion | β Use specific resources |
project_id is required at the top level. Optional sub-filters go inside filter:
use McoreServices\TeamleaderSDK\Facades\Teamleader;
// All lines for a project
$lines = Teamleader::projectLines()->list(['project_id' => 'project-uuid']);
// Filter by line type
$lines = Teamleader::projectLines()->list([
'project_id' => 'project-uuid',
'filter' => ['types' => ['nextgenTask', 'nextgenMaterial']],
]);
// Filter by assignee
$lines = Teamleader::projectLines()->list([
'project_id' => 'project-uuid',
'filter' => ['assignees' => [['type' => 'user', 'id' => 'user-uuid']]],
]);
// Get unassigned lines (pass null for assignees)
$lines = Teamleader::projectLines()->list([
'project_id' => 'project-uuid',
'filter' => ['assignees' => null],
]);Valid line types (validated): nextgenTask, nextgenMaterial, nextgenProjectGroup
Moves a task or material into a group. Groups cannot be nested.
Teamleader::projectLines()->addToGroup('line-uuid', 'group-uuid');Removes a task or material from its current group.
Teamleader::projectLines()->removeFromGroup('line-uuid');Chain filters and terminate with get():
// Tasks only
$tasks = Teamleader::projectLines()
->forProject('project-uuid')
->tasksOnly()
->get();
// Materials only
$materials = Teamleader::projectLines()
->forProject('project-uuid')
->materialsOnly()
->get();
// Groups only
$groups = Teamleader::projectLines()
->forProject('project-uuid')
->groupsOnly()
->get();
// Assigned to a user
$userLines = Teamleader::projectLines()
->forProject('project-uuid')
->assignedTo('user', 'user-uuid')
->get();
// Unassigned
$unassigned = Teamleader::projectLines()
->forProject('project-uuid')
->unassigned(); // unassigned() terminates directly β no ->get() neededFluent methods: forProject(), tasksOnly(), materialsOnly(), groupsOnly(), ofType(array), assignedTo(string $type, string $id), unassigned(), get()
[
'data' => [
[
'line' => ['type' => 'nextgenTask', 'id' => 'task-uuid'],
'group' => ['type' => 'nextgenProjectGroup', 'id' => 'group-uuid'], // null if not in a group
],
[
'line' => ['type' => 'nextgenMaterial', 'id' => 'material-uuid'],
'group' => null,
],
],
]addToGroup() and removeFromGroup() return empty (HTTP 204).
// Get all ungrouped tasks
$unassigned = Teamleader::projectLines()
->forProject('project-uuid')
->tasksOnly()
->unassigned();
// Create a group
$group = Teamleader::groups()->create([
'project_id' => 'project-uuid',
'title' => 'Phase 1',
]);
// Move tasks into the group
foreach ($unassigned['data'] as $line) {
Teamleader::projectLines()->addToGroup($line['line']['id'], $group['data']['id']);
}Teamleader::projectLines()->removeFromGroup('line-uuid');
Teamleader::projectLines()->addToGroup('line-uuid', 'new-group-uuid');use InvalidArgumentException;
// Missing project_id
try {
Teamleader::projectLines()->list([]);
} catch (InvalidArgumentException $e) {
// 'project_id is required. Use forProject() method or provide project_id in filters.'
}
// Invalid line type in filter
try {
Teamleader::projectLines()->list([
'project_id' => 'uuid',
'filter' => ['types' => ['task']], // wrong β must be 'nextgenTask'
]);
} catch (InvalidArgumentException $e) {
// "Invalid line type: task. Must be one of: nextgenTask, nextgenMaterial, nextgenProjectGroup"
}- Projects β Parent project
- Groups β Create and manage groups
- Project Tasks β Create and manage tasks
- Materials β Create and manage materials
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