Skip to main content
PATCH
https://sandbox.getcollate.io/api
/
v1
/
databases
/
{id}
PATCH /v1/databases/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Databases

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

# Retrieve, modify, and update
database = Databases.retrieve("550e8400-e29b-41d4-a716-446655440000")
database.description = "Updated analytics data warehouse"
database.retentionPeriod = "P730D"
updated = Databases.update(database)

print(f"Updated to version {updated.version}")
{
  "id": "1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
  "name": "default",
  "fullyQualifiedName": "mysql_sample.default",
  "description": "Updated default MySQL database",
  "tags": [],
  "version": 0.2,
  "updatedAt": 1769982700000,
  "updatedBy": "admin",
  "href": "http://localhost:8585/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
  "owners": [],
  "service": {
    "id": "4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3",
    "type": "databaseService",
    "name": "mysql_sample",
    "fullyQualifiedName": "mysql_sample",
    "displayName": "mysql_sample",
    "deleted": false,
    "href": "http://localhost:8585/api/v1/services/databaseServices/4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3"
  },
  "serviceType": "Mysql",
  "retentionPeriod": "P730D",
  "default": false,
  "deleted": false,
  "domains": [],
  "entityStatus": "Unprocessed"
}

Update a Database

Update a database’s properties using JSON Merge Patch. You can update by ID or by fully qualified name.

Update by ID

id
string
required
UUID of the database to update.

Update by Name

Use PATCH /v1/databases/name/{fqn} to update by fully qualified name.
fqn
string
required
Fully qualified name of the database (e.g., snowflake_prod.analytics).

Body Parameters

Send a JSON object with the fields to update. Only provided fields are changed.
description
string
Updated description in Markdown format.
displayName
string
Updated display name.
owners
array
Updated list of owner references.
tags
array
Updated classification tags.
retentionPeriod
string
Updated retention period in ISO 8601 duration format.
domain
string
Updated domain FQN.
extension
object
Updated custom property values.
PATCH /v1/databases/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Databases

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

# Retrieve, modify, and update
database = Databases.retrieve("550e8400-e29b-41d4-a716-446655440000")
database.description = "Updated analytics data warehouse"
database.retentionPeriod = "P730D"
updated = Databases.update(database)

print(f"Updated to version {updated.version}")
{
  "id": "1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
  "name": "default",
  "fullyQualifiedName": "mysql_sample.default",
  "description": "Updated default MySQL database",
  "tags": [],
  "version": 0.2,
  "updatedAt": 1769982700000,
  "updatedBy": "admin",
  "href": "http://localhost:8585/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
  "owners": [],
  "service": {
    "id": "4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3",
    "type": "databaseService",
    "name": "mysql_sample",
    "fullyQualifiedName": "mysql_sample",
    "displayName": "mysql_sample",
    "deleted": false,
    "href": "http://localhost:8585/api/v1/services/databaseServices/4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3"
  },
  "serviceType": "Mysql",
  "retentionPeriod": "P730D",
  "default": false,
  "deleted": false,
  "domains": [],
  "entityStatus": "Unprocessed"
}

Returns

Returns the updated database object with the new version number.

Response

id
string
Unique identifier for the database (UUID format).
name
string
Database name.
fullyQualifiedName
string
Fully qualified name in format service.database.
description
string
Updated description.
version
number
Incremented version number.

Error Handling

CodeError TypeDescription
400BAD_REQUESTInvalid JSON patch or malformed request
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to update this database
404NOT_FOUNDDatabase with given ID or FQN does not exist
409CONFLICTConcurrent modification detected