Skip to main content

Projects

Projects are the central organizing unit in LetsBuild. They represent construction projects and contain all related data including lists, forms, participants, and more.

📖 Project Reference

Project Queries​

Get All Projects (Paginated)​

Retrieve a paginated list of all projects you have access to:

query AllProjects($pagination: Pagination) {
projects(pagination: $pagination) {
data {
id
name
code
address
city
zipCode
startDate
endDate
isArchived
country {
name
iso
}
}
paginationInfo {
totalCount
currentPageNumber
pageSize
totalPageCount
currentPageItemCount
}
}
}

Variables:

{
"pagination": {
"pageNumber": 1,
"pageSize": 20
}
}

Get Single Project​

Retrieve a specific project by ID:

query GetProject($id: UUID!) {
project(id: $id) {
id
name
code
address
city
zipCode
startDate
endDate
isArchived
logoUrl
country {
id
name
iso
iso2
}
entityCreationDate
entityVersion
sequenceVersion
}
}

Search Projects​

Search for projects using filters:

query SearchProjects($filter: SearchProjectFilter!, $afterId: UUID, $pageSize: Int) {
searchProjects(filter: $filter, afterId: $afterId, pageSize: $pageSize) {
id
name
code
address
city
zipCode
startDate
endDate
isArchived
}
}

Variables:

{
"filter": {
"name": {
"contains": "Construction"
},
"isArchived": {
"equals": false
}
},
"pageSize": 50
}

Project Mutations​

Create Project​

Create a new project:

mutation CreateProject($project: CreateProjectInput!) {
createProject(project: $project) {
id
name
code
address
city
zipCode
startDate
endDate
country {
name
iso
}
}
}

Variables:

{
"project": {
"name": "New Construction Project",
"code": "NCP2024",
"address": "123 Main Street",
"city": "Anytown",
"zipCode": "12345",
"startDate": "2024-01-01",
"endDate": "2024-12-31",
"countryId": "6f838f30-5554-405c-b013-d030bef7e6a2"
}
}

Delete Projects​

Delete multiple projects:

mutation DeleteProjects($projectIDs: [UUID!]!) {
deleteProjects(projectIDs: $projectIDs) {
success
errorCode
}
}

Variables:

{
"projectIDs": [
"123e4567-e89b-12d3-a456-426614174000",
"456e7890-e89b-12d3-a456-426614174001"
]
}

Project Participants​

Get Project Participants​

Retrieve all participants for a project:

query GetProjectParticipants($projectID: UUID!) {
projectParticipants(projectID: $projectID) {
participantId
projectId
userId
accessRightLevel
user {
id
displayName
email
companyName
language
}
}
}

Add Project Participants​

Add new participants to a project:

mutation AddProjectParticipants($projectID: UUID!, $participants: [AddProjectParticipantInput!]!) {
addProjectParticipants(projectID: $projectID, participants: $participants) {
participantId
projectId
userId
accessRightLevel
user {
displayName
email
}
}
}

Variables:

{
"projectID": "123e4567-e89b-12d3-a456-426614174000",
"participants": [
{
"userID": "789e0123-e89b-12d3-a456-426614174002",
"accessRightLevel": "CONTRIBUTOR"
},
{
"userID": "012e3456-e89b-12d3-a456-426614174003",
"accessRightLevel": "GUEST"
}
]
}

Remove Project Participants​

Remove participants from a project:

mutation RemoveProjectParticipants($projectID: UUID!, $participantIDs: [UUID!]!) {
removeProjectParticipants(projectID: $projectID, participantIDs: $participantIDs) {
participantId
projectId
userId
accessRightLevel
}
}

Send Project Invitation Email​

Send invitation emails to project participants:

mutation SendProjectInvitationEmail($projectID: UUID!, $participantIDs: [UUID!]!, $emailLanguage: LanguageCode) {
sendProjectInvitationEmail(
projectID: $projectID,
participantIDs: $participantIDs,
emailLanguage: $emailLanguage
)
}

Common Use Cases​

1. Project Overview​

query GetProjectDetails($projectId: UUID!) {
project(id: $projectId) {
id
name
code
startDate
endDate
}

projectParticipants(projectID: $projectId) {
user {
displayName
email
}
accessRightLevel
}

lists(projectID: $projectId) {
id
title
pointsCount
}
}

2. Project Search with Filters​

query SearchProjects {
searchProjects(
filter: {
isArchived: { equals: false }
name: { contains: "Construction" }
}
pageSize: 100
) {
id
name
code
startDate
endDate
}
}

Next Steps​

Now that you understand project operations: