5-Minute Quick Start
Get WardenAuth running end-to-end: create an organization, define permissions, assign a role, and make your first access check.
Step 1: Register an Organization
curl -X POST https://public.wardenauthz.com/v1/register \
-H "Content-Type: application/json" \
-d '{
"organizationName": "My Startup",
"email": "admin@mystartup.com",
"password": "secure-password-here"
}'
You'll receive an API key and your organization ID in the response. Save the API key — you'll need it for all subsequent requests.
{
"apiKey": "ak_live_...",
"orgId": "3c27c062-75c5-4d64-9f5d-fbf75cbc6b74",
"subjectId": "sub-..."
}
Step 2: Create Permissions
Define what actions should be allowed or denied:
# Allow reading documents
curl -X POST https://api.wardenauthz.com/v1/scope/{orgId}/permission \
-H "x-api-key: ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"id": "docs-read",
"resource": "documents",
"action": "read",
"effect": "allow",
"name": "Read documents"
}'
# Allow writing documents
curl -X POST https://api.wardenauthz.com/v1/scope/{orgId}/permission \
-H "x-api-key: ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"id": "docs-write",
"resource": "documents",
"action": "write",
"effect": "allow",
"name": "Write documents"
}'
Step 3: Create a Role
Bundle permissions into a role:
curl -X POST https://api.wardenauthz.com/v1/scope/{orgId}/role \
-H "x-api-key: ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"id": "editor",
"name": "Editor",
"description": "Can read and write documents",
"permissions": ["docs-read", "docs-write"]
}'
Step 4: Assign Access
Create an access policy that assigns a user to a role:
curl -X POST https://api.wardenauthz.com/v1/access-policy \
-H "x-api-key: ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"subjectId": "user-alice",
"scopeId": "{orgId}",
"roleIds": ["editor"],
"subjectType": "user"
}'
Step 5: Check Access
Now verify Alice can read documents:
curl -X POST https://api.wardenauthz.com/v1/access/check \
-H "x-api-key: ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"subjectId": "user-alice",
"scopeId": "{orgId}",
"resource": "documents",
"action": "read"
}'
{ "allowed": true, "reasoning": ["permission docs:read via role editor"] }
Next Steps
- Use the TypeScript SDK for type-safe API access
- Set up Agent Security to protect your AI agents
- Explore the full API reference