> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Database Schema

> Update database schema properties using JSON Patch

# Update a Database Schema

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

## Update by ID

<ParamField path="id" type="string" required>
  UUID of the database schema to update.
</ParamField>

## Update by Name

Use `PATCH /v1/databaseSchemas/name/{fqn}` to update by fully qualified name.

<ParamField path="fqn" type="string" required>
  Fully qualified name of the schema (e.g., `snowflake_prod.analytics.public`).
</ParamField>

## Body Parameters

Send a JSON object with the fields to update. Only provided fields are changed.

<ParamField body="description" type="string">
  Updated description in Markdown format.
</ParamField>

<ParamField body="displayName" type="string">
  Updated display name.
</ParamField>

<ParamField body="owners" type="array">
  Updated list of owner references.

  <Expandable title="properties">
    <ParamField body="id" type="string">
      UUID of the owner entity.
    </ParamField>

    <ParamField body="type" type="string">
      Type of owner entity (e.g., `user`, `team`).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="tags" type="array">
  Updated classification tags.

  <Expandable title="properties">
    <ParamField body="tagFQN" type="string" required>
      Fully qualified name of the tag.
    </ParamField>

    <ParamField body="labelType" type="string">
      Type of label (e.g., `Manual`, `Derived`, `Propagated`).
    </ParamField>

    <ParamField body="state" type="string">
      State of the tag (e.g., `Suggested`, `Confirmed`).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="retentionPeriod" type="string">
  Updated retention period in ISO 8601 duration format.
</ParamField>

<ParamField body="domain" type="string">
  Updated domain FQN.
</ParamField>

<ParamField body="extension" type="object">
  Updated custom property values.
</ParamField>

<RequestExample dropdown>
  ```python PATCH /v1/databaseSchemas/{id} theme={null}
  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}")
  ```

  ```java PATCH /v1/databaseSchemas/{id} theme={null}
  import static org.openmetadata.sdk.fluent.DatabaseSchemas.*;

  // Retrieve, modify, and update
  DatabaseSchema schema = DatabaseSchemas.retrieve("770e8400-e29b-41d4-a716-446655440000");
  schema.setDescription("Updated public schema for analytics");
  DatabaseSchema updated = DatabaseSchemas.update(schema);
  ```

  ```bash PATCH /v1/databaseSchemas/{id} theme={null}
  # 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"}
    ]'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "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"
  }
  ```
</ResponseExample>

***

## Returns

Returns the updated database schema object with the new version number.

## Response

<ResponseField name="id" type="string">
  Unique identifier for the schema (UUID format).
</ResponseField>

<ResponseField name="name" type="string">
  Schema name.
</ResponseField>

<ResponseField name="fullyQualifiedName" type="string">
  Fully qualified name in format `service.database.schema`.
</ResponseField>

<ResponseField name="description" type="string">
  Updated description.
</ResponseField>

<ResponseField name="version" type="number">
  Incremented version number.
</ResponseField>

***

## Error Handling

| Code  | Error Type     | Description                                 |
| ----- | -------------- | ------------------------------------------- |
| `400` | `BAD_REQUEST`  | Invalid JSON patch or malformed request     |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token     |
| `403` | `FORBIDDEN`    | User lacks permission to update this schema |
| `404` | `NOT_FOUND`    | Schema with given ID or FQN does not exist  |
| `409` | `CONFLICT`     | Concurrent modification detected            |
