Data contracts
A data contract defines quality checks for a dataset in Qlik Cloud. Each check is an expectation that can be activated or deactivated. Expectations can be based on Qlik Trust Score™ dimensions, such as validity and completeness, or on data volume.
For Qlik Trust Score™ expectations, you can define an error threshold and an optional warning range. The error threshold determines when an expectation fails, while the warning range indicates when the score is approaching that threshold. For the Data volume expectation, you can define a record range that specifies the acceptable number of records in the dataset.
Use the Data contracts API to create data contracts for multiple datasets, retrieve and update expectations, activate or deactivate expectations, and delete existing contracts. You can also retrieve the latest evaluation results to check whether expectations are being met.
For more information about configuring data contracts and subscribing to notifications for expectation warnings and errors in Qlik Cloud, see Managing data contracts on Qlik Help.
Endpoints
Permanently deletes the data contract for the given dataset, along with every expectation and evaluation belonging to it. This is a hard delete: unlike deactivation, nothing is preserved and the operation cannot be undone.
Facts
| Rate limit | Tier 2 (100 requests per minute) |
Path Parameters
- datasetId stringRequired
Responses
204
The data contract, its expectations, and its evaluation history were deleted.
400
The datasetId path parameter is malformed.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
401
User does not have valid authentication credentials.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
403
User does not have access to the resource, or the feature is not available for this tenant.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
404
Dataset or data contract not found.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
500
Internal Server Error.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
502
The Catalog service could not be reached to verify the dataset.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
// qlik-api has not implemented support for `DELETE /api/data-governance/data-contracts/datasets/{datasetId}` yet.// In the meantime, you can use fetch like this:
const response = await fetch( '/api/data-governance/data-contracts/datasets/{datasetId}', { method: 'DELETE', headers: { 'Content-Type': 'application/json', }, },)# qlik-cli has not implemented support for DELETE /api/data-governance/data-contracts/datasets/{datasetId} yet.curl "https://{tenant}.{region}.qlikcloud.com/api/data-governance/data-contracts/datasets/{datasetId}" \-X DELETE \-H "Authorization: Bearer <access_token>"Returns every expectation for the dataset — the Trust Score dimension expectations and the data volume expectation — with their current activation status, configured thresholds or bounds, latest actual value, and last evaluation result. If the dataset has no data contract, the operation still returns 200 with the default, non-activated expectations. For non-activated expectations, the actual value (Trust Score) or row count (volume) is fetched live while the response is built and is omitted if it cannot be retrieved.
Facts
| Rate limit | Tier 1 (1000 requests per minute) |
Path Parameters
- datasetId stringRequired
Responses
200
Expectations retrieved successfully.
- application/json object
application/json properties
- expectations array of undefinedsRequiredOne of:
- GetTrustScoreExpectationItem object
GetTrustScoreExpectationItem properties
- name stringRequired
The name of a trust score dimension.
Can be one of: "global""validity""completeness""accuracy""diversity""discoverability""usage""timeliness"
- status stringRequired
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
- category stringRequired
The expectations category.
- updatedAt string
When the expectation was last updated. Absent for NOT_ACTIVATED items.
- activatable boolean
Whether the expectation can be activated right now. Present only for non-active items (NOT_ACTIVATED and DEACTIVATED); omitted for ACTIVATED items. For trust_score expectations it is true only when the dataset has a computed Trust Score and the dimension is available, and false otherwise (quality not computed, dimension disabled, or the Trust Score service is unreachable). Always true for data_profile expectations.
- trustScore objectRequired
trustScore properties
- warning number
- threshold number
- actualValue number
The current score for this expectation. For ACTIVATED expectations this is the score recorded by the latest evaluation. For NOT_ACTIVATED and DEACTIVATED expectations it is fetched live from the Trust Score service when the response is built, because evaluations only run while an expectation is activated. Omitted when the external service is unreachable (fail-open behavior).
- lastEvaluation object
The last evaluation result. Only present when the expectation status is ACTIVATED or DEACTIVATED.
lastEvaluation properties
- error string
- status string
The outcome of an evaluation.
PASS: the measured value meets the expectation.WARN: the measured value is in the warning range — above the threshold but below the warning level.FAIL: the measured value does not meet the expectation.ERROR: the expectation could not be evaluated (for example the source value could not be resolved).Can be one of: "PASS""WARN""FAIL""ERROR"
- trigger string
What triggered the evaluation.
PROFILE_EVENT: a new data profile was computed for the dataset.TRUST_SCORE_EVENT: a new data quality (Trust Score) result was computed for the dataset.INITIALISATION: the expectation was activated.MANUAL: an on-demand evaluation requested through the evaluate endpoint.Can be one of: "PROFILE_EVENT""TRUST_SCORE_EVENT""INITIALISATION""MANUAL"
- errorCode string
Diagnostic error code, present only when status is ERROR. Provided to help troubleshooting; the example values shown are not an exhaustive list of possible codes.
- actualValue number
The score value that was recorded at evaluation time (historical snapshot). Unlike the top-level
actualValueon GetExpectationItem which is fetched live, this value reflects the score at the moment the evaluation was performed. Omitted whenstatusisERROR(an error evaluation carries no real measurement; never reported as0). - evaluatedAt string
- expectedWarning number
The warning range that was in effect when the evaluation was performed.
- expectedThreshold number
The threshold that was in effect when the evaluation was performed.
-
- dimensionStatus string
The availability status of the trust score dimension.
Can be one of: "AVAILABLE""NOT_AVAILABLE"
-
-
- GetVolumeExpectationItem object
GetVolumeExpectationItem properties
- name stringRequired
The name of a volume expectation.
Can be one of: "volume"
- status stringRequired
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
- category stringRequired
The expectations category.
- updatedAt string
When the expectation was last updated. Absent for NOT_ACTIVATED items.
- activatable boolean
Whether the expectation can be activated right now. Present only for non-active items (NOT_ACTIVATED and DEACTIVATED); omitted for ACTIVATED items. For trust_score expectations it is true only when the dataset has a computed Trust Score and the dimension is available, and false otherwise (quality not computed, dimension disabled, or the Trust Score service is unreachable). Always true for data_profile expectations.
- dataProfile objectRequired
dataProfile properties
- max integer
Upper bound (inclusive) on the row count. Omitted when the upper bound is disabled.
- min integer
Lower bound (inclusive) on the row count. Omitted when the lower bound is disabled.
- actualRowCount integer
The current row count. For ACTIVATED expectations this is the count recorded by the latest evaluation. For NOT_ACTIVATED and DEACTIVATED expectations it is fetched live from Catalog when the response is built, because evaluations only run while an expectation is activated. Omitted when Catalog is unreachable (fail-open behavior).
- lastEvaluation object
The last volume evaluation result. Present only when the expectation status is ACTIVATED or DEACTIVATED.
lastEvaluation properties
- error string
Human-readable error detail, present only when status is ERROR. A volume evaluation is ERROR when the row count cannot be retrieved; a row count outside the configured bounds is reported as FAIL, not ERROR.
- status string
The outcome of an evaluation.
PASS: the measured value meets the expectation.WARN: the measured value is in the warning range — above the threshold but below the warning level.FAIL: the measured value does not meet the expectation.ERROR: the expectation could not be evaluated (for example the source value could not be resolved).Can be one of: "PASS""WARN""FAIL""ERROR"
- trigger string
What triggered the evaluation.
PROFILE_EVENT: a new data profile was computed for the dataset.TRUST_SCORE_EVENT: a new data quality (Trust Score) result was computed for the dataset.INITIALISATION: the expectation was activated.MANUAL: an on-demand evaluation requested through the evaluate endpoint.Can be one of: "PROFILE_EVENT""TRUST_SCORE_EVENT""INITIALISATION""MANUAL"
- errorCode string
Diagnostic error code, present only when status is ERROR. The example values shown are not an exhaustive list of possible codes.
- evaluatedAt string
- expectedMax integer
The upper bound in effect when the evaluation was performed.
- expectedMin integer
The lower bound in effect when the evaluation was performed.
- actualRowCount integer
The row count recorded at evaluation time (historical snapshot).
-
-
-
-
-
400
The datasetId path parameter is malformed.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
401
User does not have valid authentication credentials.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
403
User does not have access to the resource, or the feature is not available for this tenant.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
404
Dataset not found.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
500
Internal Server Error.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
502
The Catalog service could not be reached to verify the dataset.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
// qlik-api has not implemented support for `GET /api/data-governance/data-contracts/datasets/{datasetId}/expectations` yet.// In the meantime, you can use fetch like this:
const response = await fetch( '/api/data-governance/data-contracts/datasets/{datasetId}/expectations', { method: 'GET', headers: { 'Content-Type': 'application/json', }, },)# qlik-cli has not implemented support for GET /api/data-governance/data-contracts/datasets/{datasetId}/expectations yet.curl "https://{tenant}.{region}.qlikcloud.com/api/data-governance/data-contracts/datasets/{datasetId}/expectations" \-H "Authorization: Bearer <access_token>"Example Response
{ "expectations": [ { "name": "validity", "status": "ACTIVATED", "category": "string", "updatedAt": "2024-01-15T10:30:00Z", "activatable": true, "trustScore": { "warning": 90, "threshold": 85, "actualValue": 85.1, "lastEvaluation": { "error": "Service unreachable", "status": "PASS", "trigger": "TRUST_SCORE_EVENT", "errorCode": "DCI-001", "actualValue": 85, "evaluatedAt": "2018-03-20T09:12:28Z", "expectedWarning": 90, "expectedThreshold": 85 }, "dimensionStatus": "AVAILABLE" } } ]}Updates, activates, or deactivates the dataset's expectations in a single call. Trust Score and data volume expectations are supplied in their respective arrays, and each item is processed independently: some items may succeed while others fail, and the per-item outcome is reported in the response with HTTP 200. When the dataset has no data contract yet, activating at least one expectation creates the contract; a request that would create a contract without activating any expectation is rejected with HTTP 400. For Trust Score items, threshold and warning must be within 0-100 and warning, when set, must be strictly greater than threshold.
Facts
| Rate limit | Tier 2 (100 requests per minute) |
Path Parameters
- datasetId stringRequired
Request Body
Required- application/json object
application/json properties
- expectations objectRequired
expectations properties
- trustScore array of objects
trustScore properties
- name stringRequired
The name of the trust score dimension. One of: global, validity, completeness, accuracy, diversity, discoverability, usage, timeliness. Unknown names produce a per-item error in the response.
- status string
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
- warning number
New warning range value (0-100 inclusive). Must be strictly greater than threshold. Set to null to remove.
- threshold number
New failure threshold value (0-100 inclusive).
-
- dataProfile array of objects
dataProfile properties
- max integer
New upper bound (inclusive). Absent = unchanged, null = remove the bound, value = set.
- min integer
New lower bound (inclusive). Absent = unchanged, null = remove the bound, value = set.
- name stringRequired
The name of the volume expectation. Currently only "volume" is supported.
- status string
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
-
-
-
Responses
200
Per-item results are returned. Individual items may have succeeded or failed.
- application/json object
application/json properties
- expectations objectRequired
expectations properties
- trustScore array of objects
trustScore properties
- code string
The error code for failure (only present when updateStatus is ERROR).
- name stringRequired
The name of the expectation. For trust score items, one of: global, validity, completeness, accuracy, diversity, discoverability, usage, timeliness. May also contain the raw input name for per-item error responses.
- reason string
The reason for failure (only present when updateStatus is ERROR).
- status string
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
- warning number
The current warning range (only present when updateStatus is SUCCESS).
- category string
The expectation category (only present when updateStatus is SUCCESS).
- threshold number
The current threshold (only present when updateStatus is SUCCESS).
- updatedAt string
When the expectation was last updated (only present when updateStatus is SUCCESS).
- updateStatus stringRequired
Can be one of: "SUCCESS""ERROR"
- lastEvaluation object
The last evaluation result (only present when updateStatus is SUCCESS).
lastEvaluation properties
- error string
- status string
The outcome of an evaluation.
PASS: the measured value meets the expectation.WARN: the measured value is in the warning range — above the threshold but below the warning level.FAIL: the measured value does not meet the expectation.ERROR: the expectation could not be evaluated (for example the source value could not be resolved).Can be one of: "PASS""WARN""FAIL""ERROR"
- trigger string
What triggered the evaluation.
PROFILE_EVENT: a new data profile was computed for the dataset.TRUST_SCORE_EVENT: a new data quality (Trust Score) result was computed for the dataset.INITIALISATION: the expectation was activated.MANUAL: an on-demand evaluation requested through the evaluate endpoint.Can be one of: "PROFILE_EVENT""TRUST_SCORE_EVENT""INITIALISATION""MANUAL"
- errorCode string
Diagnostic error code, present only when status is ERROR. Provided to help troubleshooting; the example values shown are not an exhaustive list of possible codes.
- actualValue number
The score recorded at evaluation time. Omitted when
statusisERROR(an error evaluation carries no real measurement; never reported as0). - evaluatedAt string
- expectedWarning number
- expectedThreshold number
-
- dimensionStatus string
The availability status of the trust score dimension.
Can be one of: "AVAILABLE""NOT_AVAILABLE"
-
- dataProfile array of objects
dataProfile properties
- max integer
The current upper bound (only present when updateStatus is SUCCESS).
- min integer
The current lower bound (only present when updateStatus is SUCCESS).
- code string
Diagnostic error code for the failure (only present when updateStatus is ERROR). Provided to help troubleshooting; the example values shown are not an exhaustive list of possible codes.
- name stringRequired
The name of the volume expectation. Currently only "volume" is supported.
- reason string
The reason for failure (only present when updateStatus is ERROR).
- status string
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
- category string
The expectation category (only present when updateStatus is SUCCESS).
- updatedAt string
When the expectation was last updated (only present when updateStatus is SUCCESS).
- updateStatus stringRequired
Can be one of: "SUCCESS""ERROR"
- lastEvaluation object
The last volume evaluation result (only present when updateStatus is SUCCESS).
lastEvaluation properties
- error string
Human-readable error detail, present only when status is ERROR. A volume evaluation is ERROR when the row count cannot be retrieved ; a row count outside the configured bounds is reported as FAIL, not ERROR.
- status string
The outcome of an evaluation.
PASS: the measured value meets the expectation.WARN: the measured value is in the warning range — above the threshold but below the warning level.FAIL: the measured value does not meet the expectation.ERROR: the expectation could not be evaluated (for example the source value could not be resolved).Can be one of: "PASS""WARN""FAIL""ERROR"
- trigger string
What triggered the evaluation.
PROFILE_EVENT: a new data profile was computed for the dataset.TRUST_SCORE_EVENT: a new data quality (Trust Score) result was computed for the dataset.INITIALISATION: the expectation was activated.MANUAL: an on-demand evaluation requested through the evaluate endpoint.Can be one of: "PROFILE_EVENT""TRUST_SCORE_EVENT""INITIALISATION""MANUAL"
- errorCode string
Diagnostic error code, present only when status is ERROR . The example values shown are not an exhaustive list of possible codes.
- evaluatedAt string
- expectedMax integer
- expectedMin integer
- actualRowCount integer
-
-
-
-
400
Request-level validation failure.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
401
User does not have valid authentication credentials.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
403
User does not have access to the resource, or the feature is not available for this tenant.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
404
Dataset not found.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
500
Internal Server Error.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
502
The Catalog service could not be reached to verify the dataset.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
// qlik-api has not implemented support for `PATCH /api/data-governance/data-contracts/datasets/{datasetId}/expectations` yet.// In the meantime, you can use fetch like this:
const response = await fetch( '/api/data-governance/data-contracts/datasets/{datasetId}/expectations', { method: 'PATCH', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ expectations: { trustScore: [ { name: 'global', status: 'ACTIVATED', warning: 90, threshold: 85, }, ], dataProfile: [ { max: 10500, min: 9500, name: 'volume', status: 'ACTIVATED', }, ], }, }), },)# qlik-cli has not implemented support for PATCH /api/data-governance/data-contracts/datasets/{datasetId}/expectations yet.curl "https://{tenant}.{region}.qlikcloud.com/api/data-governance/data-contracts/datasets/{datasetId}/expectations" \-X PATCH \-H "Content-type: application/json" \-H "Authorization: Bearer <access_token>" \-d '{"expectations":{"trustScore":[{"name":"global","status":"ACTIVATED","warning":90,"threshold":85}],"dataProfile":[{"max":10500,"min":9500,"name":"volume","status":"ACTIVATED"}]}}'Example Response
{ "expectations": { "trustScore": [ { "code": "DCI-001", "name": "string", "reason": "Unknown trust score dimension: Foo", "status": "ACTIVATED", "warning": 90, "category": "trust_score", "threshold": 85, "updatedAt": "2026-05-13T10:00:00Z", "updateStatus": "SUCCESS", "lastEvaluation": { "error": "Service unreachable", "status": "PASS", "trigger": "TRUST_SCORE_EVENT", "errorCode": "DCI-001", "actualValue": 92, "evaluatedAt": "2026-05-13T10:00:00Z", "expectedWarning": 90, "expectedThreshold": 85 }, "dimensionStatus": "AVAILABLE" } ], "dataProfile": [ { "max": 10500, "min": 9500, "code": "DCI-008", "name": "string", "reason": "Invalid volume bounds: min must be less than or equal to max.", "status": "ACTIVATED", "category": "data_profile", "updatedAt": "2026-07-15T10:00:00Z", "updateStatus": "SUCCESS", "lastEvaluation": { "error": "string", "status": "PASS", "trigger": "TRUST_SCORE_EVENT", "errorCode": "DCI-005", "evaluatedAt": "2026-07-15T10:00:00Z", "expectedMax": 10500, "expectedMin": 9500, "actualRowCount": 10000 } } ] }}Creates a data contract for each listed dataset ID, notably to apply a contract to every dataset of a data product at once. The caller's "Compute data quality" write privilege is checked once for the whole request, before any dataset is processed: it does not depend on any single dataset, so a caller lacking it is rejected upfront with HTTP 403, rather than failing every dataset entry individually. Each dataset is then processed independently and concurrently: a failure on one dataset (no write permission on its space, dataset not found, or a contract already existing for that dataset) does not block the others. An existing contract is never overwritten. The request is capped at 100 datasets; a larger batch is rejected upfront with HTTP 400, before any contract is created.
Facts
| Rate limit | Tier 2 (100 requests per minute) |
Request Body
Required- application/json object
application/json properties
- datasets array of objectsRequired
datasets properties
- datasetId stringRequired
Identifier of the dataset the data contract must be created for.
- expectations objectRequired
expectations properties
- trustScore array of objects
trustScore properties
- name stringRequired
The name of the trust score dimension. One of: global, validity, completeness, accuracy, diversity, discoverability, usage, timeliness. Unknown names produce a per-item error in the response.
- status string
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
- warning number
New warning range value (0-100 inclusive). Must be strictly greater than threshold. Set to null to remove.
- threshold number
New failure threshold value (0-100 inclusive).
-
- dataProfile array of objects
dataProfile properties
- max integer
New upper bound (inclusive). Absent = unchanged, null = remove the bound, value = set.
- min integer
New lower bound (inclusive). Absent = unchanged, null = remove the bound, value = set.
- name stringRequired
The name of the volume expectation. Currently only "volume" is supported.
- status string
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
-
-
-
-
Responses
200
Per-dataset results are returned. Individual datasets may have succeeded or failed.
- application/json object
application/json properties
- datasets array of objectsRequired
datasets properties
- code string
Diagnostic error code for the failure (only present when updateStatus is ERROR). Provided to help troubleshooting; the example values shown are not an exhaustive list of possible codes.
- reason string
The reason for failure (only present when updateStatus is ERROR).
- datasetId stringRequired
- expectations object
Per-expectation results (only present when updateStatus is SUCCESS).
expectations properties
- trustScore array of objects
trustScore properties
- code string
The error code for failure (only present when updateStatus is ERROR).
- name stringRequired
The name of the expectation. For trust score items, one of: global, validity, completeness, accuracy, diversity, discoverability, usage, timeliness. May also contain the raw input name for per-item error responses.
- reason string
The reason for failure (only present when updateStatus is ERROR).
- status string
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
- warning number
The current warning range (only present when updateStatus is SUCCESS).
- category string
The expectation category (only present when updateStatus is SUCCESS).
- threshold number
The current threshold (only present when updateStatus is SUCCESS).
- updatedAt string
When the expectation was last updated (only present when updateStatus is SUCCESS).
- updateStatus stringRequired
Can be one of: "SUCCESS""ERROR"
- lastEvaluation object
The last evaluation result (only present when updateStatus is SUCCESS).
lastEvaluation properties
- error string
- status string
The outcome of an evaluation.
PASS: the measured value meets the expectation.WARN: the measured value is in the warning range — above the threshold but below the warning level.FAIL: the measured value does not meet the expectation.ERROR: the expectation could not be evaluated (for example the source value could not be resolved).Can be one of: "PASS""WARN""FAIL""ERROR"
- trigger string
What triggered the evaluation.
PROFILE_EVENT: a new data profile was computed for the dataset.TRUST_SCORE_EVENT: a new data quality (Trust Score) result was computed for the dataset.INITIALISATION: the expectation was activated.MANUAL: an on-demand evaluation requested through the evaluate endpoint.Can be one of: "PROFILE_EVENT""TRUST_SCORE_EVENT""INITIALISATION""MANUAL"
- errorCode string
Diagnostic error code, present only when status is ERROR. Provided to help troubleshooting; the example values shown are not an exhaustive list of possible codes.
- actualValue number
The score recorded at evaluation time. Omitted when
statusisERROR(an error evaluation carries no real measurement; never reported as0). - evaluatedAt string
- expectedWarning number
- expectedThreshold number
-
- dimensionStatus string
The availability status of the trust score dimension.
Can be one of: "AVAILABLE""NOT_AVAILABLE"
-
- dataProfile array of objects
dataProfile properties
- max integer
The current upper bound (only present when updateStatus is SUCCESS).
- min integer
The current lower bound (only present when updateStatus is SUCCESS).
- code string
Diagnostic error code for the failure (only present when updateStatus is ERROR). Provided to help troubleshooting; the example values shown are not an exhaustive list of possible codes.
- name stringRequired
The name of the volume expectation. Currently only "volume" is supported.
- reason string
The reason for failure (only present when updateStatus is ERROR).
- status string
Activation status of an expectation.
ACTIVATEDmeans the expectation is enforced,DEACTIVATEDmeans it was explicitly turned off, andNOT_ACTIVATEDmeans it has never been activated.Can be one of: "ACTIVATED""DEACTIVATED""NOT_ACTIVATED"
- category string
The expectation category (only present when updateStatus is SUCCESS).
- updatedAt string
When the expectation was last updated (only present when updateStatus is SUCCESS).
- updateStatus stringRequired
Can be one of: "SUCCESS""ERROR"
- lastEvaluation object
The last volume evaluation result (only present when updateStatus is SUCCESS).
lastEvaluation properties
- error string
Human-readable error detail, present only when status is ERROR. A volume evaluation is ERROR when the row count cannot be retrieved ; a row count outside the configured bounds is reported as FAIL, not ERROR.
- status string
The outcome of an evaluation.
PASS: the measured value meets the expectation.WARN: the measured value is in the warning range — above the threshold but below the warning level.FAIL: the measured value does not meet the expectation.ERROR: the expectation could not be evaluated (for example the source value could not be resolved).Can be one of: "PASS""WARN""FAIL""ERROR"
- trigger string
What triggered the evaluation.
PROFILE_EVENT: a new data profile was computed for the dataset.TRUST_SCORE_EVENT: a new data quality (Trust Score) result was computed for the dataset.INITIALISATION: the expectation was activated.MANUAL: an on-demand evaluation requested through the evaluate endpoint.Can be one of: "PROFILE_EVENT""TRUST_SCORE_EVENT""INITIALISATION""MANUAL"
- errorCode string
Diagnostic error code, present only when status is ERROR . The example values shown are not an exhaustive list of possible codes.
- evaluatedAt string
- expectedMax integer
- expectedMin integer
- actualRowCount integer
-
-
-
- updateStatus stringRequired
Can be one of: "SUCCESS""ERROR"
-
-
400
Request-level validation failure. No contract is created for any dataset.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
401
User does not have valid authentication credentials.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
403
The feature is not available for this tenant, or the caller lacks the "Compute data quality" privilege.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
500
Internal Server Error.
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
- meta object
Optional additional context for the error. Null when none is provided.
- title string
- detail string
- status string
-
- traceId string
Identifier of the request trace. Quote it when reporting a problem so the request can be located in the logs.
-
// qlik-api has not implemented support for `POST /api/data-governance/data-contracts/datasets/actions/create` yet.// In the meantime, you can use fetch like this:
const response = await fetch( '/api/data-governance/data-contracts/datasets/actions/create', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ datasets: [ { datasetId: '66a3aa9800358457159ecd12', expectations: { trustScore: [ { name: 'global', status: 'ACTIVATED', warning: 90, threshold: 85, }, ], dataProfile: [ { max: 10500, min: 9500, name: 'volume', status: 'ACTIVATED', }, ], }, }, ], }), },)# qlik-cli has not implemented support for POST /api/data-governance/data-contracts/datasets/actions/create yet.curl "https://{tenant}.{region}.qlikcloud.com/api/data-governance/data-contracts/datasets/actions/create" \-X POST \-H "Content-type: application/json" \-H "Authorization: Bearer <access_token>" \-d '{"datasets":[{"datasetId":"66a3aa9800358457159ecd12","expectations":{"trustScore":[{"name":"global","status":"ACTIVATED","warning":90,"threshold":85}],"dataProfile":[{"max":10500,"min":9500,"name":"volume","status":"ACTIVATED"}]}}]}'Example Response
{ "datasets": [ { "code": "DCI-013", "reason": "Data contract already exists for dataset: 66a3aa9800358457159ecd12", "datasetId": "66a3aa9800358457159ecd12", "expectations": { "trustScore": [ { "code": "DCI-001", "name": "string", "reason": "Unknown trust score dimension: Foo", "status": "ACTIVATED", "warning": 90, "category": "trust_score", "threshold": 85, "updatedAt": "2026-05-13T10:00:00Z", "updateStatus": "SUCCESS", "lastEvaluation": { "error": "Service unreachable", "status": "PASS", "trigger": "TRUST_SCORE_EVENT", "errorCode": "DCI-001", "actualValue": 92, "evaluatedAt": "2026-05-13T10:00:00Z", "expectedWarning": 90, "expectedThreshold": 85 }, "dimensionStatus": "AVAILABLE" } ], "dataProfile": [ { "max": 10500, "min": 9500, "code": "DCI-008", "name": "string", "reason": "Invalid volume bounds: min must be less than or equal to max.", "status": "ACTIVATED", "category": "data_profile", "updatedAt": "2026-07-15T10:00:00Z", "updateStatus": "SUCCESS", "lastEvaluation": { "error": "string", "status": "PASS", "trigger": "TRUST_SCORE_EVENT", "errorCode": "DCI-005", "evaluatedAt": "2026-07-15T10:00:00Z", "expectedMax": 10500, "expectedMin": 9500, "actualRowCount": 10000 } } ] }, "updateStatus": "SUCCESS" } ]}