Skip to main content

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 the Organization policy:

Getting an API Key

  1. Navigate to Organization Settings
  2. Go to Settings > Organization Info
  3. Generate an API Key
  4. 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 members
  • GET /public/members/{id} - Get member details
  • POST /public/members - Invite new member
  • PUT /public/members/{id} - Update member
  • DELETE /public/members/{id} - Remove member

Groups

  • GET /public/groups - List groups
  • GET /public/groups/{id} - Get group details
  • POST /public/groups - Create group
  • PUT /public/groups/{id} - Update group
  • DELETE /public/groups/{id} - Delete group

Policies

  • GET /public/policies - List policies
  • GET /public/policies/{id} - Get policy details
  • PUT /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
Rate limit headers are included in responses:
Exceeding rate limits returns 429 Too Many Requests. Implement exponential backoff in your code.

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

  1. Rotate API keys regularly (every 90 days recommended)
  2. Store credentials securely - never commit to version control
  3. Use environment variables for API credentials
  4. Implement token caching - reuse tokens until expiration

Error Handling

Rate Limiting

  1. Implement exponential backoff for retries
  2. Cache responses when appropriate
  3. Batch operations where possible
  4. 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