API Reference

Api Reference

API Reference (v1.0)

Welcome to the AuthSetu API reference. All API requests should be made to https://api.authsetu.com.

Application Management

Manage your authentication environments.

List Projects

GET /api/v1/projects

Returns a list of projects in your organization.

cURL Example:

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

---

Get Application Details

GET /api/v1/projects/[projectId]

cURL Example:

bashGET
curl -X GET "https://api.authsetu.com/api/v1/projects/550e8400-e29b-41d4-a716-446655440000" \
     -H "Authorization: Bearer YOUR_SECRET_KEY"

---

API Keys

Create API Key

POST /api/v1/projects/[projectId]/api-keys

Body Parameters:

  • name: String (required)

  • type: secret | publishable

  • scopes: Array of strings

cURL Example:

bashPOST
curl -X POST "https://api.authsetu.com/api/v1/projects/[projectId]/api-keys" \
     -H "Authorization: Bearer YOUR_SECRET_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "name": "Production Backend Key",
       "type": "secret",
       "scopes": ["customer:write", "customer:read"]
     }'

---

Customer Management

Register a Customer

POST /api/v1/customers

cURL Example:

bashPOST
curl -X POST "https://api.authsetu.com/api/v1/customers" \
     -H "Authorization: Bearer YOUR_SECRET_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "email": "user@example.com",
       "projectId": "YOUR_PROJECT_ID",
       "metadata": {
         "plan": "premium"
       }
     }'

---

Auth Workflow (Server-Side)

Verify Email Link

POST /api/v1/auth/verify-email

cURL Example:

bashPOST
curl -X POST "https://api.authsetu.com/api/v1/auth/verify-email" \
     -H "Content-Type: application/json" \
     -d '{
       "token": "verification_token_from_link"
     }'

---

Organizations & Billing

Get Billing Portal Link

POST /api/v1/billing/portal

cURL Example:

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"
     }'


Was this page helpful?