SnozeDevelopers
API referenceDatabases

Create a view on a database

Creates a table, board, timeline, calendar or other view over the database from the given manifest, and files it in the sidebar tree when `itemId` or `parentItemId` is supplied. A shared view requires the `views:write` permission while a personal one only needs `views:read`; giving the view a sidebar row also requires `resources:write`, and only workspace owners and admins may create a locked view.

POST
/v1/workspaces/{workspaceId}/databases/{databaseId}/views

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

Request Body

application/json
  1. body
id?|null
key?string|null
label*string
kind*string
Value in"table""list""board""kanban""gallery""calendar""timeline""gantt""chart"
placement?|null
manifest?|null
scope?|null
locked?boolean|null
relationFieldId?string|null
itemId?|null
parentItemId?|null
clientMutationId?string|null

Response Body

Success

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.snoze.dev/v1/workspaces/string/databases/string/views' \  -H 'Content-Type: application/json' \  -d '{  "label": "string",  "kind": "table"}'
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"  }}