Skip to main content

Secrets for webhooks and verification targets

A workspace can now keep a token, an API key or a signing secret once, sealed in the credential vault, and have contract webhooks and verification targets refer to it by name instead of each holding a copy. See Secrets for webhooks and targets.

  • Workspace secrets. POST /v1/tenants/{tenant}/pact-secrets with a name and a value. The value is never returned, logged or repeated in an error; a secret reads its reference (${user.<name>}) and which webhooks and targets use it.
  • In webhooks. Write ${user.<name>} in a header, the URL's path or query, the body, the basic-auth password, a GitHub target's token or the signing secret — PactFlow's syntax. The secret must exist when you save the webhook, and its value is put in only when the webhook is sent.
  • In verification targets. Set auth to {"kind": "secret", "scheme": "bearer", "ref": "<name>"}; hosted verification and contract-suite runs read the value when they start.
  • Rotate once. PUT …/pact-secrets/{id} with a new value changes every webhook and target that uses it. A secret still in use cannot be deleted: the answer names what uses it.

Reading secrets needs Pacts → View, creating Create, rotating Edit, deleting Delete; each change is in the access audit. REST API 1.688.0.