Complete API reference for Zenorizon's backend endpoints.
All API endpoints (except public ones) require authentication via NextAuth.js session cookies.
Cookie: next-auth.session-token=<session-token>// 401 Unauthorized
{
"success": false,
"error": "Authentication required"
}
// 403 Forbidden
{
"success": false,
"error": "Access denied"
}GET /api/workflow/getprojectsResponse:
{
"success": true,
"data": [
{
"id": "clx1234567890",
"title": "My Project",
"description": "Project description",
"status": "Working",
"priority": "High",
"health": "Good",
"targetDate": "2024-12-31T00:00:00.000Z",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-15T00:00:00.000Z",
"creator": {
"id": "user123",
"name": "John Doe",
"email": "john@example.com"
},
"_count": {
"issues": 5,
"members": 3
}
}
]
}GET /api/workflow/project?project_id=<project-id>Query Parameters:
project_id(required): Project ID
POST /api/workflow/createproject
Content-Type: application/jsonRequest Body:
{
"title": "New Project",
"description": "Project description",
"priority": "Medium",
"targetDate": "2024-12-31"
}Validation Rules:
title: Required, 1-100 characters, must be uniquedescription: Optional, max 500 characterspriority: Optional, one of: "Urgent", "High", "Medium", "Low", "No Priority"targetDate: Optional, valid date string
PATCH /api/workflow/updateproject
Content-Type: application/jsonRequest Body:
{
"projectId": "clx1234567890",
"title": "Updated Project Title",
"description": "Updated description",
"content": "Updated rich text content",
"status": "Working",
"priority": "High",
"health": "At Risk",
"targetDate": "2024-12-31"
}DELETE /api/workflow/deleteproject
Content-Type: application/jsonRequest Body:
{
"projectId": "clx1234567890"
}Authorization: User must be project creator
POST /api/issues/getissues
Content-Type: application/jsonRequest Body:
{
"project_id": "clx1234567890"
}POST /api/issues/createissue
Content-Type: application/jsonRequest Body:
{
"issueTitle": "New Issue",
"issueDescription": "Issue description",
"issueStatus": "Backlog",
"issuePriority": "Medium",
"projectId": "clx1234567890"
}PATCH /api/issues/updateissue
Content-Type: application/jsonRequest Body:
{
"issueId": "issue123",
"title": "Updated Issue Title",
"description": "Updated description",
"status": "Working",
"priority": "High"
}GET /api/user/getprofilePATCH /api/user/updateprofile
Content-Type: application/jsonRequest Body:
{
"username": "newusername",
"fullname": "John Smith"
}POST /api/waitlist
Content-Type: application/jsonRequest Body:
{
"userEmail": "user@example.com"
}{
"success": false,
"error": "Validation failed",
"details": [
{
"field": "title",
"message": "Title is required"
}
]
}{
"success": false,
"error": "Project not found"
}{
"success": false,
"error": "Internal server error"
}- General API: 100 requests per minute per IP
- Authentication: 10 requests per minute per IP
- Waitlist: 5 requests per minute per IP
// Get projects
const response = await fetch('/api/workflow/getprojects', {
method: 'GET',
credentials: 'include', // Include session cookies
});
const data = await response.json();
// Create project
const response = await fetch('/api/workflow/createproject', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
credentials: 'include',
body: JSON.stringify({
title: 'My New Project',
description: 'Project description',
priority: 'High'
}),
});For complete API documentation, see the individual endpoint files in the codebase.