This document provides detailed information about the GoalGenius API endpoints. All API routes are prefixed with /api.
All API endpoints require authentication. The application uses Better Auth for authentication, supporting both GitHub and Google OAuth providers.
All responses are returned in JSON format. Successful responses will contain the requested data, while error responses will have the following structure:
{
"error": "Error message description"
}200: Success201: Created400: Bad Request401: Unauthorized403: Forbidden404: Not Found500: Internal Server Error
GET /api/goals?userId={userId}Query Parameters:
userId(required): The ID of the user whose goals to retrieve
Response:
[
{
"id": "uuid",
"userId": "string",
"title": "string",
"description": "string?",
"category": "health" | "career" | "learning" | "relationships",
"timeFrame": "string",
"status": "not-started" | "in-progress" | "completed",
"progress": number,
"dueDate": "string?",
"createdAt": "string",
"updatedAt": "string"
}
]POST /api/goalsRequest Body:
{
"userId": "string",
"title": "string",
"description": "string?",
"category": "health" | "career" | "learning" | "relationships",
"timeFrame": "string",
"status": "not-started" | "in-progress" | "completed",
"progress": number,
"dueDate": "string?"
}Response: The created goal object
PUT /api/goalsRequest Body:
{
"id": "uuid",
"title": "string?",
"description": "string?",
"category": "string?",
"timeFrame": "string?",
"status": "string?",
"progress": number?,
"dueDate": "string?"
}Response: The updated goal object
DELETE /api/goals?id={goalId}Query Parameters:
id(required): The ID of the goal to delete
Response:
{
"success": true
}GET /api/todos?userId={userId}Query Parameters:
userId(required): The ID of the user whose todos to retrieve
POST /api/todosRequest Body:
{
"userId": "string",
"title": "string",
"description": "string?",
"priority": "low" | "medium" | "high",
"status": "pending" | "in-progress" | "completed",
"dueDate": "string?"
}PUT /api/todosDELETE /api/todos?id={todoId}GET /api/notes?userId={userId}POST /api/notesPUT /api/notesDELETE /api/notes?id={noteId}GET /api/milestones?goalId={goalId}POST /api/milestonesPUT /api/milestonesDELETE /api/milestones?id={milestoneId}GET /api/checkins?userId={userId}POST /api/checkinsPUT /api/checkinsDELETE /api/checkins?id={checkinId}The API uses standard HTTP status codes to indicate the success or failure of requests. Here are some common error scenarios:
{
"error": "Missing required fields"
}{
"error": "Unauthorized access"
}{
"error": "Resource not found"
}{
"error": "Failed to process request"
}The API is protected by Cloudflare's rate limiting. Please be mindful of the following limits:
- Maximum of 100 requests per minute per IP
- Maximum of 1000 requests per hour per IP
For local development and testing:
-
Set up your environment variables:
cp .dev.vars.example .dev.vars cp .env.local.example .env.local
-
Start the development server:
pnpm dev
-
The API will be available at
http://localhost:3000/api
The current API version is v1. All endpoints are currently unversioned, but future breaking changes will be introduced under new versioned paths (e.g., /api/v2/).
If you encounter any issues or need help with the API:
- Check the documentation (coming soon)
- Create an issue on GitHub
Last updated: 2025