Manage contract releases
Create a reviewed consumer API, synchronize selected source changes, and publish a governed release from the CLI.
Preview: these commands require a compatible CLI build and Elva service support. Check elva --version and each command's --help output. Your installed release may not include every command shown here.
Create and inspect a draft
elva --json collection list
elva contract list
elva --yes contract create --from partner-contract.json
elva --json contract show "Partner API" > contract-snapshot.json
Save the following definition as partner-contract.json. Replace the example collection ID, collection name, and operation with values from your workspace. This is a contract definition; import your OpenAPI document as a collection first.
{
"name": "Partner API",
"audience": "partner",
"description": "Partner access to orders",
"collections": [
{
"collection": "0123456789abcdef01234567",
"collectionName": "Orders",
"endpoints": [
{
"method": "GET",
"path": "/orders"
}
],
"sourceEndpoints": [
{
"method": "GET",
"path": "/orders"
}
]
}
],
"publishing": {
"platforms": [],
"platformConfigs": [],
"publicArtifacts": false,
"mockServer": false,
"mcpServer": false
},
"governance": {
"breakingChangePolicy": "block",
"requireApproval": false,
"stakeholders": []
}
}
Creation saves a draft. This example leaves publishing destinations and public sharing disabled and blocks breaking changes. Set the destinations and approval policy your team needs before publishing. Provider credentials are configured in Elva.
Update reviewed content
elva --yes contract update "Partner API" --from reviewed-contract.json
Save your reviewed changes to reviewed-contract.json, using either a sparse patch such as {"description":"Revised partner API"} or an edited contract snapshot. Updating a snapshot does not publish it. Use Compose to change endpoint selection and Schema to refine selected endpoints.
Synchronize source changes
Inspect drift in contract show after rescanning or reimporting a source. Prepare a reviewed sync file with the complete desired endpoint selections, any endpointSchemas needed to resolve field drift, and refreshedCollections identifying only the fully resolved sources. Omitting refreshedCollections or supplying an empty list can mark all existing sources refreshed, so provide it explicitly.
elva --yes contract sync "Partner API" --from reviewed-sync.json
elva --json contract show "Partner API"
Sync applies your reviewed change set; it does not choose merges or publish a release. Content changes can invalidate an earlier approval.
Approve and publish
elva --yes contract approve "Partner API" --note "Reviewed endpoint selection and schemas"
elva --yes contract publish "Partner API"
An assigned approver can approve or reject with contract reject and --note. Admin access alone does not make someone an assigned approver. If the release requires explicit acknowledgment, review the reported breaking changes and rerun publish with --acknowledge-breaking-changes.
Inspect the result for every destination: published, unchanged, skipped, or failed. A nonzero exit after partial publication does not roll back successful destinations. Correct the failing destination and retry, then inspect contract show and test the published consumer surface.
On this page
- Manage contract releases