✦
┌─────────────┐
│ 📁 Project │
├─────────────┤
│ id: UUID │
│ name: Str │
│ desc: Str │
│ created: DT │
│ updated: DT │
└─────────────┘
Projects API
CRUD endpoints, request/response models, and query patterns.
GET /projects
POST /projects
GET /projects/:id
PUT /projects/:id
DELETE /projects/:id
Projects API
CRUD endpoints, request/response models, and query patterns.
Endpoints
All project endpoints are scoped to the authenticated user via Row-Level Security in Supabase.
Base Path: /rest/v1/projects
GET /projects
List all projects for the current user. Returns an array of
ArchonProject. Supports ?order=updated_at.desc, ?limit=, and ?offset= for pagination.POST /projects
Create a new project. Body:
CreateProjectRequest. Returns the created ArchonProject with server-generated id and timestamps.GET /projects/:id
Fetch a single project by UUID. Returns the full
ArchonProject or 404 if not found or not owned by the user.PUT /projects/:id
Update a project. Body:
UpdateProjectRequest (all fields optional — partial update). Returns the updated ArchonProject.DELETE /projects/:id
Delete a project and all associated tasks, messages, and files. Returns 204 No Content on success. This is irreversible.
Models
ArchonProject
struct ArchonProject: Codable, Identifiable, Hashable {
let id: UUID
var name: String
var description: String?
var createdAt: Date
var updatedAt: Date
var taskCount: Int?
var lastTaskAt: Date?
}
CreateProjectRequest
struct CreateProjectRequest: Encodable {
let name: String
let description: String?
}
UpdateProjectRequest
struct UpdateProjectRequest: Encodable {
let name: String?
let description: String?
}
Query Patterns
Search & Filter
// Search by name (partial match) GET /rest/v1/projects?name=ilike.*calculator*&order=updated_at.desc // Filter by date range GET /rest/v1/projects?created_at=gte.2026-01-01&created_at=lte.2026-12-31 // Pagination GET /rest/v1/projects?order=updated_at.desc&limit=20&offset=40
Sorting
By Last Updated (Default)
?order=updated_at.desc — Most recently modified projects first.By Name
?order=name.asc — Alphabetical order.By Creation Date
?order=created_at.desc — Newest projects first.Error Responses
Bad Request
Missing required fields (
name is required for create). Returns validation error details.Not Found
Project doesn't exist or doesn't belong to the authenticated user.
Conflict
Duplicate project name (if unique constraint is enforced). Currently not enforced.