How to archive and unarchive projects in Blue.
Archive a Project
Archiving projects is useful when you want to temporarily hide a project without permanently deleting it. Archived projects:
- Are hidden from active project lists
- Cannot be edited or modified
- Can still be viewed by project members
- Can be unarchived at any time
Basic Example
mutation {
archiveProject(id: "project-123")
}
Using Project Context Header
# With header: x-bloo-project-id: project-123
mutation {
archiveProject
}
With Variables
mutation ArchiveProject($projectId: String!) {
archiveProject(id: $projectId)
}
Variables:
{
"projectId": "abc123-project-id"
}
Unarchive a Project
To restore an archived project to active status:
mutation {
unarchiveProject(id: "project-123")
}
Mutation Parameters
archiveProject
Parameter | Type | Required | Description |
---|---|---|---|
id |
String | No | The project ID to archive. If not provided, uses the project from context headers. |
unarchiveProject
Parameter | Type | Required | Description |
---|---|---|---|
id |
String | No | The project ID to unarchive. If not provided, uses the project from context headers. |
Response
Both mutations return a Boolean indicating success:
Field | Type | Description |
---|---|---|
Boolean |
Boolean! | Returns true when the operation is successful |
Required Permissions
Project Role | Can Archive/Unarchive |
---|---|
OWNER |
✅ Yes |
ADMIN |
✅ Yes |
MEMBER |
❌ No |
CLIENT |
❌ No |
COMMENT_ONLY |
❌ No |
VIEW_ONLY |
❌ No |
Project ID Resolution
The project ID can be specified in two ways:
-
As a parameter (recommended):
archiveProject(id: "project-123")
-
Via HTTP header:
x-bloo-project-id: project-123
(preferred)x-project-id: project-123
(deprecated)
If both are provided, the parameter takes precedence.
Error Responses
Project Not Found
{
"errors": [{
"message": "Project was not found.",
"extensions": {
"code": "PROJECT_NOT_FOUND"
}
}]
}
Insufficient Permissions
{
"errors": [{
"message": "You don't have permission to archive this project",
"extensions": {
"code": "UNAUTHORIZED"
}
}]
}
What Happens When Archiving
When you archive a project:
- Project Status: The project is marked as archived
- Visibility: Hidden from active project lists
- Templates: If the project was a template, it loses template status
- Position: Moved to the end of user's project list
- Folders: Removed from any project folders
- Activity Log: Archive action is recorded
- Real-time Updates: All connected users are notified
Important Notes
- Idempotent Operation: Archiving an already archived project returns
true
without changes - Reversible: Use
unarchiveProject
to restore the project - View Access: Archived projects remain viewable by existing members
- No Data Loss: Archiving preserves all project data, unlike deletion
- Alternative to Deletion: Consider archiving instead of deleting for temporary removal