Reorder a database's validation rules
Sets the order the rules are evaluated in. `orderedIds` must list every rule on the database exactly once; a partial order is rejected rather than reshuffling the rules it omits. Requires the `databases:write` permission. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
apiKeyAuthorizationBearer <snoze_sk_…>Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
workspaceId*stringdatabaseId*stringapplication/json- body
orderedIds*array<string>clientMutationId?string|nullSuccess
application/json- response
data*array<>curl -X POST 'https://api.snoze.dev/v1/workspaces/string/databases/string/validation-rules/reorder' \ -H 'Content-Type: application/json' \ -d '{ "orderedIds": [ "string" ]}'{ "data": [ { "id": "string", "workspaceId": "string", "databaseId": "string", "label": "string", "condition": "string", "message": "string", "severity": "block", "fieldKey": "string", "enabled": true, "order": 0, "createdAt": "string", "updatedAt": "string" } ]}Add a validation rule to a database
Creates a rule whose `condition` formula must evaluate true for a record to be valid: `block` severity refuses the write and surfaces `message`, while `warn` lets the write through and records the message. Requires the `databases:write` permission and rejects a condition that does not parse. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
Update a validation rule
Changes the rule's label, condition, message, severity, anchored field, enabled flag or order; disabling a rule stops it running without losing its definition. Requires the `databases:write` permission and responds with not-found for an unknown rule. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.