Publish verification results
When a provider build verifies a pact, its Pact verifier can publish the outcome to Apiome: did this provider version honour this pact? Apiome keeps every result, and can-i-deploy answers from them. The Pact verifiers publish to Apiome unchanged.
A successful result takes the pact out of the pending state for that provider branch (see Pending and work-in-progress pacts). To read the results in the app, with each mismatch's expected and actual values, open the provider's Verification page.
Before you start
- The provider build fetches its pacts with selectors from Apiome.
- Its token is an API key from a member who holds Pacts → Create. The built-in Editor role does. Create one on API keys.
Publish from CI
Turn publishing on in the verifier and give it the provider version and branch. With pact-js:
await new Verifier({
provider: 'Ledger API',
providerBaseUrl: 'http://localhost:8080',
pactBrokerUrl: 'https://api.apiome.dev/v1/tenants/acme/pact-broker',
pactBrokerToken: process.env.APIOME_API_KEY,
consumerVersionSelectors: [{ mainBranch: true }, { matchingBranch: true }],
publishVerificationResult: true,
providerVersion: process.env.GIT_COMMIT,
providerVersionBranch: process.env.GIT_BRANCH,
buildUrl: process.env.CI_BUILD_URL,
}).verifyProvider();
Publish only from CI. A result says "this provider version honours this pact", so publish it from the build that produced the version, not from a laptop. Use the commit SHA as the provider version.
For each pact it verified, the verifier then:
- Records the provider's branch on the provider version, through the provider's
pb:branch-versionlink (PUT …/pacticipants/ledger-api/branches/main/versions/4f1e2d0). Provider tags, if you give any, go throughpb:version-tagthe same way. - Posts the result to the pact's
pb:publish-verification-resultslink.
Apiome registers the provider version if it does not have it yet.
What a result holds
| Field | What it is |
|---|---|
success | true when every interaction passed. Required. |
providerApplicationVersion | The provider version that verified. Required. |
buildUrl | The CI build that ran the verification. |
testResults | One entry per interaction, as the verifier sent it. A failed result keeps every mismatch. The Ruby verifier in the pact-cli image sends an object instead ({"tests": [...], "summary": ...}); Apiome keeps its tests list. |
verifiedBy | The verifier and the library around it (Pact-Rust 1.2.0 in pact-js 13). |
providerVersionBranch | Shown in the answer: the branch the provider version was recorded on last — the one the verifier recorded just before publishing. |
kind | Shown in the answer: native for a result a verifier published, bidirectional for one Apiome wrote by comparing the pact with a provider contract. A verifier cannot set it. |
Apiome also records how each result came to be: published for a result a verifier posted, hosted,
manual (a re-run) or stale-recheck for one its hosted verifier ran, with
the run's duration and evidence run, and bidirectional for a comparison. The Pact Broker answer does
not change; the Verification page and its REST endpoints show them.
- A result never changes. Publishing again adds a new result; it does not replace one.
- Bi-directional results are numbered with yours. When the provider also publishes a provider contract, Apiome's comparisons take numbers in the same sequence, and the latest result of either kind decides can-i-deploy.
- Results are numbered per pact version: 1, 2, 3 … The answer is
201with the result's URL inLocation. - The pending state is kept. When the pact was fetched with selectors, the result records whether the pact was pending at that moment, and whether it was a work-in-progress pact (always pending).
Link an Apiome provider verification report
If the provider was also checked by Apiome's own provider verification (a conformance report), link the report instead of copying it. Add its id to the body:
{
"success": true,
"providerApplicationVersion": "4f1e2d0",
"providerVerificationReportId": "6a0f…"
}
The answer then carries a pb:provider-verification-report link to the report. The report must
belong to the same workspace; otherwise the result is refused with
422 pact-verification-report-not-found. Deleting the report later keeps the result and removes the
link. Pact verifiers do not send this field.
Publish with curl
curl -X POST \
"https://api.apiome.dev/v1/tenants/acme/pact-broker/pacts/provider/ledger-api/consumer/billing-service/pact-version/<sha>/verification-results" \
-H "Authorization: Bearer $APIOME_API_KEY" \
-H "Content-Type: application/json" \
-d '{"success": true, "providerApplicationVersion": "4f1e2d0", "buildUrl": "https://ci.example.com/builds/77"}'
<sha> is the pact version: the name of the pact's pb:pact-version link.
Upload a report in the app
To attach a report by hand — a verifier you ran on your machine, or a CI job that could not reach Apiome — use Upload results.
- In the rail, under Ship, click Contracts, then the Verification tab.
- Choose the Provider under test.
- In the header, click Upload results.
- Choose the Consumer. The Pact version is set to that consumer's newest pact; choose Another pact version… to paste a SHA.
- Check the Provider version the verifier ran against (it is filled in from the page).
- Leave Report format on Detect, or choose Pact verifier JSON, JUnit XML, Schemathesis, Newman or Dredd.
- Drop the report on Drop the report here, or click Browse. The dialog says what Detect will read it as, such as Looks like a Dredd report (xunit XML). A file that is neither JSON nor XML is refused there, before anything is sent.
- Optionally open More options for the Branch, Build URL, Tags, Verifier and Verifier version.
- Click Upload results.


