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

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

In: header

Path Parameters

workspaceId*string
databaseId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/workspaces/string/databases/string/views" \  -H "Content-Type: application/json" \  -d '{    "label": "string",    "kind": "table"  }'
{  "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"  }}