Cratopus icon

Gateway 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.

Authentication

All Gateway Configuration API endpoints require a valid API Key. Please see the Global API & Auth reference for details on how to generate and use your keys.


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 declarative configuration to your organization. This operation is atomic.

curl -X PUT https://api.crate.cc/organization/{id}/config \
  -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 in your organization that are 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.

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