Auth API
The auth service is the identity, billing, and team-management plane. Base URL: https://cloudnx.in/auth/.
Sessions
| Method | Path | Purpose |
|---|---|---|
| POST | /auth/register | Email + password sign-up. Returns access + refresh tokens. |
| POST | /auth/login | Sign in. May return {requires_2fa, pending_token} for MFA users. |
| POST | /auth/2fa/login-verify | Submit OTP + pending token to complete MFA login. |
| POST | /auth/refresh | Exchange refresh token for a new access pair. |
| POST | /auth/forgot-password | Email a password-reset link. |
| POST | /auth/reset-password | Submit token + new password. |
| POST | /auth/verify-email | Submit 6-digit OTP to verify email. |
| GET | /auth/me | Current user (root or IAM) profile. |
IAM
| Method | Path | Purpose |
|---|---|---|
| POST | /auth/iam-login | IAM user sign-in (account_id + username + password). |
| POST | /auth/iam-login/verify | OTP step for MFA-enabled IAM users. |
| POST | /auth/iam/exchange-credentials | Exchange access key (SigV4 or body secret) for a 15-min JWT. |
| GET / POST | /auth/iam/users | List or create IAM users. |
| DELETE | /auth/iam/users/{username} | Delete an IAM user (cascades policies + keys). |
| PATCH | /auth/iam/users/{username}/password | Set, reset, or disable console password. |
| GET / POST / DELETE | /auth/iam/users/{username}/access-keys[/{id}] | Manage programmatic credentials. |
| GET / POST / DELETE | /auth/iam/policies[/{id}] | List managed + custom policies; create or delete custom. |
| GET / POST / DELETE | /auth/iam/groups[/{name}] | Group CRUD. |
| GET / POST | /auth/iam/me/mfa[/setup,enable,disable] | IAM user’s own TOTP MFA. |
| GET / PUT | /auth/account/password-policy | Per-account password rules. |
Billing
| Method | Path | Purpose |
|---|---|---|
| GET | /auth/billing | Wallet balance, MTD spend, projection, runway, history, daily trend. |
| POST | /auth/billing/topup | Create a Razorpay order for manual top-up. |
| GET | /auth/billing/transactions | Wallet credit history. |
| GET / PATCH | /auth/billing/tax-profile | GSTIN + legal name for tax invoices. |
| GET | /auth/billing/invoices[/{id}] | List or download tax invoices. |
| GET / POST / PATCH / DELETE | /auth/billing/autopay[/setup,activate] | Razorpay mandate lifecycle. |
| GET / POST | /auth/billing/subscription[s,e,…] | Razorpay Subscriptions plan management. |
Teams
| Method | Path | Purpose |
|---|---|---|
| POST | /auth/team/invite | Invite by email + role. |
| GET / DELETE | /auth/team/invites[/{id}] | List / revoke pending invites. |
| POST | /auth/team/accept | Accept invite (requires logged-in session). |
| GET | /auth/team/invite/info | Public — invite-token info for the /join page. |
| GET / DELETE | /auth/team/members[/{id}] | List or remove team members. |
Audit logs
GET /auth/audit-logs returns the 200 most recent state-changing requests for the calling user’s billing account. Filter via query string: ?service=compute&method=POST&q=instances.
Curl example
curl -X POST https://cloudnx.in/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","password":"…"}'See Compute API next.