Can I deploy?
Can-i-deploy answers one question before a deployment: is this version compatible with what
already runs there? Apiome answers it from three things you already record: the
pacts each consumer version published, the
verification results of each provider version — including the
bi-directional ones Apiome writes when it compares a pact with a
provider contract — and what is deployed where. The pact-broker can-i-deploy command asks Apiome
unchanged.
Ask it from your deploy job, from the Can I deploy? page in the app, or from the API. To look at many versions at once, use the Matrix page.
Before you start
- Consumers publish their pacts, and providers publish verification results.
- Each environment exists, and your deploy jobs record every deployment. Can-i-deploy checks against what is recorded there.
- Set
PACT_BROKER_BASE_URLto your workspace's broker base URL (https://api.apiome.dev/v1/tenants/<workspace>/pact-broker) andPACT_BROKER_TOKENto an API key. Any role can ask: the key needs Pacts → View. Create one on API keys.
Check in the console
The Can I deploy? page asks the same question from the app and explains the answer.
- In the rail, under Ship, click Contracts.
- Click the Can I deploy tab.
- In Pacticipant, type or choose the application being deployed.
- In Version, type or choose its version. Once the pacticipant is known, the list suggests its latest versions.
- Under Deploy to, choose Environment and pick it from the list, or choose Tag and type the tag.
- Optional: to leave an application out of the answer, type it in Ignore a pacticipant and click Ignore. Click its name again to stop ignoring it. You can ignore up to 10.
- Click Check.
If a field is missing, the page says which and does not ask. The address of the page carries the
question (?pacticipant=…&version=…&toEnvironment=…), so you can share a check; opening a whole
question asks it straight away.


