Authentication
All Admin API endpoints require authentication using an Ory Access Token. Include the token in theAuthorization header:
Base URL
The Admin API is available at:- Ory Network:
https://{project-slug}.projects.oryapis.com/admin - Self-hosted: Configured via
serve.admin.base_urlin your Kratos configuration
Available endpoints
The Admin API is organized into the following categories:Identities
Manage user identities, credentials, and authentication methods:- Create, read, update, and delete identities
- Import credentials (passwords, social sign-in, MFA)
- Manage identity sessions
- Look up identities by credentials or external ID
Sessions
Manage authentication sessions:- List all sessions
- Get session details
- Deactivate sessions
- Extend session lifetime
Recovery
Generate recovery codes and links for account recovery:- Create recovery codes
- Create recovery links
Courier
Manage email and SMS messages sent by Kratos:- List courier messages
- Get message details and delivery status
Rate limiting
Admin API endpoints have different rate limit buckets based on their resource intensity:- kratos-admin-low: Read operations with minimal overhead
- kratos-admin-medium: Standard list and read operations
- kratos-admin-high: Write operations and resource-intensive queries
Error handling
The Admin API uses standard HTTP status codes and returns errors in a consistent JSON format:Common error codes
The request payload is invalid or improperly formatted.
Authentication credentials are missing or invalid.
The requested resource does not exist.
The request conflicts with existing data (e.g., duplicate identity).
An unexpected error occurred on the server.
Pagination
List endpoints support token-based pagination:page_size: Number of items per page (default: 250, max: 1000)page_token: Token for the next page of results
Link header with next/previous page URLs when applicable.
Best practices
Use appropriate consistency levels
For list operations, you can specify a consistency level:strong: Guaranteed most recent data (slower)eventual: Data may be ~5 seconds old (faster)
Import credentials securely
When importing identities with credentials:- Pre-hash passwords using BCrypt for better performance
- Limit batch size to 1,000 identities with hashed passwords
- Limit batch size to 200 identities with plaintext passwords