Validation
How to validate your content
First, start a content validation to get a validation task. The validation task identifies the validation that you started and you'll use the task to check the progress of your validation. The validation task lets you know whether the validation completed successfully and if there were any issues with content in the specified environment.Validation task
Validation task represents an asynchronous job.
idrequired · string · uuid
The validation task's internal ID.
statusrequired · string
The validation status lets you know how the validation is going.
validation_resultrequired · string
The validation result lets you know if your content is fine or contains issues. If issues are found, you can list the validation results by providing the validation task's
id.JSON
{
"id": "12cf6682-3960-4cfc-851b-e765716e463a",
"status": "finished",
"validation_result": "no_issues"
}validation_result set to issues_found, your next step is to list the validation issues. This way you can check for errors and mistakes in your content and fix them.Start content validation
Start validating the specified environment's content to check for issues such as:
The endpoint requires either a Management API key with the Read content permission or a Personal API key.
- Missing objects that are referenced in content items.
- Content element values that don't meet the limitations configured in content types.
- Content types that reference missing taxonomy groups.
POST
https://manage.kontent.ai/v2/projects/{environment_id}/validate-asyncRequest
Path parameters
environment_idrequired · string
Identifies your environment.
Request samples
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.startEnvironmentValidation()
.byTaskId('15c68e60-dc30-4d34-a921-396563abd08d')
.toPromise();
Response
Status (202)
A content validation task.
idrequired · string · uuid
The validation task's internal ID.
statusrequired · string
The validation status lets you know how the validation is going.
validation_resultrequired · string
The validation result lets you know if your content is fine or contains issues. If issues are found, you can list the validation results by providing the validation task's
id.Example responses
202
{
"id": "12cf6682-3960-4cfc-851b-e765716e463a",
"status": "queued",
"validation_result": "none"
}Check content validation progress
Retrieves information about a content validation task by the task's internal ID.
The endpoint requires either a Management API key with the Read content permission or a Personal API key.
GET
https://manage.kontent.ai/v2/projects/{environment_id}/validate-async/tasks/{task_id}Request
Path parameters
environment_idrequired · string
Identifies your environment.
task_idrequired · string
The validation task's internal ID.
Request samples
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.checkEnvironmentValidation()
.byTaskId('15c68e60-dc30-4d34-a921-396563abd08d')
.toPromise();
Response
Status (200)
The specified content validation task. The content validation task is available for 7 days from the time of creation.
idrequired · string · uuid
The validation task's internal ID.
statusrequired · string
The validation status lets you know how the validation is going.
validation_resultrequired · string
The validation result lets you know if your content is fine or contains issues. If issues are found, you can list the validation results by providing the validation task's
id.Example responses
200
404
{
"id": "12cf6682-3960-4cfc-851b-e765716e463a",
"status": "finished",
"validation_result": "no_issues"
}List content validation results
Retrieves a dynamically paginated list of content validation issues.
The endpoint requires either a Management API key with the Read content permission or a Personal API key.
GET
https://manage.kontent.ai/v2/projects/{environment_id}/validate-async/tasks/{task_id}/issuesRequest
Path parameters
environment_idrequired · string
Identifies your environment.
task_idrequired · string
The validation task's internal ID.
Header parameters
x-continuationstring
Determines the page of results to retrieve.To get the next page of results, check the pagination object in the API response and set the
x-continuation header parameter to the value of the continuation_token property.Request samples
TypeScript
C#
cURL
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.listEnvironmentValidationIssues()
.byTaskId('15c68e60-dc30-4d34-a921-396563abd08d')
.toPromise();
Response
Status (200)
A dynamically paginated list of content validation issues.
issues[]array
List of content validation issues.
Any of:
VariantIssue
TypeIssue
VariantIssue
issue_typerequired · string
itemrequired · object
Information about the given object.
Show child attributes
languagerequired · object
Information about the given object.
Show child attributes
issues[]required · array
Information about issues found in specific content elements.
Show child attributes
paginationobject
Information about the next page of results.
Show child attributes
Example responses
200
400
404
{
"issues": [],
"pagination": {
"continuation_token": "W3sidG9rZW4iOiIrUklEOn...",
"next_page": "https://manage.kontent.ai/v2/your/chosen/list/endpoint"
}
}Validate content
Deprecated
Checks content items in the specified environment for issues such as:
Deprecation noticeThis endpoint works reliably only for environments that contain under 25,000 content items. Use the new project validation approach to validate environments of any size.
The endpoint requires either a Management API key with the Read content permission or a Personal API key.
- Content elements that reference missing objects.
- Content elements that don't meet the limitations configured in content types.
- Content types that reference missing taxonomy groups.
POST
https://manage.kontent.ai/v2/projects/{environment_id}/validateRequest
Path parameters
environment_idrequired · string
Identifies your environment.
Request samples
C#
cURL
// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net
using Kontent.Ai.Management;
var client = new ManagementClient(new ManagementOptions
{
ApiKey = "KONTENT_AI_MANAGEMENT_API_KEY",
EnvironmentId = "KONTENT_AI_ENVIRONMENT_ID"
});
var response = await client.ValidateProjectAsync();
Response
Status (200)
A report summarizing the issues found in the specified environment.
projectrequired · object
Show child attributes
variant_issues[]required · array
Report of the problems found in the project's content.
Show child attributes
type_issues[]required · array
Report of the problems found in the project's content types.
Show child attributes
Example responses
200
{
"project": {
"id": "8d20758c-d74c-4f59-ae04-ee928c0816b7",
"name": "Sample project",
"environment": "Production",
"is_production": true
},
"variant_issues": {
"item": {
"id": "string",
"name": "string",
"codename": "string"
},
"language": {
"id": "string",
"name": "string",
"codename": "string"
},
"issues": {
"element": {
"id": "string",
"name": "string",
"codename": "string"
},
"messages": []
}
},
"type_issues": {
"type": {
"id": "string",
"name": "string",
"codename": "string"
},
"issues": {
"element": {
"id": "string",
"name": "string",
"codename": "string"
},
"messages": []
}
}
}