Alpha — HPI is in early access. Things may break, feedback welcome.
Skip to main content
Documentation

Error Codes

All API errors return a JSON response with an error field and optional details.

Error Response Format

{
	"error": "Human-readable error message",
	"details": [{ "field": "title", "message": "Required field is missing" }]
}

The details array is included for validation errors (400) and contains field-level error information.

HTTP Status Codes

CodeMeaningWhen
200OKSuccessful read or update
201CreatedResource successfully created
400Bad RequestInvalid JSON, missing required fields, validation errors
401UnauthorizedMissing Authorization header, invalid or expired token
403ForbiddenToken lacks the required scope for this operation
404Not FoundResource doesn't exist or belongs to a different organization
409ConflictOperation conflicts with current state (e.g., cancelling a non-pending task)
500Internal Server ErrorUnexpected server error

Common Errors

Authentication Errors

ErrorCauseSolution
"Unauthorized"No Authorization headerAdd Authorization: Bearer htk_... header
"Invalid token"Token is malformedCheck token format (should start with htk_)
"Token revoked"Token was revokedCreate a new token in Settings

Permission Errors

ErrorCauseSolution
"Insufficient permissions"Token lacks required scopeCreate a token with the needed scope

Validation Errors

ErrorCauseSolution
"title is required"Missing required fieldInclude the title field
"steps must have at least 1 item"Empty steps arrayAdd at least one step
"Invalid task_id format"Non-UUID task_idUse a valid UUID or omit for auto-generation

State Errors

ErrorCauseSolution
"Task is not pending"Trying to cancel a completed taskOnly cancel tasks with pending status
"Task not found"Invalid ID or org mismatchVerify the task_id and that your token belongs to the correct org