API Reference
Interact with your gateway programmatically using the Crate API. All changes made via the API are applied instantly across the entire platform.
Authentication
All requests to the Crate Configuration API must include your API Key in the Authorization header:
Authorization: Bearer <YOUR_API_KEY>
Managing Keys
API Keys are managed directly through the Crate Dashboard:
- Navigate to Settings > API Keys in the dashboard.
- Click Generate New Key and provide a descriptive name (e.g., “CI/CD Pipeline”).
- Copy the key immediately — it will never be shown again.
Configuration API
Manage your gateway routes, rules, domains, and plugins programmatically. Crate uses a declarative system, allowing you to version control your gateway setup alongside your application code.
Export Configuration
Retrieve the current configuration for your organization.
curl -X GET https://api.crate.cc/organization/{id}/config \
-H "Authorization: Bearer YOUR_API_KEY"
Import Configuration
Apply a configuration to your organization. This operation is atomic.
curl -X PUT https://api.crate.cc/organization/{id}/config?strict=true \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/yaml" \
--data-binary @crate.yaml
Strict Mode (GitOps)
By default, importing a configuration performs a Shared Merge (upsert). Existing resources not present in the YAML are left untouched.
To enforce an exact match with your YAML (GitOps style), append strict=true to your PUT request. This will delete any resources in the organization that are NOT present in your uploaded configuration.