A CI/CD pipeline promotes Validatar tests and jobs from one project to another through the Authoring API: it exports them from the source project as an XML file, then imports that file into the target project. That lets test content move from development to staging to production along with the code it checks.
This page is the API reference for that flow. For pipelines you can commit as they are, pick a guide:
- Run Validatar tests in GitHub Actions
- Run Validatar tests in Bitbucket Pipelines
- Run Validatar tests from any CI/CD tool, with notes for Jenkins, GitLab CI, CircleCI, Azure DevOps and others
To run a job after the import and fail the build when its tests do not pass, see Orchestration Integrations.
Before you start
- A user token. In Validatar, click the user icon in the top right, choose User Profile, open Tokens and select New Token. Set Type to API and give the token the Authoring scope, plus Execution if the pipeline also runs tests. User Tokens covers the other settings. Security admins can review every user's tokens under Settings > User Tokens, but each token is created from its owner's profile.
- The full API add-on. Without it, a token can carry only the Execution scope, and export and import need Authoring.
- Project permissions. The token acts as its user, so that user needs the Export permission on the source project and the Import permission on the target project.
Authentication and base URL
Every call sends the token in a custom header:
x-val-api-token: <your token>
Every endpoint lives under /core/api/v1/ on your Validatar address, followed by the scope name (Authoring, Execution, Catalog):
https://<your-instance>.cloud.validatar.com/core/api/v1/Authoring/projects
On Validatar Server, use your server's address in place of the Cloud host. The /core/api/v1/<scope>/ part is the same. A path without the scope segment, such as /core/api/v1/projects, returns HTTP 404.
The API documentation for your version is linked from the token page and lives at https://<your-instance>.cloud.validatar.com/core/home/redoc.
How a promotion runs
- Export. POST to the export endpoint of the source project with the test folders, job folders, tests or jobs to include.
- Import. POST the exported content to the import endpoint of the target project, with a mapping from source data source ids to target data source ids.
- Run (optional). Execute a job in the target project to confirm the imported tests work there.
- Report. Print the import result and any test failures in the pipeline log, and exit non-zero on failure.
Endpoints
Paths are relative to https://<your-instance>.cloud.validatar.com/core/api/v1.
| Method | Path | Scope | Use |
|---|---|---|---|
| POST | /Authoring/projects/{projectId}/export |
Authoring | Export tests and jobs from a project |
| POST | /Authoring/projects/{projectId}/import |
Authoring | Import an export file into a project |
| GET | /Authoring/projects |
Authoring | List the projects the token can see, with ids |
| GET | /Authoring/projects/{projectId} |
Authoring | A project's root test folder and root job folder ids |
| GET | /Authoring/projects/{projectId}/folders/{folderId} |
Authoring | The tests, jobs and subfolders in a folder |
| GET | /Authoring/data-sources |
Authoring | List data sources with ids and names, for the mapping |
| POST | /Execution/projects/{projectId}/jobs/{jobId}/execute |
Execution | Run a job after the import |
| GET | /Execution/projects/{projectId}/jobs/{jobId}/results/{batchKey} |
Execution | Poll that run until it finishes |
Export request
POST /core/api/v1/Authoring/projects/{projectId}/export
{
"name": "promote-2026-11-20",
"description": "Weekly promotion from dev to staging",
"testFolderIds": [101, 102],
"jobFolderIds": [201],
"testIds": [5001, 5002],
"jobIds": [3001],
"includeCustomFields": true,
"includeJobSchedules": false
}
| Field | Type | Description |
|---|---|---|
name |
string | File name for the export. Required. |
description |
string | Description of the export. Optional. |
testFolderIds |
int[] | Test folders to export, with everything in them |
jobFolderIds |
int[] | Job folders to export |
testIds |
int[] | Individual tests to export |
jobIds |
int[] | Individual jobs to export |
includeCustomFields |
bool | Include custom field values. Defaults to false; true is usually what you want. |
includeJobSchedules |
bool | Include job schedules. Defaults to false. Leave it off for CI/CD, because schedules belong to each environment. |
Tip: Exporting whole folders is easier to maintain than lists of test ids. Keep the tests you promote in their own folders and export those.
Export response
{
"fileName": "promote-2026-11-20.xml",
"mimeType": "application/xml",
"contentBase64": "PFZhbGlkYXRhckV4cG9ydD4..."
}
contentBase64 is the whole export file, base64-encoded. Pass it to the import endpoint unchanged. A failed export returns HTTP 400 with {"errors": ["..."]}.
Tip: To see what was exported, decode
contentBase64and save it as an.xmlfile. The pipeline guides show how to keep it as a build artifact.
Import request
POST /core/api/v1/Authoring/projects/{projectId}/import
{
"mimeType": "application/xml",
"contentBase64": "PFZhbGlkYXRhckV4cG9ydD4...",
"targetTestFolderId": 301,
"targetJobFolderId": 401,
"dataSourceMappings": [
{ "sourceFileKey": "42", "targetId": 87 }
],
"includeJobSchedules": false,
"conflictResolution": "Overwrite"
}
| Field | Type | Description |
|---|---|---|
mimeType |
string | "application/xml". Required. |
contentBase64 |
string | contentBase64 from the export response. Required. |
targetTestFolderId |
int | Folder that receives the tests. Optional; without it the original folder structure is kept. |
targetJobFolderId |
int | Folder that receives the jobs. Optional. |
dataSourceMappings |
array | Source data source to target data source, described below |
includeJobSchedules |
bool | Import job schedules. Defaults to true when omitted, so send false for CI/CD. |
conflictResolution |
string | What to do when a test or job already exists: Overwrite, Rename or Skip |
Data source mappings
Tests in the source project point at the source environment's data sources, which have different ids in the target. dataSourceMappings tells the import which target data source replaces each source one.
sourceFileKeyis the source data source id, as a string. The export file keys each data source by its id.targetIdis the id of the data source the target should use.
"dataSourceMappings": [
{ "sourceFileKey": "42", "targetId": 87 },
{ "sourceFileKey": "43", "targetId": 88 }
]
To build the mapping, call GET /core/api/v1/Authoring/data-sources with a token on each instance. It returns dataSources[] with id and name for every data source that token's user can see. Match them by name, then write the id pairs. Run Validatar tests from any CI/CD tool has a script that prints both lists.
Conflict resolution
| Option | Behavior |
|---|---|
Overwrite |
Replaces the existing test or job with the imported one. The usual choice for CI/CD, because the same import can run on every merge. |
Rename |
Imports under a modified name so both copies exist |
Skip |
Leaves the existing test or job alone |
Import response
A successful import returns HTTP 200 with no body.
A failed import returns HTTP 400. Each list in the body names one kind of problem; most are empty:
{
"validationErrors": [],
"invalidDataSources": [
{ "sourceName": "<data source name in the file>", "targetName": "<target data source name>" }
],
"invalidMacros": [],
"missingReferences": [],
"missingProfileDefs": [],
"missingMetaObjects": [],
"missingCustomFields": [],
"commitErrors": []
}
| List | What it means |
|---|---|
validationErrors |
The file could not be read or validated |
invalidDataSources |
A data source in the file could not be mapped to a target data source |
invalidMacros |
A test uses a macro the target cannot resolve |
missingReferences |
A job step points at a test, job, folder or profile set that is not in the file or the target |
missingProfileDefs |
A profile definition a job needs is missing in the target |
missingMetaObjects |
A test is linked to a schema, table or column that the target data source's catalog does not have |
missingCustomFields |
A custom field in the file does not exist in the target |
commitErrors |
The import failed while saving |
Finding IDs
Project, folder, test and job ids are in the Validatar URL when you open the item:
https://<your-instance>.cloud.validatar.com/projects/43/folders/1408/tests/57878
https://<your-instance>.cloud.validatar.com/projects/43/folders/2/jobs/165
The first number after projects is the project id, the number after folders is the folder id, and the last number is the test or job id.
Through the API:
| Call | Returns |
|---|---|
GET /core/api/v1/Authoring/projects |
projects[] with id and name |
GET /core/api/v1/Authoring/projects/{projectId} |
rootTestFolderId and rootJobFolderId |
GET /core/api/v1/Authoring/projects/{projectId}/folders/{folderId} |
tests[], jobs[] and folders[], each with id and name |
GET /core/api/v1/Authoring/data-sources |
dataSources[] with id, name and connection details |