VocalDocscontracts 1.65.0

Enter or rotate the Organization's credential for a Provider

PUT /v1/provider-credentials/{provider}

PropertyValue
Operationput_provider_credential
GroupProviders and credentials
Scopecredentials:write
Route classcontrol
IdempotencyNo Idempotency-Key
AuditAudited provider_credential.put (mutation)
Released in1.28.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Checks the key with the vendor where the vendor offers a cheap read, then seals it as the Provider's next version for the caller's Organization and revokes the active one (1.28.0). From then on every chain entry of the Organization's Calls that names the Provider runs on this key; running Calls keep the version they were issued. A Provider whose descriptors do not list byok is refused with validation_failed and the issue credential_mode_unavailable; a key the vendor refuses, with validation_failed and the issue credential_invalid; a vendor that does not answer, with dependency_unavailable; in each case nothing is stored. The request body is never logged, never stored in clear and never returned; the response and the Audit event name the Provider, the version and the verification outcome, never the secret or the hint. Session only: the api refuses the route to every API key, whatever its scopes, and accepts a Member ID token with credentials:write.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the credentials:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X PUT "$VOCAL_API/v1/provider-credentials/mock" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "secret": "<secret>" }'

Parameters

NameInTypeRequiredDescription
providerpathProviderIdyesA Provider: a vendor or in-process model behind a stage. The provider catalog says which stages each serves and whether it is available. From 1.38.0 openai is deprecated (workspace ADR 0085): its descriptors read deprecated, a deprecated Provider still resolves, and the id is kept until a major release; deepseek is new. From 1.53.0 amazon_titan serves embeddings, reserved until its adapter is built.

Request body

Content type application/json, required: ProviderCredentialPutRequest.

FieldTypeRequiredDescription
labelstringnoA note on the key.
secretstring (password)yesThe vendor key, sent once. The api seals it, never logs it and never returns it.

Responses

StatusContent typeShapeError codes
200application/jsonProviderCredential
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error
503application/jsonErrorEnvelopedependency_unavailable

Fields of the 200 answer

The shape is ProviderCredential.

FieldTypeRequiredDescription
accountVendorAccountUsagenoThe last reading the api took of the vendor account behind the key (1.40.0): its status, the units used and allowed and the plan's tier. Absent when the api has taken none, when the vendor has no account request, or from an api older than 1.40.0. A key that passed can still read exhausted.
created_atTimestampyes
created_byActorRefyes
hintstringyesThe last four characters of the secret, to tell keys apart; never more.
idProviderCredentialIdyesThe credential id, the key id the Session configuration and the trace name for a stage on this key.
labelstring or nullyesA note of the Member who entered the key, or null.
object"provider_credential"yes
providerProviderIdyes
revoked_atTimestamp or nullyesNull while the version is active.
statusProviderCredentialStatusyes
verificationProviderCredentialVerificationyes
verified_atTimestamp or nullyesWhen the vendor answered the check; null when the check is not_offered.
versionintegeryesCounts the Organization's entries for the Provider from 1.