SnozeDevelopers
API referenceDatabase templates

Save a database template

Stores a reusable database blueprint, either from an explicit `manifest` or captured from an existing database via `sourceDatabaseId`. Requires `databases:write` in the workspace and a plan that includes custom templates. Rejected when neither a manifest nor a source database is given, when the label or description exceeds its length limit, when the manifest exceeds 200 fields, 100 views, or 2 MB, or when field/view keys are not unique; a label already in use fails unless `onLabelConflict` is `increment`, which appends a counter instead.

POST
/v1/workspaces/{workspaceId}/database-templates
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

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/database-templates" \  -H "Content-Type: application/json" \  -d '{    "label": "string"  }'
{  "data": {    "id": "string",    "workspaceId": "string",    "label": "string",    "description": "string",    "icon": "string",    "manifest": {      "version": 1,      "sourceDatabaseId": "string",      "settings": {},      "recordLayout": {        "version": 2,        "pageWidth": "default",        "propertyColumns": 1,        "propertyDensity": "comfortable",        "propertyOrder": [          "string"        ],        "hiddenFieldKeys": [          "string"        ],        "sections": [          {            "id": "string",            "label": "string",            "fieldKeys": [              "string"            ]          }        ],        "contentPosition": "before_properties",        "showComments": true,        "showActivity": true,        "pinnedFieldKeys": [          "string"        ],        "autoAddNewFields": true,        "collapsedSectionIds": [          "string"        ],        "relationViews": {          "property1": {            "defaultViewId": "string",            "position": "properties",            "collapsed": true          },          "property2": {            "defaultViewId": "string",            "position": "properties",            "collapsed": true          }        },        "showReferences": true      },      "sourceFieldIds": {        "property1": "string",        "property2": "string"      },      "fields": [        {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "key": "string",          "label": "string",          "kind": "text",          "required": true,          "defaultValue": "string",          "options": [            {              "key": "string",              "name": "string",              "color": "string",              "order": 0            }          ],          "settings": {},          "order": 0,          "columnPlacement": {            "viewId": "string",            "position": "start",            "anchorKey": "string",            "side": "left"          },          "reciprocal": {            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",            "label": "string",            "cardinality": "one"          },          "clientMutationId": "string"        }      ],      "views": [        {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "key": "string",          "label": "string",          "kind": "table",          "placement": "database",          "manifest": {},          "scope": "shared",          "locked": true,          "relationFieldId": "string",          "itemId": "f11b669d-7201-4c21-88af-d85092f0c005",          "parentItemId": "item://51c2382c-e930-406e-bbc8-39993f3ca70c",          "clientMutationId": "string"        }      ]    },    "createdAt": "string",    "updatedAt": "string"  }}