0

Get validation results

by
Published Oct 17, 2025

Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase. The validation result [schema](https://docs.codat.io/platform-api#/schemas/ValidationResult) contains two message arrays: - **`warnings`** array lists potential issues with the data type that may require attention but don't block usage. - **`errors`** array contains critical issues that must be resolved before the data type can be used.

Script codat Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Codat = {
3
	encodedKey: string
4
}
5
/**
6
 * Get validation results
7
 * Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase.
8

9
The validation result [schema](https://docs.codat.io/platform-api#/schemas/ValidationResult) contains two message arrays:
10

11
- **`warnings`** array lists potential issues with the data type that may require attention but don't block usage.
12
- **`errors`** array contains critical issues that must be resolved before the data type can be used.
13
 */
14
export async function main(auth: Codat, companyId: string, datasetId: string) {
15
	const url = new URL(`https://api.codat.io/companies/${companyId}/sync/${datasetId}/validation`)
16

17
	const response = await fetch(url, {
18
		method: 'GET',
19
		headers: {
20
			Authorization: `Basic ${auth.encodedKey}`
21
		},
22
		body: undefined
23
	})
24
	if (!response.ok) {
25
		const text = await response.text()
26
		throw new Error(`${response.status} ${text}`)
27
	}
28
	return await response.json()
29
}
30