Cosmoner Docs
API Reference

Accounts

Create user accounts and manage password resets.

Create Account

POST /v1/accounts

Creates a new user account. A Stripe customer is created and linked to the user. No payment method is collected at signup — resource billing runs on the per-project card added by the project's biller.

Auth: None (public)

Request Body:

{
  "name": "John Doe",
  "email": "[email protected]",
  "password": "securepassword"
}

Response (201):

{
  "success": true,
  "data": {
    "user": { "id": "...", "email": "[email protected]", "name": "John Doe" }
  }
}

Notes:

  • Uses transactional rollback — if any step fails, all changes are reverted
  • A Stripe customer is created with the user's email

Request Password Reset

POST /v1/accounts/restore

Sends a password reset email. Rate limited to 5 attempts per IP per 10 minutes.

Auth: None (public)

Request Body:

{
  "email": "[email protected]",
  "locale": "en"
}

Response (200):

{
  "success": true,
  "data": null
}

Notes:

  • Always returns 200 regardless of whether the email exists (prevents enumeration)
  • Reset link points to FRONTEND_URL/reset-password

On this page