API reference · v1
Preview a configuration change
Compare the current effective policy with the proposed policy without saving or spending credits. A valid draft can still have field errors; inspect can_save before applying.
Authorization
apiSession Owner credential for a single workspace. Expires after seven days or on revocation.
In: header
Path Parameters
Okae workspace ID from this session.
uuidOkae repository UUID returned as repository.id, or as id on a repository list item.
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/repositories/497f6eca-6276-4993-bfeb-53cbbbba6f08/settings/preview" \ -H "Content-Type: application/json" \ -d '{ "expected_revision": 7, "updates": { "enabled_rules": { "lockfiles": false } }, "removals": [] }'{ "before": { "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", "repository": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "full_name": "string" }, "context": { "branch": "string", "commit_sha": "string", "file": { "path": "string", "status": "present", "blob_sha": "string", "url": "http://example.com" } }, "configuration": { "status": "valid", "errors": [ { "code": "string", "message": "string", "path": "string" } ] }, "fields": [ { "key": "enable_approvals", "value": "string", "source": "service_default", "default": "string", "constraints": { "type": "boolean", "minimum": 0, "maximum": 0, "enum": [ "string" ], "labels": { "property1": "string", "property2": "string" }, "items": { "type": "string" }, "mandatory": [ "string" ], "read_only": true } } ], "review_setting": "most_cautious", "approval": { "available": true, "blockers": [ { "code": "string", "message": "string", "path": "string" } ] }, "warnings": [ { "code": "string", "message": "string", "path": "string" } ], "storage": { "repository": { "status": "available", "revision": 1, "overrides": { "enable_approvals": true, "assess_drafts": true, "assess_forks": true, "strictness": "most_cautious", "protected_paths": [ "string" ], "ignored_paths": [ "string" ], "max_changed_lines": 1, "max_files": 1, "enabled_rules": { "deleted_files": true, "renamed_files": true, "ci_configuration": true, "dependency_manifests": true, "lockfiles": true, "licence_files": true, "code_ownership": true, "infrastructure": true, "api_schemas": true, "database_migrations": true, "binary_files": true, "executable_permissions": true, "symlinks": true, "submodules": true, "agent_instructions": true, "hidden_characters": true, "auto_run_config": true }, "signals": { "consumer_compatibility": "most_cautious", "data_access": "most_cautious", "permissions": "most_cautious", "production": "most_cautious", "dependencies": "most_cautious", "hard_to_revert": "most_cautious", "entry_point": "most_cautious", "weakens_verification": "most_cautious", "memory_safety": "most_cautious", "injection": "most_cautious", "unsafe_deserialization": "most_cautious", "security_controls": "most_cautious" } } } } }, "after": { "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", "repository": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "full_name": "string" }, "context": { "branch": "string", "commit_sha": "string", "file": { "path": "string", "status": "present", "blob_sha": "string", "url": "http://example.com" } }, "configuration": { "status": "valid", "errors": [ { "code": "string", "message": "string", "path": "string" } ] }, "fields": [ { "key": "enable_approvals", "value": "string", "source": "service_default", "default": "string", "constraints": { "type": "boolean", "minimum": 0, "maximum": 0, "enum": [ "string" ], "labels": { "property1": "string", "property2": "string" }, "items": { "type": "string" }, "mandatory": [ "string" ], "read_only": true } } ], "review_setting": "most_cautious", "approval": { "available": true, "blockers": [ { "code": "string", "message": "string", "path": "string" } ] }, "warnings": [ { "code": "string", "message": "string", "path": "string" } ], "storage": { "repository": { "status": "available", "revision": 1, "overrides": { "enable_approvals": true, "assess_drafts": true, "assess_forks": true, "strictness": "most_cautious", "protected_paths": [ "string" ], "ignored_paths": [ "string" ], "max_changed_lines": 1, "max_files": 1, "enabled_rules": { "deleted_files": true, "renamed_files": true, "ci_configuration": true, "dependency_manifests": true, "lockfiles": true, "licence_files": true, "code_ownership": true, "infrastructure": true, "api_schemas": true, "database_migrations": true, "binary_files": true, "executable_permissions": true, "symlinks": true, "submodules": true, "agent_instructions": true, "hidden_characters": true, "auto_run_config": true }, "signals": { "consumer_compatibility": "most_cautious", "data_access": "most_cautious", "permissions": "most_cautious", "production": "most_cautious", "dependencies": "most_cautious", "hard_to_revert": "most_cautious", "entry_point": "most_cautious", "weakens_verification": "most_cautious", "memory_safety": "most_cautious", "injection": "most_cautious", "unsafe_deserialization": "most_cautious", "security_controls": "most_cautious" } } } } }, "changes": [ { "key": "enable_approvals" } ], "errors": [ { "code": "string", "message": "string", "path": "string" } ], "can_save": true}Read effective configuration GET
Returns the default-branch policy and its sources. Missing okae.yml inherits defaults. An invalid file produces configuration errors. File-controlled fields must be changed in the repository.
Preview okae.yml POST
Compare the current default-branch policy with the supplied okae.yml and existing managed overrides. Send null to preview deleting the file. The base commit identifies the configuration being compared. The proposed file has no published URL or blob SHA. Errors describe invalid settings. Previewing does not change the repository or workspace.