What is the Public API?
The Bitwarden Public API is designed for organization administrators to manage their organization programmatically. It provides endpoints for:- Managing organization members
- Organizing groups
- Configuring policies
- Bulk operations
The Public API is separate from the standard API and requires organization-scoped authentication.
Authentication
Public API endpoints use organization-scoped OAuth tokens with theOrganization policy:
Getting an API Key
- Navigate to Organization Settings
- Go to Settings > Organization Info
- Generate an API Key
- Use client_id and client_secret to obtain access tokens
OAuth Token Request
Response
Base URL
All Public API endpoints are prefixed with/public:
API Endpoints
Members
GET /public/members- List organization membersGET /public/members/{id}- Get member detailsPOST /public/members- Invite new memberPUT /public/members/{id}- Update memberDELETE /public/members/{id}- Remove member
Groups
GET /public/groups- List groupsGET /public/groups/{id}- Get group detailsPOST /public/groups- Create groupPUT /public/groups/{id}- Update groupDELETE /public/groups/{id}- Delete group
Policies
GET /public/policies- List policiesGET /public/policies/{id}- Get policy detailsPUT /public/policies/{id}- Update policy
Rate Limiting
The Public API implements rate limiting to ensure fair usage:- Rate: 100 requests per minute per organization
- Burst: Up to 20 requests in quick succession
Response Format
Success Response
Successful requests return JSON with the requested data:List Response
List endpoints return paginated data:Error Response
Errors return appropriate HTTP status codes with details:Common HTTP Status Codes
Best Practices
Authentication
- Rotate API keys regularly (every 90 days recommended)
- Store credentials securely - never commit to version control
- Use environment variables for API credentials
- Implement token caching - reuse tokens until expiration
Error Handling
Rate Limiting
- Implement exponential backoff for retries
- Cache responses when appropriate
- Batch operations where possible
- Monitor rate limit headers to avoid hitting limits
Use Cases
SCIM/Directory Sync
Automate user provisioning from your identity provider:Automated Onboarding
Invite new team members during onboarding:Compliance Reporting
Generate reports on organization membership:Next Steps
Members API
Manage organization members
Groups API
Organize users into groups
Policies API
Configure security policies