This backend provides a REST endpoint that accepts a list of task descriptions and returns an AI prioritized and categorized list.
All requests and responses use JSON over HTTPS.
Base URL example:
https://your-domain.com/api/v1
Call when the user clicks the Prioritize Tasks button in the frontend.
- Method: POST
- URL:
/api/v1/prioritize - Headers:
- Content Type: application/json
- Body:
{
"tasks": [
"Finish the monthly report for the boss",
"Buy groceries for the week",
"Call the plumber about the leaky faucet"
]
}
tasks(required): array of non empty strings- Minimum length: 1
- Example: "Finish the monthly report for the boss"
- Status: 200 OK
- Body:
[
{
"task": "Call the plumber about the leaky faucet",
"priority": "High",
"category": "Home"
},
{
"task": "Finish the monthly report for the boss",
"priority": "High",
"category": "Work"
},
{
"task": "Buy groceries for the week",
"priority": "Medium",
"category": "Home"
}
]Each array element contains:
task: string with the original taskpriority: string with one of "High", "Medium", "Low"category: string describing the context such as "Work", "Home", "Personal"
Errors come as JSON with an error object.
Returned for missing or invalid request body.
{
"error": {
"code": "VALIDATION_ERROR",
"message": "tasks must be a non empty array of strings"
}
}
Returned for unexpected server failures or AI provider outage.
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred. Please try again later."
}
}