/ade/dashboard/pacts/verification/newThe dialog then says what Apiome recorded, such as Recorded a failed result from a Dredd report:
1 interaction, and lists every note about what it could not use. A report Apiome cannot read is
refused with the reason — for example format is dredd but the report is JSON — and nothing is
recorded. The same, from anywhere shows the apiome pact publish-verification-results command
and the REST call for the same upload.
You need Pacts → Create to upload.
Send a report from your own CI
If your pipeline already runs pact_verifier_cli, Schemathesis, Newman, Dredd, or a test runner that
writes JUnit, you do not need a Pact library to publish the result. Send the report and Apiome reads it into a
verification result: the matrix, can-i-deploy, pending pacts and webhooks see it like any other.
# your usual pact_verifier_cli run, plus --json to write the report
pact_verifier_cli --file pacts/billing-service-ledger-api.json … --json report.json
apiome pact publish-verification-results report.json \
--provider "Ledger API" --consumer "Billing Service" \
--pact-version <sha> --provider-app-version "$GIT_SHA" \
--branch main --build-url "$CI_BUILD_URL"
The same request with curl. The version, build, branch and tags are query parameters because neither report format carries them:
curl -X POST \
"https://api.apiome.dev/v1/tenants/acme/pact-broker/pacts/provider/ledger-api/consumer/billing-service/pact-version/<sha>/external-verification-results?providerApplicationVersion=4f1e2d0&branch=main" \
-H "Authorization: Bearer $APIOME_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @report.json
| Report | Send it as | How it is read |
|---|---|---|
pact_verifier_cli --json | application/json | The verifier's result is the verdict. Each entry of errors is a failed interaction with its mismatches; each entry of pendingErrors is kept and marked pending. A pacts[].interactions[] listing is read interaction by interaction. |
| JUnit XML | application/xml | Each <testcase> is an interaction. A <failure> or <error> fails it and its message is the mismatch. A <skipped> case was not replayed, so it makes the result unsuccessful. |
Schemathesis --report ndjson | application/x-ndjson | One interaction per operation (GET /invoices/{id}). It fails when any scenario of it failed or errored, and each failed check is a mismatch. Skipped scenarios tested nothing: they are noted, not counted. A stream without EngineFinished did not finish and is recorded as failed. |
Schemathesis --report junit | application/xml | Read as JUnit, recorded as Schemathesis. |
Newman -r json | application/json | One interaction per execution (request). Each failed assertion is a mismatch; a skipped assertion makes the result unsuccessful. |
Newman -r junit | application/xml | Read as JUnit. Choose format=newman to record it as Newman. |
Dredd --reporter xunit | application/xml | Read as JUnit, recorded as Dredd. |
The format comes from the format query parameter (auto, pact-verifier-json, junit,
schemathesis, newman or dredd), then the content type, then the body. With auto, JUnit whose
suite is named schemathesis or Dredd Tests is that tool's, JSON with run.executions and
collection is Newman's, and NDJSON with a Schemathesis Initialize event is Schemathesis'. A
format the report does not match is refused with the report it expects. The other query parameters are providerApplicationVersion
(required), buildUrl, branch, tag (repeatable), verifier, verifierVersion and
providerVerificationReportId.
The answer is 201 with the stored result, plus an ingestion object:
{
"success": false,
"ingestion": {
"format": "pact-verifier-json",
"syntax": "json",
"interactions": 1,
"notices": [
{"pointer": "/output", "reason": "12 line(s) of verifier log output are not stored"}
]
}
}
Nothing is dropped silently. Every field the reader could not use, and every judgement it made
(a result flag contradicted by the failures listed beside it, an interaction with no name, a
skipped case) is a notice with a JSON Pointer or a //testcase[n] location. The CLI prints them.
A report with no interactions and no result flag, an empty body and XML that declares a DTD or
entities are refused with 422 pact-verification-invalid instead of being published as a pass.
Apiome records what the report says. It does not check that the report covers every interaction
of the pact version, so keep the verifier's --file and the <sha> you publish for in step.
Read results
| To read | Request |
|---|---|
| The latest result for a pact version | GET …/pact-version/<sha>/verification-results/latest |
| One result, by its number | GET …/pact-version/<sha>/verification-results/1 |
Every pact links to its latest result with pb:latest-verification-results. A result links back to
its pact with pb:pact-version.
When a result is refused
| Status | Code | What to do |
|---|---|---|
422 | pact-verification-invalid | The body is malformed. pointer names the field — /success missing, /testResults not an array. |
422 | pact-verification-invalid | An ingested report is empty, is neither JSON nor XML, proves nothing, names an unknown format, or is not what format names (pointer is /format). |
422 | pact-verification-report-not-found | providerVerificationReportId is not a report of this workspace. |
400 | pacticipant-invalid-version, pacticipant-invalid-url | The provider version has a leading or trailing space, or buildUrl is not an http(s) URL. |
404 | pact-not-found, pacticipant-not-found | No such pact version between the two applications. |
404 | pact-verification-not-found | No result with that number, or none yet. |
401 / 403 | — | The token is not a valid API key for this workspace, or its member lacks Pacts permission. |
Who can do what
| Action | Needs | Viewer | Editor | Admin | Owner |
|---|---|---|---|---|---|
| Read results | pacts:view | ✓ | ✓ | ✓ | ✓ |
| Publish results, record a provider branch or tag | pacts:create | — | ✓ | ✓ | ✓ |
Related
- Choose pacts to verify with selectors — what the verifier fetches first.
- Contract webhooks — tell CI when a result is published.
- Verification results and re-runs — read the results in the app.
- Pact Broker concepts — pacticipants, versions, branches and tags.
- Pact Broker API — every endpoint, parameter and error code.