Skip to main content
All API errors return a JSON body with an error field and an optional code field for programmatic handling.

Error response format

Some validation errors include a details array with field-level information:

HTTP status codes

400 Bad Request

The request body is malformed or missing required fields.
Common causes:
  • Missing required fields (title, role, taskBrief)
  • Invalid field types (string where number expected)
  • Values out of range (timeLimitMinutes must be positive)
  • taskBrief not provided and no issueId specified

401 Unauthorized

The API key is missing, invalid, expired, or revoked.
Common causes:
  • Missing Authorization header
  • Malformed Bearer token
  • Revoked API key
  • Using a candidate key (PST-XXXX) instead of an org API key (psk_live_...)

402 Payment Required

The organization does not have an active subscription.
Possible code values:

403 Forbidden

The API key lacks the required scope or the organization has exceeded its quota.
Common causes:
  • API key has only read scope but the operation requires write
  • Monthly assessment quota exceeded

404 Not Found

The requested resource does not exist or does not belong to your organization.
Common causes:
  • Invalid or non-existent resource ID
  • Resource belongs to a different organization
  • Resource has been soft-deleted

409 Conflict

The resource already exists (e.g., creating a session with a duplicate ID).

429 Too Many Requests

Rate limit exceeded. See Rate Limits.
Check the x-ratelimit-reset response header for when you can retry.

500 Internal Server Error

An unexpected error occurred on the server.
If you encounter persistent 500 errors, contact support with the request details and approximate timestamp.

Handling errors in code