Consumer contracts
Generated from apiome-rest/openapi.yaml (API version 1.719.0) — do not edit by hand. How to authenticate is on the REST API reference.
Tag: consumer-contracts · 20 operations
POST /v1/tenants/{tenant_slug}/projects/{project_ref}/consumer-pact-imports
Import a Pact file into a consumer contract
Import a Pact document (specification 1.x-4.x). Each interaction's method and path is resolved onto the project's path template — /pets/42 becomes /pets/{petId} — and the keys of its example request and response bodies become the fields the consumer declares, resolved against that operation's schemas at the interaction's own status code. Query parameters are declared as parameter usage.
Nothing is dropped. An interaction naming a retired endpoint, a status the specification does not declare, or a field that has been removed comes back in unresolved with a stable reason code and is stored on the revision. An import whose interactions all fail to resolve stores a visibly empty surface rather than succeeding quietly.
matchingRules, providerStates, and generators are deliberately not read: they say how a value is compared, not which fields are used.
The consumer is registered if it does not exist, under the handle in consumer_slug or one derived from the document's own consumer.name — so a CI job uploading a pact for a new service succeeds on its first run.
Requires consumer_contracts:create.
Operation id: import_pact_contract_v1_tenants__tenant_slug__projects__project_ref__consumer_pact_imports_post
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for import a pact file into a consumer contract.
application/json—PactImportRequest
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful response for import a pact file into a consumer contract. | application/json ContractResponse |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumer-suggestions
List suggested consumers
Clients seen in this project's usage traffic that no binding attributes to a consumer — by the product token of their user agent (checkout-web), or by the hashed consumer_hint the edge sent. Busiest first; a client a live binding already recognises is left out. A hashed client is shown by an opaque id, never by its value or its hash.
Requires consumer_contracts:view.
Operation id: list_consumer_suggestions_v1_tenants__tenant_slug__projects__project_ref__consumer_suggestions_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
days | query | integer | no | Window in UTC days. |
limit | query | integer | no | Most to return. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for list suggested consumers. | application/json SuggestionListResponse |
| 422 | Validation Error | application/json HTTPValidationError |
POST /v1/tenants/{tenant_slug}/projects/{project_ref}/consumer-suggestions/{suggestion_id}/register
Register a suggested consumer
Register the client as a consumer (or, with consumer, bind it to an existing one) and create the binding that recognises it: the glob <token>/* for a user agent, or a hashed binding holding the value's hash the edge already sent — so no value is typed. A hashed client needs binding_name, the header or claim its value arrives in. From the next ingested batch on, its calls are attributed and its runtime edges appear in the graph.
Requires consumer_contracts:create.
Operation id: register_consumer_suggestion_v1_tenants__tenant_slug__projects__project_ref__consumer_suggestions__suggestion_id__register_post
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
suggestion_id | path | string | yes | Path parameter identifying the suggestion id segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for register a suggested consumer.
application/json—RegisterSuggestionInput
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful response for register a suggested consumer. | application/json RegisteredSuggestion |
| 404 | consumer-suggestion-not-found, or an unknown project or consumer. | — |
| 409 | consumer-slug-taken, consumer-slug-reserved or consumer-binding-exists. | — |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumer-surface
List the operations and fields a consumer could declare
Every operation of a stored version, with the request, response, and parameter fields a consumer can declare against it. This is the catalogue the UI picker draws.
Field enumeration is bounded — recursive schemas terminate and very wide operations are cut short — and an operation whose list was cut says so with truncated: true. A field the catalogue omitted can still be declared by naming it explicitly.
Requires consumer_contracts:view.
Operation id: read_available_surface_v1_tenants__tenant_slug__projects__project_ref__consumer_surface_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
version | query | string or null | no | Version label, revision id, or latest. Defaults to the latest revision. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for list the operations and fields a consumer could declare. | application/json AvailableSurfaceResponse |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumer-usage
Count the consumers using each operation, field and schema of a version
The registry's current contracts, projected onto one stored version's pointers: how many consumers declared each operation and field, and how many reach each component schema through those fields. This is what an authoring overlay draws next to the contract (DCW-0.5).
Only contracts resolved against this version are projected; consumers whose current contract names another version are counted in other_version_consumer_count, and consumers with no contract yet in undeclared_consumer_count.
Requires projects:view. Consumer names are included only for a caller holding consumer_contracts:view — anyone else gets the same counts with consumers: null and consumers_visible: false.
Operation id: read_consumer_usage_v1_tenants__tenant_slug__projects__project_ref__consumer_usage_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
version | query | string or null | no | Version label, revision id, or latest. Defaults to the latest revision. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for count the consumers using each operation, field and schema of a version. | application/json ConsumerUsageResponse |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers
List a project's consumers
Every live consumer of the project, newest first, each with its current contract revision — the operations and fields it declares it uses, plus how many interactions could not be resolved.
A consumer that has never declared a contract is still listed, with contract: null. That is the state a newly registered consumer is in, and hiding it would make the registration look like it failed.
Each row's runtime counts its declared-and-used, declared-unused and used-undeclared operations over runtime_days, from the traffic its bindings attribute.
At most 1,000 a page: pass the previous page's next_cursor as cursor until has_more is false.
Requires consumer_contracts:view.
Operation id: list_project_consumers_v1_tenants__tenant_slug__projects__project_ref__consumers_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
team | query | string or null | no | Only consumers whose owner (confirmed, else suggested) is this team slug (CDG-2.4). |
runtime_days | query | integer | no | Window, in UTC days ending today, of each row's runtime counts (RDG-1.8). |
limit | query | integer | no | Page size. At most 1000. |
cursor | query | string or null | no | Opaque cursor from the previous page (next_cursor, or the X-Next-Cursor header). Omit for the first page. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for list a project's consumers. | application/json ConsumerListResponse |
| 422 | Validation Error | application/json HTTPValidationError |
POST /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers
Register a consumer
Register a named client of this project. The handle (slug) is what CI and Pact files name; it is derived from name when omitted, and is not editable afterwards — renaming it would orphan every reference to it.
Registering a consumer declares nothing on its own. The surface it uses arrives separately, either by importing a Pact file or by declaring a picked selection.
Requires consumer_contracts:create.
Operation id: register_consumer_v1_tenants__tenant_slug__projects__project_ref__consumers_post
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for register a consumer.
application/json—ConsumerInput
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful response for register a consumer. | application/json ConsumerRecord |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}
Read one consumer and its current contract
Read a consumer by its handle or its id, together with the full surface of its current contract revision.
Requires consumer_contracts:view.
Operation id: read_consumer_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for read one consumer and its current contract. | application/json ConsumerDetailResponse |
| 422 | Validation Error | application/json HTTPValidationError |
PATCH /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}
Update a consumer
Apply a partial update to a consumer's identity — its name, description, owner, contact, or metadata. Omitted fields are left alone.
The handle is not updatable. It is the name CI and Pact files use, and changing it would silently orphan every reference to it; retire the consumer and register a new one instead.
Requires consumer_contracts:edit.
Operation id: patch_consumer_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__patch
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for update a consumer.
application/json—ConsumerPatch
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for update a consumer. | application/json ConsumerRecord |
| 422 | Validation Error | application/json HTTPValidationError |
DELETE /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}
Retire a consumer
Retire a consumer. Its contract revisions are kept: a published version's per-consumer verdict has to stay explicable after the consumer is decommissioned, and the handle becomes available again for a new registration.
Requires consumer_contracts:delete, which the built-in grids give Owner and Admin only — removing a consumer removes a signal that guards other people's changes.
Operation id: delete_consumer_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | Successful response for retire a consumer. | — |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/bindings
List a consumer's bindings
How this consumer is recognised in usage traffic: a header, an API key, a JWT claim, or a user-agent glob. A bound value is never returned — not even as a hash.
Deleted bindings are listed with include_deleted=true; they no longer match traffic but keep the history they attributed.
At most 1,000 a page: pass the previous page's next_cursor as cursor until has_more is false.
Requires consumer_contracts:view.
Operation id: list_consumer_bindings_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__bindings_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
include_deleted | query | boolean | no | Also list deleted bindings. |
limit | query | integer | no | Page size. At most 1000. |
cursor | query | string or null | no | Opaque cursor from the previous page (next_cursor, or the X-Next-Cursor header). Omit for the first page. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for list a consumer's bindings. | application/json ConsumerBindingBindingListResponse |
| 422 | Validation Error | application/json HTTPValidationError |
POST /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/bindings
Bind a header, API key, JWT claim or user agent to a consumer
Attribute usage traffic to this consumer. header, api_key and jwt_claim take the value to recognise: it is accepted once, hashed (HMAC-SHA256 under a key derived for this workspace) before anything is stored, and never returned. user_agent takes no value; its name is a glob such as billing-service/*.
Matching starts with the next ingested batch. One kind, name and value can identify only one consumer per workspace (409 consumer-binding-exists).
Requires consumer_contracts:create.
Operation id: create_consumer_binding_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__bindings_post
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for bind a header, api key, jwt claim or user agent to a consumer.
application/json—BindingInput
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful response for bind a header, api key, jwt claim or user agent to a consumer. | application/json BindingRecord |
| 409 | consumer-binding-exists or consumer-binding-limit. | — |
| 422 | Validation Error | application/json HTTPValidationError |
| 503 | consumer-binding-key-unavailable: no envelope master key is configured. | — |
DELETE /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/bindings
Delete all of a consumer's bindings, optionally erasing its usage identity
Without erase, every live binding stops matching traffic and history stays attributed, as when they are deleted one by one.
With erase=true (RDG-5.4), in one transaction: every binding of the consumer, live or deleted, is removed with its hash; every hourly and daily counter it attributed is re-attributed to anonymous (the counts are kept, so totals do not change); the suggested-consumer rows carrying its hashes and its runtime graph edges are deleted. Afterwards no usage read names the consumer. The consumer and its contract stay.
Requires consumer_contracts:delete. An erasure is audited as usage.consumer.erased.
Operation id: delete_consumer_bindings_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__bindings_delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
erase | query | boolean | no | Also re-attribute the consumer's counters to anonymous. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for delete all of a consumer's bindings, optionally erasing its usage identity. | application/json BindingsDeletedResponse |
| 400 | anonymous cannot be erased. | — |
| 422 | Validation Error | application/json HTTPValidationError |
DELETE /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/bindings/{binding_id}
Delete a consumer binding
Stop attributing traffic through this binding, from the next ingested batch on. Traffic it already attributed stays attributed to the consumer.
Requires consumer_contracts:delete.
Operation id: delete_consumer_binding_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__bindings__binding_id__delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
binding_id | path | string | yes | Path parameter identifying the binding id segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | Successful response for delete a consumer binding. | — |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/contract
Read a consumer's contract
The consumer's current contract revision, or a specific one with ?revision=.
Requires consumer_contracts:view.
Operation id: read_contract_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__contract_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
revision | query | integer or null | no | A specific revision number; defaults to the current one. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for read a consumer's contract. | application/json ConsumerContractRecord |
| 422 | Validation Error | application/json HTTPValidationError |
PUT /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/contract
Declare a consumer's contract from a picked surface
Declare which operations — and, optionally, which fields on them — this consumer uses, without a Pact file. This is what the UI picker submits.
The selection names operations and fields the way a person picks them (method, path template, dotted data path); the server resolves each against the stored specification and stores the resulting JSON Pointers. A client cannot supply its own pointers, so a stored surface always describes something the specification actually contains.
Anything that does not resolve is reported, not dropped: an operation that no longer exists, or a field that has been removed, comes back in unresolved with a stable reason code and is stored on the revision.
Every call writes a new revision; nothing is overwritten.
Requires consumer_contracts:edit.
Operation id: declare_contract_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__contract_put
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
version | query | string or null | no | Version label, revision id, or latest to resolve the selection against. Defaults to the project's latest revision. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for declare a consumer's contract from a picked surface.
application/json—SurfaceSelection
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful response for declare a consumer's contract from a picked surface. | application/json ContractResponse |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/contract-revisions
List a consumer's contract history
Every stored revision of this consumer's contract, newest first. Revisions are never overwritten, so this is the record of what the consumer claimed it used over time.
Requires consumer_contracts:view.
Operation id: list_contract_revisions_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__contract_revisions_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
limit | query | integer | no | Maximum revisions to return. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for list a consumer's contract history. | application/json ContractRevisionsResponse |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/pact
Export a consumer's declared surface as a Pact v4 file
Generate a Pact v4 document from a consumer contract revision declared through the picker.
Each declared operation becomes one Synchronous/HTTP interaction per response status the consumer reads, carrying only the declared fields. Sample values are the specification's own examples (media-type example / examples, then the schema's example, examples, default, const or first enum value, then a parameter's example). Response bodies carry a cascading type matcher at $, so the provider must return the same shape, not the same values.
Nothing is dropped silently. findings lists every value that had to be invented (placeholder, e.g. no-example, status-range) and everything that could not be written (omitted, e.g. field-not-found, status-default, media-type-not-json, contract-unresolved).
consumer.name is the pacticipant bound to this consumer, else the consumer's handle. provider.name is provider when given, else the one pacticipant bound to the project, else the project's handle; several bound pacticipants without provider is 409 consumer-pact-export-provider-ambiguous.
Only a picker-declared (manual) revision is exported: a revision from a Pact file or an agent is 422 consumer-pact-export-unsupported-source, and a revision that yields no interaction is 422 consumer-pact-export-empty with its findings.
Requires consumer_contracts:view and pacts:view.
Operation id: export_consumer_pact_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__pact_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
revision | query | integer or null | no | A contract revision; defaults to the current one. |
provider | query | string or null | no | The provider pacticipant name. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for export a consumer's declared surface as a pact v4 file. | application/json PactExportResponse |
| 409 | Several pacticipants are bound to the project. | — |
| 422 | Not exportable. | — |
POST /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/pact/publish
Publish a consumer's declared surface to the Pact Broker
Generate the Pact v4 document of a picker-declared contract revision (as GET …/pact does) and publish it for a consumer version, exactly as POST …/pact-broker/contracts/publish would: the consumer and provider are registered as pacticipants on first use, the version is recorded with its branch and tags, identical content is stored once, a different pact for a version that already has one is 409 pact-content-conflict, and bi-directional comparisons run against the provider's contracts. The workspace's publish rate limit applies.
Each declared operation becomes one Synchronous/HTTP interaction per response status the consumer reads, carrying only the declared fields. Sample values are the specification's own examples (media-type example / examples, then the schema's example, examples, default, const or first enum value, then a parameter's example). Response bodies carry a cascading type matcher at $, so the provider must return the same shape, not the same values.
Nothing is dropped silently. findings lists every value that had to be invented (placeholder, e.g. no-example, status-range) and everything that could not be written (omitted, e.g. field-not-found, status-default, media-type-not-json, contract-unresolved).
consumer.name is the pacticipant bound to this consumer, else the consumer's handle. provider.name is provider when given, else the one pacticipant bound to the project, else the project's handle; several bound pacticipants without provider is 409 consumer-pact-export-provider-ambiguous.
Only a picker-declared (manual) revision is exported: a revision from a Pact file or an agent is 422 consumer-pact-export-unsupported-source, and a revision that yields no interaction is 422 consumer-pact-export-empty with its findings.
Requires consumer_contracts:view and pacts:create.
Operation id: publish_consumer_pact_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__pact_publish_post
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for publish a consumer's declared surface to the pact broker.
application/json—PactExportPublishRequest
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for publish a consumer's declared surface to the pact broker. | application/json PactExportPublishResponse |
| 409 | Ambiguous provider, or changed content for a published version. | — |
| 422 | Not exportable. | — |
| 429 | Over the publish budget. | — |
GET /v1/tenants/{tenant_slug}/projects/{project_ref}/consumers/{consumer_ref}/runtime
Compare a consumer's contract with its observed traffic
Per operation, what the consumer declares (its current contract) next to what its bindings show it calls (the usage index, by UTC day):
declared_and_used— declared and called in the window;declared_unused— declared, never called in the window;used_undeclared— called, not declared. To add one to the contract, submit the current selection plus that operation toPUT …/consumers/{consumer_ref}/contract.
A consumer with no contract (contract_state: undeclared) reports everything it calls as used_undeclared. anonymous reports the traffic no binding attributes.
Requires consumer_contracts:view.
Operation id: read_consumer_runtime_v1_tenants__tenant_slug__projects__project_ref__consumers__consumer_ref__runtime_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_ref | path | string | yes | Path parameter identifying the project ref segment. |
consumer_ref | path | string | yes | Path parameter identifying the consumer ref segment. |
days | query | integer | no | Window in UTC days, ending today. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for compare a consumer's contract with its observed traffic. | application/json ConsumerRuntime |
| 422 | Validation Error | application/json HTTPValidationError |
Schemas used
AvailableSurfaceResponse
The picker's catalogue for one stored version.
| Property | Type | Required | Description |
|---|---|---|---|
version_record_id | string | yes | The revision the catalogue was built from. |
version_label | string or null | no | That revision's label. |
operations | array of AvailableOperationOut | no | Operations. |
count | integer | yes | How many operations the specification declares. |
truncated | boolean | no | True when any operation's field list was cut short by the walk limits. |
BindingInput
A binding to create.
Attributes:
kind: header, api_key, jwt_claim or user_agent.
name: The header name, the API-key header name, the JWT claim name, or the user-agent glob.
value: The value to recognise (not for user_agent). Accepted once, hashed, and never
stored or returned.
| Property | Type | Required | Description |
|---|---|---|---|
kind | enum "header", "api_key", "jwt_claim", "user_agent" | yes | What identifies the consumer in traffic. |
name | string | yes | The header name (x-client-id), the header carrying the API key (x-api-key), the JWT claim (azp), or for user_agent a glob such as billing-service/*. |
value | string (password) or null | no | The value to recognise. Required for header, api_key and jwt_claim; refused for user_agent. Hashed before it is stored and never returned. |
BindingRecord
A stored binding as every response shows it — never with its value or its hash.
Attributes:
id: Row id.
consumer_id: The consumer it attributes traffic to.
kind: The binding kind.
name: The header or claim name, or the user-agent glob.
hashed: Whether a value is bound (every kind but user_agent).
key_version: The master-key version the value was hashed under.
last_matched_at: When traffic last matched it.
created_at: When it was created.
deleted_at: When it was deleted (it stops matching; history keeps it).
| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | Stable resource identifier. |
consumer_id | string | yes | Consumer ID. |
kind | string | yes | Kind. |
name | string | yes | Human-readable name. |
hashed | boolean | yes | True when a value is bound; the value itself is never returned. |
key_version | integer or null | no | Key Version. |
last_matched_at | string or null | no | Last Matched At timestamp (ISO 8601). |
created_at | string or null | no | Creation timestamp (ISO 8601). |
deleted_at | string or null | no | Deleted At timestamp (ISO 8601). |
BindingsDeletedResponse
What DELETE …/bindings deleted and, with erase=true, re-attributed (RDG-5.4).
| Property | Type | Required | Description |
|---|---|---|---|
consumer | string | yes | The consumer's slug. |
erased | boolean | yes | Whether the consumer's counters were re-attributed to anonymous. |
bindings | integer | yes | Bindings deleted. |
hourly_rows | integer | no | Hourly counter rows re-attributed to anonymous. |
daily_rows | integer | no | Daily rollup rows re-attributed to anonymous. |
calls | integer | no | Calls those daily rows counted (kept, now anonymous). |
unattributed_rows | integer | no | Suggested-consumer rows carrying its hashes, deleted. |
edges | integer | no | Runtime dependency-graph edges from the consumer, deleted. |
ConsumerBindingBindingListResponse
A consumer's bindings.
| Property | Type | Required | Description |
|---|---|---|---|
bindings | array of BindingRecord | no | Newest first. |
count | integer | yes | How many bindings were returned. |
has_more | boolean | no | Whether another page exists. |
next_cursor | string or null | no | Pass as cursor to read the next page; null on the last page. |
ConsumerContractRecord
One stored contract revision.
Attributes:
id: Row id.
consumer_id: The consumer this revision belongs to.
revision: Per-consumer counter, from 1.
is_current: Whether this is the consumer's current revision.
source: pact, manual or agent (CDG-5.2).
version_id: The specification revision the pointers were resolved against.
version_label: That revision's version label, snapshotted.
surface: The declared surface.
operation_count: How many operations it declares.
field_count: How many fields it declares.
unresolved: Interactions that could not be placed.
unresolved_count: How many of those there are.
source_metadata: Pact provenance; empty for a manual declaration.
source_digest: sha256:<hex> of the uploaded Pact document, when there was one.
note: Free text explaining the revision.
actor_label: Who declared it, at the time.
created_at: When it was declared (ISO-8601).
| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | Stable resource identifier. |
consumer_id | string | yes | Consumer ID. |
revision | integer | yes | Revision. |
is_current | boolean | no | Whether current. |
source | string | no | Provenance source for the record (for example human or imported). |
version_id | string or null | no | Project version identifier or semantic version label, depending on context. |
version_label | string or null | no | Version Label. |
surface | ConsumerContractSurface | no | Surface. |
operation_count | integer | no | Number of operation. |
field_count | integer | no | Number of field. |
unresolved | array of UnresolvedInteraction | no | Unresolved. |
unresolved_count | integer | no | Number of unresolved. |
source_metadata | object | no | Source Metadata. |
source_digest | string or null | no | Source Digest. |
note | string or null | no | Note. |
actor_label | string or null | no | Actor Label. |
created_at | string or null | no | Creation timestamp (ISO 8601). |
ConsumerDetailResponse
One consumer with its current contract, when it has declared one.
| Property | Type | Required | Description |
|---|---|---|---|
consumer | ConsumerRecord | yes | Consumer. |
contract | ConsumerContractRecord or null | no | The current contract revision, or null when none is declared. |
ConsumerInput
A new consumer, as a caller defines one.
Attributes:
slug: Stable handle. Derived from name when omitted.
name: Display name.
description: What this consumer is.
owner: Free text — the team, squad, channel, or person accountable.
contact: Email or URL to notify when this consumer's contract would break.
metadata: Non-secret free-form context (repository, environment, CI job).
| Property | Type | Required | Description |
|---|---|---|---|
slug | string or null | no | URL-safe identifier. |
name | string | yes | Human-readable name. |
description | string or null | no | Free-text description. |
owner | string or null | no | Owner. |
contact | string or null | no | Contact. |
metadata | object | no | Additional JSON metadata bag. |
ConsumerListResponse
Every live consumer of a project with its current contract.
| Property | Type | Required | Description |
|---|---|---|---|
consumers | array of ConsumerSummary | no | The project's consumers, newest first. |
count | integer | yes | How many consumers were returned. |
has_more | boolean | no | Whether another page exists. |
next_cursor | string or null | no | Pass as cursor to read the next page; null on the last page. |
ConsumerPatch
A partial update. Omitted fields are left alone.
slug is deliberately absent: it is the handle CI and Pact files name, and renaming it
would silently orphan every reference to it.
| Property | Type | Required | Description |
|---|---|---|---|
name | string or null | no | Human-readable name. |
description | string or null | no | Free-text description. |
owner | string or null | no | Owner. |
contact | string or null | no | Contact. |
metadata | object or null | no | Additional JSON metadata bag. |
ConsumerRecord
A stored consumer.
Attributes: id: Row id. tenant_id: Owning tenant. project_id: Project this consumer consumes. slug: Stable handle. name: Display name. description: What this consumer is. owner: Accountable team or person. contact: Where to reach them. metadata: Free-form non-secret context. created_at: When it was registered. updated_at: When it was last changed. deleted_at: Retirement stamp, when retired. runtime_last_seen_at: When usage traffic last attributed to it through a binding (RDG-1.8).
| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | Stable resource identifier. |
tenant_id | string | yes | Tenant that owns the resource. |
project_id | string | yes | Project identifier the resource belongs to. |
slug | string | yes | URL-safe identifier. |
name | string | yes | Human-readable name. |
description | string or null | no | Free-text description. |
owner | string or null | no | Owner. |
contact | string or null | no | Contact. |
metadata | object | no | Additional JSON metadata bag. |
created_at | string or null | no | Creation timestamp (ISO 8601). |
updated_at | string or null | no | Last update timestamp (ISO 8601). |
deleted_at | string or null | no | Deleted At timestamp (ISO 8601). |
runtime_last_seen_at | string or null | no | Runtime Last Seen At timestamp (ISO 8601). |
ConsumerRuntime
Declared versus observed for one consumer.
| Property | Type | Required | Description |
|---|---|---|---|
consumer_id | string or null | no | Null for the anonymous consumer. |
slug | string | yes | URL-safe identifier. |
name | string | yes | Human-readable name. |
contract_state | string | yes | declared, undeclared, or none (anonymous). |
since_day | string | yes | First UTC day of the window. |
until_day | string | yes | Last UTC day of the window. |
summary | RuntimeSummary | yes | Short summary suitable for navigation and reference docs. |
declared_and_used | array of RuntimeOperation | no | Declared And Used. |
declared_unused | array of RuntimeOperation | no | Declared Unused. |
used_undeclared | array of RuntimeOperation | no | Used Undeclared. |
ConsumerUsageResponse
Consumer usage of one stored version.
Attributes: version_record_id: The revision the usage is bound to. version_label: That revision's label. consumers_visible: Whether consumer names are included for this reader. consumer_count: Consumers whose current contract was resolved against this revision. other_version_consumer_count: Consumers whose current contract names another revision. undeclared_consumer_count: Consumers registered but with no contract yet. operations: Per-operation usage, ordered by pointer. schemas: Per-component-schema usage, ordered by pointer.
| Property | Type | Required | Description |
|---|---|---|---|
version_record_id | string | yes | Revision the usage is bound to. |
version_label | string or null | no | That revision's label. |
consumers_visible | boolean | yes | Whether consumer names are included — requires consumer_contracts:view. |
consumer_count | integer | yes | Consumers whose current contract was resolved against this revision. |
other_version_consumer_count | integer | yes | Consumers whose current contract names another revision; not projected. |
undeclared_consumer_count | integer | yes | Registered consumers that have declared no contract yet. |
operations | array of OperationUsage | no | Per-operation usage. |
schemas | array of SchemaUsage | no | Per-schema usage. |
ContractResponse
A stored contract revision plus the consumer it belongs to.
| Property | Type | Required | Description |
|---|---|---|---|
consumer | ConsumerRecord | yes | Consumer. |
contract | ConsumerContractRecord | yes | Contract. |
unresolved | array of UnresolvedInteraction | no | Interactions or fields that could not be resolved against the specification. Repeated from the stored contract so an importing client sees them without a second read; they are never silently dropped. |
ContractRevisionsResponse
A consumer's contract history.
| Property | Type | Required | Description |
|---|---|---|---|
revisions | array of ConsumerContractRecord | no | Revisions, newest first. |
count | integer | yes | How many revisions were returned. |
HTTPValidationError
Validation error response emitted when request data fails schema checks.
| Property | Type | Required | Description |
|---|---|---|---|
detail | array of ValidationError | no | Detail. |
PactExportPublishRequest
Publish the generated pact for one consumer version.
| Property | Type | Required | Description |
|---|---|---|---|
consumer_version | string | yes | The consumer build's version. |
branch | string or null | no | The branch it was built from. |
tags | array of string | no | Tags for the consumer version. |
build_url | string or null | no | http(s) URL of the CI build. |
revision | integer or null | no | A contract revision; defaults to the current one. |
provider | string or null | no | The provider pacticipant name; see the export endpoint. |
PactExportPublishResponse
The generated pact, plus what the broker stored and the comparisons it ran.
| Property | Type | Required | Description |
|---|---|---|---|
consumer_name | string | yes | consumer.name in the pact (the pacticipant it publishes as). |
provider_name | string | yes | provider.name in the pact. |
consumer_pacticipant_bound | boolean | yes | Whether the consumer name is that of a pacticipant bound to this consumer. |
provider_pacticipant_bound | boolean | yes | Whether the provider name is that of the pacticipant bound to this project. |
revision | integer | yes | The contract revision the pact was generated from. |
version_record_id | string | yes | The specification revision the examples were read from. |
version_label | string or null | no | That revision's label. |
interaction_count | integer | yes | How many interactions the pact carries. |
placeholder_count | integer | yes | How many values were invented because no example exists. |
omitted_count | integer | yes | How many declared items could not be written at all. |
findings | array of ExportFinding | no | Every placeholder and omission, with a stable reason code. Never silently empty. |
operations | array of ExportOperation | no | What each declared operation became: the interactions it wrote (indexes into pact.interactions) and its finding counts. An operation with no interaction was left out; its omitted finding gives the reason. |
pact | object | yes | The Pact v4 document. |
publish | object | yes | The Pact Broker publish result, exactly as POST …/pact-broker/contracts/publish returns it: notices, the embedded pacticipant and version, pb:contracts and, when the provider has a provider contract, comparisons. |
PactExportResponse
A generated pact and what it could not say.
| Property | Type | Required | Description |
|---|---|---|---|
consumer_name | string | yes | consumer.name in the pact (the pacticipant it publishes as). |
provider_name | string | yes | provider.name in the pact. |
consumer_pacticipant_bound | boolean | yes | Whether the consumer name is that of a pacticipant bound to this consumer. |
provider_pacticipant_bound | boolean | yes | Whether the provider name is that of the pacticipant bound to this project. |
revision | integer | yes | The contract revision the pact was generated from. |
version_record_id | string | yes | The specification revision the examples were read from. |
version_label | string or null | no | That revision's label. |
interaction_count | integer | yes | How many interactions the pact carries. |
placeholder_count | integer | yes | How many values were invented because no example exists. |
omitted_count | integer | yes | How many declared items could not be written at all. |
findings | array of ExportFinding | no | Every placeholder and omission, with a stable reason code. Never silently empty. |
operations | array of ExportOperation | no | What each declared operation became: the interactions it wrote (indexes into pact.interactions) and its finding counts. An operation with no interaction was left out; its omitted finding gives the reason. |
pact | object | yes | The Pact v4 document. |
PactImportRequest
A Pact document to import.
Attributes:
pact: The Pact document as raw JSON text.
consumer_slug: The handle to store it under. Derived from the document's own
consumer.name when omitted, which is what lets a CI job upload a pact for a
service that has never been registered.
consumer_name: Display name for a consumer this import registers.
version: Version label, revision id, or latest to resolve the interactions against.
note: Free text explaining the revision.
| Property | Type | Required | Description |
|---|---|---|---|
pact | string | yes | The Pact document as raw JSON text. |
consumer_slug | string or null | no | Consumer Slug. |
consumer_name | string or null | no | Consumer Name. |
version | string or null | no | Version. |
note | string or null | no | Note. |
RegisterSuggestionInput
How to register a suggestion.
Attributes: name: Display name for a new consumer (defaults to the suggestion's). slug: Handle for a new consumer (defaults to the suggestion's). consumer: Bind to this existing consumer (slug or id) instead of registering a new one. binding_name: For a hashed client: the header, API-key header or claim name.
| Property | Type | Required | Description |
|---|---|---|---|
name | string or null | no | Human-readable name. |
slug | string or null | no | URL-safe identifier. |
consumer | string or null | no | Consumer. |
binding_name | string or null | no | Binding Name. |
RegisteredSuggestion
What registering did.
| Property | Type | Required | Description |
|---|---|---|---|
consumer | ConsumerRecord | yes | Consumer. |
binding | BindingRecord | yes | Binding. |
created_consumer | boolean | yes | False when the client was bound to an existing consumer. |
SuggestionListResponse
A project's suggested consumers.
| Property | Type | Required | Description |
|---|---|---|---|
suggestions | array of SuggestedConsumer | no | Busiest first. |
count | integer | yes | How many suggestions were returned. |
window_days | integer | yes | The window they were drawn from, in UTC days ending today. |
SurfaceSelection
A whole picked surface, as the UI picker submits it.
Attributes: operations: The picked operations. Refused when empty — an empty contract declares nothing and would silently exempt the consumer from every future analysis. note: Optional free text explaining the revision.
| Property | Type | Required | Description |
|---|---|---|---|
operations | array of SelectedOperation | no | Operations. |
note | string or null | no | Note. |