PUT /v1/databaseSchemas
curl -X PUT "{base_url}/api/v1/databaseSchemas" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "information_schema",
"database": "Glue.default",
"description": "This **mock** database contains tables related to the Glue service"
}'
from metadata.sdk import configure
from metadata.sdk.entities import DatabaseSchemas
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Retrieve, modify, and update
schema = DatabaseSchemas.retrieve("770e8400-e29b-41d4-a716-446655440000")
schema.description = "Updated public schema for analytics"
schema.retentionPeriod = "P730D"
updated = DatabaseSchemas.update(schema)
print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.data.DatabaseSchema;
// client is an initialized OpenMetadataClient.
// Retrieve, modify, and update
DatabaseSchema schema = client.databaseSchemas().get("770e8400-e29b-41d4-a716-446655440000");
schema.setDescription("Updated public schema for analytics");
DatabaseSchema updated = client.databaseSchemas().update("770e8400-e29b-41d4-a716-446655440000", schema);
# Update by ID
curl -X PATCH "{base_url}/api/v1/databaseSchemas/f681432b-e66c-4096-a1cd-7771358c5323" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated schema for Glue service tables"}
]'
# Update by name
curl -X PATCH "{base_url}/api/v1/databaseSchemas/name/Glue.default.information_schema" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated schema for Glue service tables"}
]'
{
"id": "f681432b-e66c-4096-a1cd-7771358c5323",
"name": "information_schema",
"fullyQualifiedName": "Glue.default.information_schema",
"description": "Updated schema for Glue service tables",
"version": 0.2,
"updatedAt": 1769982700000,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/databaseSchemas/f681432b-e66c-4096-a1cd-7771358c5323",
"owners": [],
"service": {
"id": "0fab117a-4c58-4ebb-9d42-beab0768fa8e",
"type": "databaseService",
"name": "Glue",
"fullyQualifiedName": "Glue",
"displayName": "Glue",
"deleted": false,
"href": "http://localhost:8585/api/v1/services/databaseServices/0fab117a-4c58-4ebb-9d42-beab0768fa8e"
},
"serviceType": "Glue",
"database": {
"id": "9655ba5b-b8d7-419c-98f4-16b976692ad8",
"type": "database",
"name": "default",
"fullyQualifiedName": "Glue.default",
"displayName": "default",
"deleted": false,
"href": "http://localhost:8585/api/v1/databases/9655ba5b-b8d7-419c-98f4-16b976692ad8"
},
"tags": [],
"deleted": false,
"sourceUrl": "https://www.glue.com/information_schema",
"domains": [],
"entityStatus": "Unprocessed"
}
Update a Database Schema
Create or update a database schema with a full request body
PUT
/
v1
/
databaseSchemas
PUT /v1/databaseSchemas
curl -X PUT "{base_url}/api/v1/databaseSchemas" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "information_schema",
"database": "Glue.default",
"description": "This **mock** database contains tables related to the Glue service"
}'
from metadata.sdk import configure
from metadata.sdk.entities import DatabaseSchemas
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Retrieve, modify, and update
schema = DatabaseSchemas.retrieve("770e8400-e29b-41d4-a716-446655440000")
schema.description = "Updated public schema for analytics"
schema.retentionPeriod = "P730D"
updated = DatabaseSchemas.update(schema)
print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.data.DatabaseSchema;
// client is an initialized OpenMetadataClient.
// Retrieve, modify, and update
DatabaseSchema schema = client.databaseSchemas().get("770e8400-e29b-41d4-a716-446655440000");
schema.setDescription("Updated public schema for analytics");
DatabaseSchema updated = client.databaseSchemas().update("770e8400-e29b-41d4-a716-446655440000", schema);
# Update by ID
curl -X PATCH "{base_url}/api/v1/databaseSchemas/f681432b-e66c-4096-a1cd-7771358c5323" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated schema for Glue service tables"}
]'
# Update by name
curl -X PATCH "{base_url}/api/v1/databaseSchemas/name/Glue.default.information_schema" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated schema for Glue service tables"}
]'
{
"id": "f681432b-e66c-4096-a1cd-7771358c5323",
"name": "information_schema",
"fullyQualifiedName": "Glue.default.information_schema",
"description": "Updated schema for Glue service tables",
"version": 0.2,
"updatedAt": 1769982700000,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/databaseSchemas/f681432b-e66c-4096-a1cd-7771358c5323",
"owners": [],
"service": {
"id": "0fab117a-4c58-4ebb-9d42-beab0768fa8e",
"type": "databaseService",
"name": "Glue",
"fullyQualifiedName": "Glue",
"displayName": "Glue",
"deleted": false,
"href": "http://localhost:8585/api/v1/services/databaseServices/0fab117a-4c58-4ebb-9d42-beab0768fa8e"
},
"serviceType": "Glue",
"database": {
"id": "9655ba5b-b8d7-419c-98f4-16b976692ad8",
"type": "database",
"name": "default",
"fullyQualifiedName": "Glue.default",
"displayName": "default",
"deleted": false,
"href": "http://localhost:8585/api/v1/databases/9655ba5b-b8d7-419c-98f4-16b976692ad8"
},
"tags": [],
"deleted": false,
"sourceUrl": "https://www.glue.com/information_schema",
"domains": [],
"entityStatus": "Unprocessed"
}
Update a Database Schema
Create a database schema or update it if it already exists, usingPUT /v1/databaseSchemas with the full request body. Send the complete definition, not just the fields you want to change. To change only some fields, use PATCH with a JSON Patch array and the application/json-patch+json content type, as shown in the PATCH examples below.
Body Parameters
string
required
Name of the database schema. Must be unique within the parent database.
string
required
Fully qualified name of the parent Database.
string
Human-readable display name for the schema.
string
Description of the schema in Markdown format.
string
Data retention period in ISO 8601 duration format, for example
P365D.array
array
Fully qualified names of the domains to assign for governance purposes.
array
object
Custom property values defined by your organization’s metadata schema.
PUT /v1/databaseSchemas
curl -X PUT "{base_url}/api/v1/databaseSchemas" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "information_schema",
"database": "Glue.default",
"description": "This **mock** database contains tables related to the Glue service"
}'
from metadata.sdk import configure
from metadata.sdk.entities import DatabaseSchemas
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Retrieve, modify, and update
schema = DatabaseSchemas.retrieve("770e8400-e29b-41d4-a716-446655440000")
schema.description = "Updated public schema for analytics"
schema.retentionPeriod = "P730D"
updated = DatabaseSchemas.update(schema)
print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.data.DatabaseSchema;
// client is an initialized OpenMetadataClient.
// Retrieve, modify, and update
DatabaseSchema schema = client.databaseSchemas().get("770e8400-e29b-41d4-a716-446655440000");
schema.setDescription("Updated public schema for analytics");
DatabaseSchema updated = client.databaseSchemas().update("770e8400-e29b-41d4-a716-446655440000", schema);
# Update by ID
curl -X PATCH "{base_url}/api/v1/databaseSchemas/f681432b-e66c-4096-a1cd-7771358c5323" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated schema for Glue service tables"}
]'
# Update by name
curl -X PATCH "{base_url}/api/v1/databaseSchemas/name/Glue.default.information_schema" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated schema for Glue service tables"}
]'
{
"id": "f681432b-e66c-4096-a1cd-7771358c5323",
"name": "information_schema",
"fullyQualifiedName": "Glue.default.information_schema",
"description": "Updated schema for Glue service tables",
"version": 0.2,
"updatedAt": 1769982700000,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/databaseSchemas/f681432b-e66c-4096-a1cd-7771358c5323",
"owners": [],
"service": {
"id": "0fab117a-4c58-4ebb-9d42-beab0768fa8e",
"type": "databaseService",
"name": "Glue",
"fullyQualifiedName": "Glue",
"displayName": "Glue",
"deleted": false,
"href": "http://localhost:8585/api/v1/services/databaseServices/0fab117a-4c58-4ebb-9d42-beab0768fa8e"
},
"serviceType": "Glue",
"database": {
"id": "9655ba5b-b8d7-419c-98f4-16b976692ad8",
"type": "database",
"name": "default",
"fullyQualifiedName": "Glue.default",
"displayName": "default",
"deleted": false,
"href": "http://localhost:8585/api/v1/databases/9655ba5b-b8d7-419c-98f4-16b976692ad8"
},
"tags": [],
"deleted": false,
"sourceUrl": "https://www.glue.com/information_schema",
"domains": [],
"entityStatus": "Unprocessed"
}
Returns
Returns the updated database schema object with the new version number.Response
string
Unique identifier for the schema (UUID format).
string
Schema name.
string
Fully qualified name in format
service.database.schema.string
Updated description.
number
Incremented version number.
Error Handling
| Code | Error Type | Description |
|---|---|---|
400 | BAD_REQUEST | Invalid or malformed request body |
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to update this schema |
409 | CONFLICT | Concurrent modification detected |
Was this page helpful?