Spectacles API (1.0.0)
Download OpenAPI specification:Download
Learn to use Spectacles' REST API. Click an endpoint, like /runs
, to see its full URL, e.g., https://app.spectacles.dev/api/v1/runs
.
Get a run
Retrieve the details for a given run, including:
- The current status (queued, running, success, etc.)
- The result of each validator (if available)
- Metadata about the run
You can easily find the organisation, project, and run IDs in the URL of the run details page within the Spectacles app.
Authorizations:
path Parameters
orgId required | string The ID of the organisation the run belongs to. Find this in the URL of the run after |
projectId required | string The ID of the project the run belongs to. Find this in the URL of the run after |
runId required | string The ID of the run to get. Find this in the URL of the run after |
Responses
Response samples
- 200
- 401
- 403
- 404
- 500
{- "org_id": "string",
- "project_id": "string",
- "run_id": "string",
- "suite_id": "string",
- "suite_name": "string",
- "url": "string",
- "result": [
- {
- "status": null,
- "validator": null
}
], - "ref": {
- "type": null,
- "value": null
}, - "created_at": "string",
- "started_at": "string",
- "finished_at": "string",
- "status": "string",
- "trigger": "string",
- "user_attributes": { }
}
Create a new run
Create a run belonging to a given organisation, project, and suite. Return the ID of the newly created run as well as its status at time of creation.
To create a run against production, omit branch
and commit
from your request.
You can easily find the organisation, project, and suite IDs in the URL of the suite page within the Spectacles app.
Authorizations:
Request Body schema: application/json
org_id required | string The ID of the organisation to create the run in. Find this in the URL of the Suite after |
project_id required | string The ID of the project to create the run in. Find this in the URL of the Suite after |
suite_id required | string The ID of the suite to use. Find this in the URL of the Suite after |
branch | string The branch to test. Omit to test production. |
target | string For incremental runs only. The branch or commit to compare against for incremental validation. When |
commit | string The commit to test. Omit to test production. |
user_attributes | object To set user attributes for your run, specify them here as key/value pairs. These user attributes must first be configured up in your Spectacles settings. |
Array of any Send a webhook when the run completes. The behavior of the webhook depends on the type specified. Specify a |
Responses
Request samples
- Payload
{- "org_id": "XstGk40FKAhElMNPMiZ9",
- "project_id": "KFmxNOfdWj0A60A6zqE6",
- "suite_id": "cMHbCPeWokwVhgqAh9AZ",
- "commit": "ea23ba",
- "target": "develop",
- "user_attributes": {
- "dbt_project": "spectacles",
- "dbt_dataset": "analytics"
}, - "webhooks": [
- {
- "type": "github",
- "commit": "abc123",
- "repo": "spectacles-ci/spectaces-dbt"
}
]
}
Response samples
- 200
- 401
- 403
- 404
- 500
{- "run_id": "string",
- "status": "string"
}