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

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

# Update contract description and status
contract = DataContracts.update(
    "f7a1b2c3-d4e5-6789-0abc-def123456789",
    description="Updated contract for sales orders table",
    entityStatus="Active"
)
{
  "id": "f7a1b2c3-d4e5-6789-0abc-def123456789",
  "name": "sales-orders-contract",
  "fullyQualifiedName": "sales-orders-contract",
  "description": "Updated contract for sales orders table",
  "entityStatus": "Active",
  "entity": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "type": "table",
    "name": "sales_orders",
    "fullyQualifiedName": "sample_data.ecommerce_db.shopify.sales_orders"
  },
  "version": 0.2,
  "updatedAt": 1769986400000,
  "updatedBy": "admin",
  "changeDescription": {
    "fieldsUpdated": [
      {"name": "description", "oldValue": "Data contract for the sales orders table", "newValue": "Updated contract for sales orders table"},
      {"name": "entityStatus", "oldValue": "Draft", "newValue": "Active"}
    ]
  }
}

Update a Data Contract

Update an existing data contract using a JSON Merge Patch request.

Path Parameters

id
string
required
UUID of the data contract to update.

Body

The request body should be a JSON array of patch operations following RFC 6902.
PATCH /v1/dataContracts/{id}
from metadata.sdk import configure
from metadata.sdk.entities import DataContracts

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

# Update contract description and status
contract = DataContracts.update(
    "f7a1b2c3-d4e5-6789-0abc-def123456789",
    description="Updated contract for sales orders table",
    entityStatus="Active"
)
{
  "id": "f7a1b2c3-d4e5-6789-0abc-def123456789",
  "name": "sales-orders-contract",
  "fullyQualifiedName": "sales-orders-contract",
  "description": "Updated contract for sales orders table",
  "entityStatus": "Active",
  "entity": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "type": "table",
    "name": "sales_orders",
    "fullyQualifiedName": "sample_data.ecommerce_db.shopify.sales_orders"
  },
  "version": 0.2,
  "updatedAt": 1769986400000,
  "updatedBy": "admin",
  "changeDescription": {
    "fieldsUpdated": [
      {"name": "description", "oldValue": "Data contract for the sales orders table", "newValue": "Updated contract for sales orders table"},
      {"name": "entityStatus", "oldValue": "Draft", "newValue": "Active"}
    ]
  }
}

Common Patch Operations

OperationPathDescription
replace/descriptionUpdate description
replace/entityStatusChange status (Draft, Active, Deprecated)
add/semantics/-Add a semantic rule
remove/semantics/0Remove a semantic rule by index
replace/slaUpdate SLA section
add/schema/-Add a schema column

Error Handling

CodeError TypeDescription
400BAD_REQUESTInvalid patch operations
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to update data contracts
404NOT_FOUNDData contract not found