Skip to main content

API Reference

Overview of the Access Control REST API endpoints and usage patterns.

Authentication

  • All endpoints require a Bearer JWT issued by the IDP
  • Audience: control-admin
  • Include token in Authorization header: Authorization: Bearer <token>

Base URLs

EnvironmentURL
Productionhttps://access-control-api.digiwedge.com
UAThttps://access-control-api.uat.digiwedge.com
Swagger UI/api/docs (on the backend)

Versioning

All endpoints are served under /api/v1/*.

Main Resources

ResourcePathDescription
Tenants/api/v1/tenantsOrganization/tenant CRUD operations
Users/api/v1/usersUser management
User Profiles/api/v1/user-profilesExtended user data
Sessions/api/v1/sessionsSession management
Login Attempts/api/v1/login-attemptsLogin history
Roles/api/v1/rolesRole CRUD, user-role assignments
Features/api/v1/featuresFeature definitions
Permissions/api/v1/permissionsPermission definitions
Permission Assignments/api/v1/permission-assignmentsRole-permission mappings
Feature Flags/api/v1/feature-flagsFeature toggles
Invitations/api/v1/invitationsUser onboarding workflow
Capabilities/api/v1/capabilitiesPermission checks

Health Endpoints

EndpointPurpose
/api/healthLiveness check (always returns 200)
/api/health/readyReadiness check (checks DB, etc.)
/metricsPrometheus metrics

Required Headers

HeaderRequiredDescription
AuthorizationYesBearer <jwt>
x-tenant-idConditionalTenant UUID for tenant-scoped operations
Content-TypePOST/PUT/PATCHapplication/json

Error Responses

Standard HTTP status codes:

StatusMeaning
400Bad Request — Invalid input or validation error
401Unauthorized — Missing or invalid token
403Forbidden — Insufficient permissions
404Not Found — Resource doesn't exist
409Conflict — Duplicate or conflicting state
500Internal Server Error — Unexpected failure

CORS

The backend allows:

  • localhost (development)
  • *.digiwedge.com domains

Additional origins can be configured via CORS_ALLOWED_ORIGINS environment variable (comma-separated).

OpenAPI/Swagger

The full OpenAPI specification is available at /api/docs on the running backend. Use this for:

  • Interactive API testing
  • Generating client code
  • Viewing request/response schemas

TypeScript Client

See API Client for the generated TypeScript client.