View API
View endpoints provide operations for creating, reading, updating, and deleting Iceberg views through the REST Catalog API.List Views
List all views in a namespace.Path Parameters
Optional prefix for multi-tenant deployments
Namespace identifier (multi-part namespaces use
%1F separator)Query Parameters
Pagination token from a previous response
Maximum number of views to return
Response
List of view identifiers
Token for next page of results
Example
Create View
Create a new view in the specified namespace.Path Parameters
Optional prefix for multi-tenant deployments
Namespace identifier
Request Body
View name
View location. If not provided, a location will be generated.
View schema definition
Initial view version with query definition
View properties
Response
Location of view metadata file
Complete view metadata
Additional configuration for the view
Example
Load View
Load view metadata from the catalog.Path Parameters
Optional prefix for multi-tenant deployments
Namespace identifier
View name
Query Parameters
Comma-separated list of view identifiers referencing this view
Response
Location of view metadata file
Complete view metadata including schema, versions, and properties
Additional configuration and credentials for accessing the view
Example
Replace View
Update an existing view with a new version.Path Parameters
Optional prefix for multi-tenant deployments
Namespace identifier
View name
Headers
UUIDv7 for idempotent request handling
Request Body
Assertions that must be true before applying updates
Changes to apply to view metadata
Response
Location of new metadata file
Updated view metadata
Example
View updates use requirements and updates similar to table commits. Requirements ensure the view hasn’t changed since it was last read.
Check View Exists
Check if a view exists without loading its metadata.Path Parameters
Optional prefix for multi-tenant deployments
Namespace identifier
View name
Response
No response body. Status code indicates existence.Example
Drop View
Delete a view from the catalog.Path Parameters
Optional prefix for multi-tenant deployments
Namespace identifier
View name
Headers
UUIDv7 for idempotent request handling
Response
No response body on success.Example
Rename View
Rename a view or move it to a different namespace.Path Parameters
Optional prefix for multi-tenant deployments
Headers
UUIDv7 for idempotent request handling
Request Body
Current view identifier
New view identifier
Response
No response body on success.Example
Moving views across namespaces is valid but not all servers support it. Check the 406 response if cross-namespace moves fail.
Register View
Register an existing view using its metadata file location.Path Parameters
Optional prefix for multi-tenant deployments
Namespace identifier
Headers
UUIDv7 for idempotent request handling
Request Body
View name to register
Location of existing view metadata file
Response
Same as Load View response.Example
Status Codes
Success
200 OK- Request successful with response body204 No Content- Request successful without response body
Client Errors
400 Bad Request- Invalid request format401 Unauthorized- Authentication required403 Forbidden- Not authorized404 Not Found- View or namespace does not exist406 Not Acceptable- Operation not supported409 Conflict- View already exists or commit requirements failed419 Authentication Timeout- Authentication expired
Server Errors
500 Internal Server Error- Commit state unknown502 Bad Gateway- Gateway error, commit state unknown503 Service Unavailable- Service temporarily unavailable504 Gateway Timeout- Timeout, commit state unknown
View Versions
Views support versioning to track changes over time:- Each update creates a new view version
- Versions contain SQL representations and metadata
- The current version determines the view’s behavior
- Version history is maintained in metadata
View Version Structure
Common Patterns
Create View with Multiple Representations
Update View Query
View References
When loading a view that references other views or tables:Best Practices
- Version management: Keep view version history manageable
- Multiple dialects: Provide SQL representations for different engines
- Schema evolution: Update schema when view output changes
- Dependencies: Track view dependencies using
referenced-by - Idempotency: Use idempotency keys for safe retries
Related
- Namespace Endpoints - Namespace management
- Table Endpoints - Table management
- View Metadata Spec - View metadata format
- REST API Overview - API overview