Export the configuration

GET /v1/config-export · permission config:read and the read permission of each exported kind

Returns the environment's configuration as one environment-independent document, so you can review it, keep it in version control or apply it to another environment later. The document has no environment-specific ids, versions, timestamps or secrets: resources refer to each other by key. The same configuration always produces a byte-identical document (kinds in the order below, then by key; set-like lists sorted). The response is JSON, which is also valid YAML; keenauth config export prints YAML by default.

Request

The environment comes from the credential. The only query parameter is optional.

Parameter Description
kinds Comma-separated kinds to export, for example kinds=connection,api. Without it every kind is exported.
Kind key Permissions besides config:read
environment_settings default environment-settings:read
identity_settings default identity-settings:read
attack_protection default attack-protection:read
branding default branding:read
connection connection key connections:read
api API key apis:read, applications:read
role role key roles:read, apis:read
application application key applications:read, apis:read, connections:read
application_branding application key branding:read, applications:read

api, role and application also need the permissions of the kinds they refer to, because references are resolved to keys. config:read alone grants no resource read.

Response

200 OK with Cache-Control: no-store.

{
  "apiVersion": "config.keenauth.com/v1",
  "kinds": ["connection", "api", "application"],
  "resources": [
    {"kind": "connection", "key": "db", "spec": {"type": "database", "strategy": "password", "name": "db", "display_name": null, "status": "active", "settings": {}, "client_secret": null}},
    {"kind": "api", "key": "orders", "spec": {"identifier": "https://api.example.com/orders", "name": "Orders", "access_token_lifetime_s": 3600, "token_format": "jwt", "rbac_mode": "off", "allow_offline_access": false, "require_resource_indicator": false, "dpop_required": false, "mcp_profile": false, "first_party_access": "all", "introspection_applications": [], "permissions": [{"value": "orders:read", "display_name": null, "description": null, "consent_text_i18n": {}, "sensitivity": "normal"}]}},
    {"kind": "application", "key": "web", "spec": {"name": "Web", "app_type": "spa", "default_api": "orders", "connections": ["db"], "api_grants": [{"api": "orders", "scopes": ["orders:read"], "default_scopes": []}], "redirect_uris": ["https://app.example.com/callback"]}}
  ],
  "warnings": [
    {"code": "resource_skipped", "kind": "application", "key": "partner-bot", "reason": "organization_owned"}
  ]
}

The application spec above is shortened; the full field list is in the API reference.

Errors

HTTP code When
401 unauthenticated The credential is missing, invalid or revoked.
403 insufficient_permissions The credential lacks a required permission; required_permissions lists all of them.
413 config_document_too_large The document would exceed 5,000 resources or 10 MiB; export fewer kinds with kinds.
422 validation_failed kinds is repeated, longer than 256 characters or names an unknown kind.
429 rate_limited The rate limit was exceeded; retry after the Retry-After period.
503 service_unavailable A dependency is temporarily unavailable; retry after the Retry-After period.

Example

curl "https://api.eu.keenauth.com/v1/config-export?kinds=connection,api,application" \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"

keenauth config export --kinds connection,api,application > keenauth.yaml