/ade/dashboard/pacts/can-i-deployThe answer has three parts:
- Verdict — Yes — deployable, No — not deployable or Not known yet, the Pact
Broker's sentence, and the counts. Each notice is listed under Blocking, Warnings or
Passing, with what to do about it. When the answer is not known yet, the page says when to ask
again, as REST's
Retry-Afterdoes, and Check again asks. See Wait for a result. - Rows the verdict was reached from — every row, with its result and reason. Ignored rows are marked Ignored. Open pact opens the pact. The columns are the ones on the Matrix page.
- Ask from a pipeline — the
apiome pact can-i-deploycommand that asks the same question. It exits0when the answer is yes and1otherwise.
Before your first check, the page shows that command with example values.
Gate a deployment
Add this to your deploy job, before the deployment:
pact-broker can-i-deploy \
--pacticipant "Billing Service" \
--version "$GIT_COMMIT" \
--to-environment production
The command exits 0 when the answer is yes and 1 when it is no or not yet known, so the job
stops before deploying. After a deployment that goes ahead,
record it.
Computer says no ¯\_(ツ)_/¯
CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT#
----------------|-----------|------------|-----------|----------|--------
Billing Service | 2.0.0 | Ledger API | 5.1.0 | false | 3
The verification for the pact between version 2.0.0 of Billing Service and the version of
Ledger API currently in production (5.1.0) failed
How the answer is reached
Apiome finds every application the version has a pact with, takes the versions of each that are currently in the environment, and reads the latest verification result between each pair.
| Answer | deployable | When |
|---|---|---|
| Yes | true | Every result that counts is successful, or nothing depends on the version. |
| No | false | A verification failed, or the version you named does not exist. |
| Unknown | null | A verification result is missing. The provider has not verified this pact yet. |
- A consumer needs its providers. Deploying a consumer checks its pacts against the provider versions in the environment. If a provider is not deployed there yet, the answer is unknown: deploy the provider first.
- A provider does not need its consumers. Deploying a provider checks the pacts of the consumer versions in the environment. If no consumer is deployed there, the answer is yes.
- Every version in the environment is checked. When two versions of an application run in one environment, on two application instances or as two supported releases, the version must work with both. One of them without a result makes the answer unknown.
- An ended release no longer counts. Once support for a release ends (
record-support-ended, or End support on the Environments board), its pacts no longer hold its counterparts back; an undeployed version (record-undeployment) no longer counts either. - Only the pacts of that version count. A consumer version that no longer calls a provider has no pact with it, and that provider is not checked.
- The latest result decides. When a provider version verified a pact more than once, the last result is used, whether a Pact verifier published it or Apiome's comparison wrote it.
- A pending pact still blocks the consumer. A failed result of a
pending pact does not fail the provider's build, but the consumer
cannot deploy against that provider version. The row's reason reads
pact is pending, and itsverificationResultcarriespending: true(andwip: truefor a work-in-progress pact).
Reasons
The answer always comes with its reasons, in the same words a Pact Broker uses. Each notice also
has a code your scripts can branch on:
| Code | Reads like | Answer |
|---|---|---|
verified | All required verification results are published and successful | Yes |
no-dependencies | There are no missing dependencies | Yes |
verification-failed | The verification for the pact between version 2.0.0 of Billing Service and the version of Ledger API currently in production (5.1.0) failed | No |
pact-pending | The same sentence as verification-failed, for a pact that was pending for that provider build | No |
version-not-found | No pacts or verifications have been published for version 9.9.9 of Billing Service | No |
no-pact | No pact has been published for version s-1 of Search API, and environment production requires a contract | No |
no-verification-result | There is no verified pact between version 2.0.0 of Billing Service and the version of Ledger API currently in production (5.1.0) | Unknown |
Each row of the matrix has its own reason: verified, verification failed, pact is pending
or no verification result. For a bi-directional result the codes are
the same and the text says so: verified by bi-directional comparison or
bi-directional comparison failed.
Bi-directional results
When a provider publishes its OpenAPI document as a provider contract, Apiome compares each consumer's pact with it, using the comparison rules, and stores the outcome as a verification result. The matrix and can-i-deploy read that result exactly as they read one a Pact verifier published: a passing comparison counts as a successful verification, a failing one blocks the deployment, and a missing one makes the answer unknown.
You do not ask for it. The comparison runs when either side publishes:
| What is published | What it is compared with |
|---|---|
A pact (pact-broker publish) | The contract of the provider's latest version, of the head of each provider branch, and of every provider version deployed or released. |
| A provider contract | Each consumer's main-branch pact, every pact deployed or released, the latest pact of each consumer on the provider version's branch, and every pact compared before with a contract of that branch. |
The last row is the re-run: when a new provider contract arrives on main, the pacts that were
compared with main's previous contract are compared with the new one too.
Each pact is compared with each provider version once. A provider version's contract never changes, so publishing either side again compares nothing new. A new provider contract is a new provider version, so it gets its own results.
Read the kind of a result
Every verificationResult in the matrix says how it was reached:
"verificationResult": {
"success": false,
"verifiedAt": "2026-11-24T10:05:00+00:00",
"kind": "bidirectional",
"_links": { "self": { "href": "…/pact-version/4f1e…/verification-results/1" } }
}
kind | Means |
|---|---|
native | A Pact verifier replayed the pact against the running provider and published the result. |
bidirectional | Apiome compared the pact with the provider version's contract. |
A failing bi-directional result names the comparison in the answer:
The bi-directional comparison of the pact between version 2.0.0 of Billing Service and the version
of Ledger API currently in production (5.1.0) with its provider contract failed
Follow the row's self link to read the result. A bi-directional result carries the whole
comparison in comparison, one entry per interaction in testResults, and a
pb:provider-contract link to the contract it was compared with. See
Read the comparison.
- A
partialcomparison passes. Nothing in the provider contract contradicts the pact, but something could not be compared in full. Read its fidelity notes incomparisonbefore relying on it. - A native result after a comparison replaces it. If the provider also runs a Pact verifier, its later result for the same provider version decides, as any later result does.
- A comparison does not end a pact's pending period. Only a Pact verifier's successful result takes a pact out of pending.
An unverified provider contract
A bi-directional result is only as good as the provider contract behind it. When the provider published its contract without passing self-verification evidence, the row says so:
"verificationResult": {
"success": true,
"kind": "bidirectional",
"providerContractVerified": false
},
"reason": { "code": "verified", "text": "verified by bi-directional comparison; provider contract unverified" }
Under the default warn policy the result still counts, and the answer carries a
provider-contract-unverified warning naming the provider version. Under the fail policy
(APIOME_PACT_UNVERIFIED_PROVIDER_CONTRACT=fail) the result fails, the row reads
bi-directional comparison failed: provider contract unverified, and can-i-deploy says no.
providerContractVerified is on every bi-directional row; a native row does not have it.
Wait for a result
A consumer's pipeline often asks before the provider has finished verifying the new pact. Tell the CLI to keep asking while the answer is unknown:
pact-broker can-i-deploy --pacticipant "Billing Service" --version "$GIT_COMMIT" \
--to-environment production \
--retry-while-unknown 12 --retry-interval 10
It asks again every 10 seconds, up to 12 times, and stops as soon as the answer is yes or no. When
the answer is unknown, Apiome's response also carries a Retry-After header with the number of
seconds to wait, for clients that call the API themselves.
Leave an application out
To deploy although one integration is not ready, ignore that application:
pact-broker can-i-deploy --pacticipant "Billing Service" --version "$GIT_COMMIT" \
--to-environment production --ignore "Ledger API"
Its rows are still listed, marked ignored, and counted in summary.ignored. They do not change
the answer. A name that matches no application gives a warning, Cannot ignore …, not an error.
Require a contract
By default an application with no pacts can always deploy: nothing depends on it. To refuse it
instead, set contractRequired on the environment (see
Create your environments). Can-i-deploy to that
environment then answers no, with the code no-pact, for a version that published no pact and
that no pact names as its provider.
Deploy to a tag instead of an environment
Setups that mark what is in production with a tag, not with recorded deployments, name the tag:
pact-broker can-i-deploy --pacticipant "Billing Service" --version "$GIT_COMMIT" --to prod
The version is checked against the latest version of each other application that has the tag. Environments are preferred for new setups: a tag cannot say that two versions are live at once.
Check two versions against each other
Name both sides to ask whether two specific versions work together, wherever they run:
pact-broker can-i-deploy \
--pacticipant "Billing Service" --version 2.0.0 \
--pacticipant "Ledger API" --version 5.1.0
Ask the API
pact-broker can-i-deploy calls the matrix. You can call either endpoint yourself; both return the
same document.
| To ask | Request |
|---|---|
| Can this version go to an environment? | GET …/pact-broker/can-i-deploy?pacticipant=Billing%20Service&version=2.0.0&toEnvironment=production |
| Can it go where a tag is? | GET …/pact-broker/can-i-deploy?pacticipant=Billing%20Service&version=2.0.0&to=prod |
| The same, leaving one application out | add &ignore=Ledger%20API |
| The matrix, as the CLI asks it | GET …/pact-broker/matrix?q[][pacticipant]=Billing%20Service&q[][version]=2.0.0&latestby=cvpv&environment=production |
| The history of one integration | GET …/pact-broker/matrix?q[][pacticipant]=Billing%20Service&q[][pacticipant]=Ledger%20API&latestby=cvpv |
curl -G "$PACT_BROKER_BASE_URL/can-i-deploy" \
-H "Authorization: Bearer $PACT_BROKER_TOKEN" \
--data-urlencode "pacticipant=Billing Service" \
--data-urlencode "version=2.0.0" \
--data-urlencode "toEnvironment=production"
{
"summary": {
"deployable": null,
"reason": "There is no verified pact between version 2.0.0 of Billing Service and the version of Ledger API currently in production (5.1.0)",
"success": 0,
"failed": 0,
"unknown": 1
},
"notices": [
{
"type": "error",
"code": "no-verification-result",
"text": "There is no verified pact between version 2.0.0 of Billing Service and the version of Ledger API currently in production (5.1.0)"
}
],
"matrix": [
{
"consumer": { "name": "Billing Service", "version": { "number": "2.0.0", "branch": "main" } },
"provider": { "name": "Ledger API", "version": null },
"pact": { "createdAt": "2026-11-24T10:00:00+00:00" },
"verificationResult": null,
"reason": { "code": "no-verification-result", "text": "no verification result" }
}
]
}
The rows are shortened here: each also carries links to the pact, the result and both versions.
The status is 200 whatever the answer is. Read summary.deployable, not the status code.
summary.unknown is the number of results still missing. Each version in a row also lists its
branches, its tags and the environments it is in.
Matrix parameters
| Parameter | What it does |
|---|---|
q[][pacticipant] | An application to include. Repeat it for several; the parameters after each one belong to it. |
q[][version], q[][branch], q[][tag], q[][environment], q[][mainBranch]=true | Which of its versions. With q[][latest]=true, only the latest of them. Without any, every version. |
environment | Check against the versions currently in this environment. |
tag with latest=true | Check against the latest version with this tag. |
latest=true | Check against the latest version of each other application. |
mainBranch=true with latest=true | Check against the head of each other application's main branch. |
latestby | cvpv keeps the latest result per consumer version and provider version, cvp per consumer version and provider, cp per consumer and provider. Without it, every result is a row. |
ignore[][pacticipant], ignore[][version] | Leave an application, or one version of it, out of the answer. |
success[] | Keep only rows with this result: true, false, or empty for rows without a result. |
limit | The most rows to return, from 1 to 1000. Defaults to 100. |
When a request is refused
| Status | Code | What to do |
|---|---|---|
400 | pact-matrix-invalid | The query is malformed, or names an application or an environment that does not exist. message says which, and pointer names the parameter: Pacticipant Nope not found at /q/0/pacticipant. Publish a pact or a result for the application first, or create the environment. |
401 / 403 | — | The token is not a valid API key for this workspace, or its member lacks Pacts → View. |
A version that does not exist is not a refusal: the answer is no, with the code version-not-found.
Who can do what
| Action | Needs | Viewer | Editor | Admin | Owner |
|---|---|---|---|---|---|
| Ask can-i-deploy and read the matrix | pacts:view | ✓ | ✓ | ✓ | ✓ |
In the deploy gate
The project deploy gate includes a contracts signal that
asks this same question, using the same verdict function, so the gate and can-i-deploy never
disagree. It judges the pacticipant bound to the project, for the version named like the revision
being gated.
| Verdict | Signal | In the gate verdict |
|---|---|---|
| Deployable | pass | counts |
| Deployable, but it leans on an unverified provider contract | warn | counts |
| Not deployable | fail | fails the gate |
| A verification result is missing | unknown | left out, counted apart |
| No pacticipant bound, version never published to it, or no pacts | not_configured | left out |
- Destination. Set
contracts.environmentin the gate policy (PUT …/gate/policy) to check against what is in that environment. Left empty, the latest version of each counterpart is used. - Several pacticipants. If more than one is bound to the project, the first by handle is judged
and the others are listed in the signal's
data.otherPacticipants. - Permissions. The signal needs
pacts:view; without it, it reportsunknown. If the read fails, only this signal is lost, not the whole gate.
Block a publish on failing contracts
Publishing a version can be stopped by the same verdict. Set contracts.publishPolicy in the
deploy-gate policy (PUT …/gate/policy) to one of three levels:
| Level | A failing contract does this to a publish |
|---|---|
off | Nothing. The publish dialog shows no contracts card. |
warn (default) | The publish dialog warns, and the publish goes ahead. The warning is recorded in the audit trail. |
block | The publish is refused with a 422 unless it is force-published with a reason. |
- What counts as failing. The verdict for the pacticipant bound to the project and the version named like the revision is not deployable. A verdict that leans only on an unverified provider contract is a warning. A verification result that has not arrived yet shows as Pending and never blocks, because "not verified yet" is not "failed".
- What never blocks. A project with no bound pacticipant, no published version or no pacts; a
caller without
pacts:view, who is told the gate was not checked rather than shown the verdict; and a read that fails. - In the publish dialog. Open Publish on a version. The Contracts card lists the failing
rows and, under
block, says that publishing is blocked. The card stays hidden when there is nothing to report. - Get past a block. Turn on Force publish and enter a reason. The reason and the verdict are
written to the audit trail as
version.contracts_gate(actionforced). - From the API.
GET /v1/versions/{tenant}/{project}/{revision}/contracts-publish-gatereturns the same assessment without publishing anything. A refused publish carries it indetail.contractsPublishGate.
The policy only decides what a verdict does to a publish. It does not change the deploy gate's own verdict.
Related
- Environments and deployments — record what runs where.
- Publish verification results — the results the answer is read from.
- Publish a provider contract — the contracts bi-directional results come from.
- Contract testing and CI gates — the other gates a pipeline can run.
- Pact Broker API — every endpoint, parameter and error code.