API Reference

Complete REST API Endpoints

Exhaustive v1 REST API reference for AuthSetu identity management, user endpoints, organizations, and billing.


Complete REST API Endpoints (v1)

Base URL: https://api.authsetu.com

All authenticated API requests require either a Secret Key (Authorization: Bearer sk_...) or a Publishable Key (x-publishable-key: pk_...).

---

1. Authentication Endpoints

Register Customer

POST /api/v1/auth/register

bashPOST
curl -X POST "https://api.authsetu.com/api/v1/auth/register" \
  -H "x-publishable-key: pk_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "SecurePassword123!",
    "firstName": "John",
    "lastName": "Doe"
  }'

---

Login Customer

POST /api/v1/auth/login

bashPOST
curl -X POST "https://api.authsetu.com/api/v1/auth/login" \
  -H "x-publishable-key: pk_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "SecurePassword123!"
  }'

---

Refresh Access Token

POST /api/v1/auth/refresh

bashPOST
curl -X POST "https://api.authsetu.com/api/v1/auth/refresh" \
  -H "Content-Type: application/json" \
  -d '{
    "refreshToken": "your_refresh_token_here"
  }'

---

2. User Profile (/me)

Get Current User Profile

GET /api/v1/me

bashGET
curl -X GET "https://api.authsetu.com/api/v1/me" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

---

3. Organizations API

List Organizations

GET /api/v1/organizations

bashGET
curl -X GET "https://api.authsetu.com/api/v1/organizations" \
  -H "Authorization: Bearer YOUR_SECRET_KEY"

Create Organization

POST /api/v1/organizations

bashPOST
curl -X POST "https://api.authsetu.com/api/v1/organizations" \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corporation",
    "slug": "acme-corp"
  }'

---

4. Billing & Subscriptions

Create Billing Portal Session

POST /api/v1/billing/portal

bashPOST
curl -X POST "https://api.authsetu.com/api/v1/billing/portal" \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "returnUrl": "https://dashboard.authsetu.com/settings/billing"
  }'


Was this page helpful?