The Garage Admin API provides programmatic access to administer your Garage cluster, including managing cluster status, layout, keys, buckets, and maintenance tasks.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/deuxfleurs-org/garage/llms.txt
Use this file to discover all available pages before exploring further.
API Version
The current version of the Admin API is v2. All API endpoints are prefixed with/v2/.
No breaking changes to the Garage administration API will be published outside of a major release.
Version History
- Before Garage v0.7.2 - no admin API
- Garage v0.7.2 - admin API v0
- Garage v0.9.0 - admin API v1, deprecate admin API v0
- Garage v2.0.0 - admin API v2, deprecate admin API v1
Configuration
The Admin API is accessible through a dedicated server whose listen address is specified in the[admin] section of the configuration file.
Authentication
Administration API requests are authenticated using HTTP bearer tokens.Using Bearer Tokens
Add the following HTTP header to your requests:User-Defined API Tokens
Cluster administrators can dynamically define administration tokens using the CLI:Token Properties
- Scoped access: Tokens can be limited to specific API operations
- Expiration: Tokens can have an expiration date
- Hashed storage: Tokens are hashed internally and identified by their prefix
Master API Tokens
Master tokens can be configured in the[admin] section:
admin_token: Grants access to all administration endpointsmetrics_token: Grants access only to the/metricsendpoint
With the introduction of user-defined admin tokens, the use of master API tokens is now discouraged.
Making API Requests
Using curl
Using the garage CLI
Since v2.0.0, the garage binary provides a json-api subcommand:
With JSON Body
With Query Parameters
With Both Query and Body
The
garage json-api command uses Garage’s internal RPC protocol and does not require authentication.Special Endpoints
Health Check
200 OK if the cluster has quorum, otherwise 503 Service Unavailable.
Example:
Metrics
On-Demand TLS Check
200 OK: Domain redirects to a static website bucket400 Bad Request: No static website bucket exists for this domain
API Categories
The Admin API is organized into several categories:- Cluster: Status, health, and node connectivity
- Cluster Layout: Layout management and updates
- Buckets: Bucket creation, configuration, and deletion
- Access Keys: Key management and permissions
- Admin Tokens: Token management
- Nodes: Node information and maintenance
- Workers: Background worker management
Error Responses
All endpoints return errors in the following format:200: Success400: Bad Request (invalid parameters)404: Not Found (resource doesn’t exist)500: Internal Server Error503: Service Unavailable
OpenAPI Specification
The complete OpenAPI specification is available at:Next Steps
Cluster Management
Manage cluster status, health, and layout
Bucket Management
Create and manage S3 buckets
Key Management
Manage access keys and permissions