okaeDocs
APIExperimental

API reference · v1

Preview a configuration change

POST
/api/v1/workspaces/{workspace_id}/repositories/{repository_id}/settings/preview

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
AuthorizationBearer <token>

Owner credential for a single workspace. Expires after seven days or on revocation.

In: header

Path Parameters

workspace_id*string

Okae workspace ID from this session.

Formatuuid
repository_id*string

Okae repository UUID returned as repository.id, or as id on a repository list item.

Formatuuid

Request 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}