Skip to main content

Test, Publish, Roll Back

Pin sample files, test a Spec draft on them, publish it as the version new runs use, compare two versions, roll back, and share a read-only link to the Spec document.

Samples and tests

Samples are documents you pin to a Spec to test it on. A test runs the draft on document_ids, or on the pinned samples when you send none. Tests are preview runs: they are never delivered to your destinations. A draft with unpublished changes is published first, as in the editor. A test uses credits like any run.

GET/v1/specs/{id}/samples
POST/v1/specs/{id}/samples
DELETE/v1/specs/{id}/samples/{documentId}
POST/v1/specs/{id}/test

Body

document_idsstring[]Up to 20 documents. Default: the pinned samples.
acknowledge_issuesbooleanProceed over the issues a previous attempt listed.

Publish

Publishing turns the draft into the next version, the one new runs use. Nothing is published when the draft has errors, or when it has issues that change results and that you have not acknowledged: the 422 lists them, and you retry with acknowledge_issues: true. Send expected_draft_revision to be sure you publish what you reviewed. If runs are in flight, the version is published with activation_pending: true and takes over when they finish. Publishing an unchanged draft returns the current version and mints nothing.

POST/v1/specs/{id}/publish

Versions, diff and rollback

GET/v1/specs/{id}/versions/{n}
GET/v1/specs/{id}/versions/{a}/diff/{b}
POST/v1/specs/{id}/versions/{n}/rollback

Share

A share link opens the read-only Spec document (fields, descriptions, checks) for anyone who has it, without signing in. Creating a link again replaces it and the old one stops working.

GET/v1/specs/{id}/share
POST/v1/specs/{id}/share
DELETE/v1/specs/{id}/share

Frequently asked questions

Are test runs delivered to my destinations?+
No. Tests are preview runs and are never delivered.
Does rollback delete newer versions?+
No. It publishes the old document as a new version; every earlier version stays.
Why did publish return 422 with issues?+
The draft would change results in a way you should confirm. Read the issues and retry with acknowledge_issues: true, or fix the draft first.