Skip to content

API Reference

Base URL

Use your assigned hosted API URL.

Example:

https://api.your-psychai-domain.com

POST /auth/register

Creates a user if email is not already registered.

Request body:

{
  "email": "user@example.com",
  "name": "Jane Doe",
  "password": "securePassword123",
  "user_type": "developer",
  "industry": "mental_health"
}

Success:

{
  "message": "User registered successfully"
}

POST /auth/login

Request body:

{
  "email": "user@example.com",
  "password": "securePassword123"
}

Response:

{
  "access_token": "<jwt>",
  "refresh_token": "<jwt>",
  "user_id": "<uuid>",
  "tier": "Free",
  "expires_in": 3600
}

POST /auth/refresh

Request body:

{
  "refresh_token": "<jwt>"
}

Response:

{
  "access_token": "<jwt>",
  "refresh_token": "<jwt>"
}

POST /auth/logout

Request body:

{
  "refresh_token": "<jwt>"
}

Response:

{
  "message": "Logged out successfully."
}

Password reset endpoints

POST /auth/request-password-reset

{
  "email": "user@example.com"
}

Response always uses a generic message for privacy:

{
  "message": "If the email exists in our system, a password reset link has been sent."
}

GET /auth/verify-reset-token?token=<token>

Returns:

{
  "valid": true
}

or

{
  "valid": false,
  "reason": "invalid"
}

POST /auth/reset-password

{
  "token": "<reset-token>",
  "new_password": "newPassword123"
}

POST /v1.0.0/analyze

Headers:

Authorization: Bearer <access_token>
Content-Type: application/json

Query params:

  • mode (default: Full Output)

Allowed mode values:

  • Full Output
  • Negative Table
  • Negative Explanatory
  • Negative Combined
  • Positive Table
  • Positive Explanatory
  • Positive Combined
  • Both Tables Combined
  • Both Explanatory Combined

Request body:

{
  "input_text": "I have been overwhelmed at work but I am trying to respond more calmly."
}

Response headers include:

  • X-Requests-Remaining
  • X-Reset-At

See Response Schema for mode-specific payload shapes.

GET /healthcheck

Response shape:

{
  "app_status": "ok",
  "openai_status": "ok",
  "redis_status": "ok",
  "database_status": "ok"
}

If any dependency check fails, app_status becomes degraded.