TokenVaultProviders

Create a shared credential for a provider

Changed on

Creates a shared credential for a provider. For a static_secret provider, stores a literal secret value (at most one, a second create returns 409). For a shared authorization_code provider, mints an OAuth enrollment URL for an admin to complete once instead of accepting a secret value.

post/v2/directories/{directoryId}/vault/providers/{providerId}/credentials

Request

  • Base URL
    https://global.api.konghq.com
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or HTTP bearer
    • or HTTP bearer

Path parameters

directoryId, string uuid required

ID of the directory

providerId, string uuid required

ID of the vault provider

Request body

SetVaultProviderCredentialBody required

The secret to store. Required and used verbatim for a static_secret provider. Must be omitted for a shared authorization_code provider, where the response instead carries an enrollment_url for an admin to complete OAuth consent.

secret, string

Pre-issued static credential (API key, PAT, etc.). Stored encrypted, never returned in read APIs.

selector, string

CEL expression deciding which callers this credential applies to. Omit to make it the provider's default, which applies to every caller and is considered after all the others.

priority, integer

Order in which this credential is considered, lowest first. Required with a selector, and must be omitted without one.

Response

Shared credential metadata (never includes the value)

VaultProviderCredentialShared required
id, string uuid

Contains a unique identifier used for this resource.

created_at, string date-time
updated_at, string date-time
credential_type, 'shared' required
selector, string nullable

CEL expression deciding which callers this credential applies to. Omit to make it the provider's default, which applies to every caller and is considered after all the others.

priority, integer nullable

Order in which this credential is considered, lowest first. Required with a selector, and must be omitted without one.

status, 'pending' | 'active' required

"pending" until admin enrollment completes; "active" once the secret exists.

enrollment_url, string nullable

URL to complete OAuth consent. Fresh on every get-by-id call; set on create for a shared authorization_code provider. Omitted from list responses.

Example response

{
  "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7"
}

Changes