SnozeDevelopers
API referenceDatabases

Update a view's definition

Applies a change to the view's label, kind, manifest, scope, placement or source database. `expectedVersion` must match the view's current `definitionVersion`, so a stale edit is rejected as a conflict rather than overwriting a concurrent one. Editing a shared view needs the `views:write` permission, changing its placement also needs `resources:write`, and locking a view is reserved to workspace owners and admins.

PATCH
/v1/workspaces/{workspaceId}/databases/{databaseId}/views/{viewId}

Authorization

apiKey
headerAuthorizationBearer <snoze_sk_…>

Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.

Path Parameters

workspaceId*string
databaseId*string
viewId*string

Request Body

application/json
  1. body
key?string|null
label?string|null
kind?|null
placement?|null
sourceDatabaseId?|null
itemId?|null
parentItemId?|null
manifest?|null
scope?|null
locked?boolean|null
expectedVersion*number
clientMutationId?string|null

Response Body

Success

application/json
  1. response
data*
Example Request
curl -X PATCH 'https://api.snoze.dev/v1/workspaces/string/databases/string/views/string' \  -H 'Content-Type: application/json' \  -d '{  "expectedVersion": 0}'
Example Response
{  "data": {    "id": "string",    "workspaceId": "string",    "databaseId": "string",    "key": "string",    "label": "string",    "kind": "table",    "placement": "database",    "manifest": {},    "relationFieldId": "string",    "ownerUserId": "string",    "scope": "shared",    "locked": true,    "definitionVersion": 0,    "createdAt": "string",    "updatedAt": "string"  }}