Developer API
Delete a database view
V2

Delete a database view

Soft-delete a view and remove it from the database without allowing the last view to be deleted.

DELETE /v2/databases/:database_id/views/:view_id

Delete a database view

When to use

Use this endpoint to remove an unnecessary view. Deletion is soft: the view is archived and removed from the database's view list, but its data is not physically deleted.

Note: Like the page, block, and database delete endpoints, this endpoint is intentionally omitted from the machine-readable OpenAPI specification and is not projected to MCP or CLI. This page documents the HTTP endpoint only.

Endpoint

Item Value
Method DELETE
Path /v2/databases/:database_id/views/:view_id
Request body None
Response { "object": "database_view", "id": "...", "in_trash": true }
Scope databases.write
Concurrency Optional If-Match weak ETag for optimistic locking

Permissions

The credential must have the databases.write scope and write access to the target database.

Behavior

  • Soft-deleting the view (archiving its status and recording the deleter and timestamp) and removing it from the database block's views array happen in the same transaction.
  • The last active view cannot be deleted; the database must retain a default display view. The API returns 400 when deletion would remove the last active view.
  • When If-Match is supplied, the row is locked and compared inside the transaction. A mismatch returns 409 without writing anything.

Error codes

Status code Description
400 validation_error Attempted to delete the last active view.
403 forbidden Missing scope or no write access to the database.
404 not_found Database or view does not exist.
409 conflict If-Match did not match.