Skip to main content
POST
/
api
/
orchestration
/
tests
/
run
curl --request POST \
  --url https://app.prophecy.io/api/orchestration/tests/run \
  --header 'Content-Type: application/json' \
  --header 'X-AUTH-TOKEN: <x-auth-token>' \
  --data '
{
  "fabricId": 4251,
  "projectId": "2419",
  "tests": [
    {
      "source": "hospital_patients",
      "table": "patient_details",
      "columnTests": [
        {
          "name": "age",
          "tests": [
            {
              "name": "not_null"
            }
          ]
        },
        {
          "name": "id",
          "tests": [
            {
              "name": "not_null"
            },
            {
              "name": "unique"
            }
          ]
        }
      ],
      "tableTests": [
        {
          "name": "equal_row_count"
        }
      ]
    },
    {
      "projectTests": [
        {
          "name": "assert_table_not_empty"
        }
      ]
    }
  ]
}
'
{
"success": true,
"data": {
"results": [
{
"name": "equal_row_count",
"status": "FAILED",
"table": "patient_details",
"columnName": "",
"index": 0,
"time": 3.55,
"cause": "14:21:36 Failure in test source_tbt_test_tanmay_piyush_test_dbt_test_1_ (prophecy-sources/sources.yml)\n14:21:36 Got 1 result, configured to fail if != 0\n14:21:36"
},
{
"name": "unique",
"status": "SUCCEEDED",
"table": "patient_details",
"columnName": "id",
"index": 0,
"time": 0.81,
"cause": ""
},
{
"name": "not_null",
"status": "SUCCEEDED",
"table": "patient_details",
"columnName": "age",
"index": 0,
"time": 4.14,
"cause": ""
},
{
"name": "not_null",
"status": "SUCCEEDED",
"table": "patient_details",
"columnName": "id",
"index": 0,
"time": 0.64,
"cause": ""
},
{
"name": "assert_table_not_empty",
"status": "SUCCEEDED",
"table": "",
"columnName": "",
"index": 0,
"time": 0.69,
"cause": ""
}
],
"dbtStdout": "<long-output-from-dbt-test-execution>",
"summary": {
"failed": 1,
"skip": 0,
"succeeded": 4,
"total": 5,
"warning": 0
}
}
}
Use this endpoint to run data tests. Column tests, table tests, and project tests can be run together in a single API call. Model tests must be run in a separate API call and cannot be mixed with other test types.

Requirements

To run data tests for a project using the API, you need to:
  • Publish the project to a Prophecy fabric.
  • Set up data tests in the Prophecy Studio. This includes both creating tests and assigning them to tables or models.
  • Ensure that any tables you want to test have data. You’ll have to run your pipelines once to populate target tables.

Headers

X-AUTH-TOKEN
string
required

Prophecy orchestration authentication token

Body

application/json
fabricId
integer<int64>
required

Unique identifier of the data fabric where the project resides. You can find the ID in the URL of the fabric metadata page.

projectId
string
required

Unique identifier of the project. You can find this string in the URL of the project editor or metadata page.

branch
string

Specific branch of the project to use. If omitted, the API uses the current working branch — typically the dev branch for projects using the Simple Git Storage Model.

version
string

Specific version of the project. If omitted, the API uses the latest published version of the project.

tests
object[]

Array of test configurations. Can include column tests, table tests, and project tests together. Model tests cannot be included here.

Response

200 - application/json

Test execution completed

success
boolean
required

Indicates whether the API request was successful.

data
object
required