Skip to main content
Credentials

Update a Credential

Forward API reference.

Description

Updates an active Credential in place under the specified Vault. The request uses merge-style patch semantics: omitted fields keep their current values, which supports secret rotation without recreating the Credential. Forward verifies that the caller has write access to the parent Vault. Sensitive authentication fields are write-only and are never echoed in the response.

Path

POST /api/v1/forward/vaults/{id}/credentials/{cred_id}

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>
Content-TypeYesapplication/json

Path parameters

ParameterTypeRequiredDescription
idstringYesVault ID.
cred_idstringYesCredential ID.

Query parameters

ParameterTypeRequiredDescription
identity_idstringNoOptional; used only for Identity-owned resources. PAT callers can pass it explicitly; omitting it uses the administrator scope. For SAT, issue an Identity-scoped token and do not explicitly pass this parameter, or the request returns HTTP 400. See Identity ownership.

Request body

The request uses partial-update semantics. Only auth and metadata are accepted, and at least one field is required.
FieldTypeRequiredDescription
authobjectNoPartially updates authentication information for the current Credential type. It must include a type that matches the current type.
metadataobject | nullNoApplies a merge patch to the existing metadata. A null value in the object removes that key; top-level null clears all metadata. created_by is reserved and cannot be updated.
The Credential type, MCP Server URL, environment-variable secret_name, and the client_id and token_endpoint in an OAuth refresh configuration cannot be changed through this endpoint.

static_bearer

FieldTypeRequiredDescription
typestringYesMust be static_bearer.
tokenstringNoReplaces the Bearer token. Write-only and never returned in responses.

mcp_oauth

FieldTypeRequiredDescription
typestringYesMust be mcp_oauth.
access_tokenstringNoReplaces the access token.
expires_atstring | nullNoRFC 3339 time. Use null to clear the expiration time.
refreshobjectNoPartially updates the existing refresh configuration. It cannot add a refresh configuration to a Credential that does not already have one.
The refresh object supports:
FieldTypeRequiredDescription
refresh_tokenstringNoReplaces the refresh token.
scopestring | nullNoReplaces or clears the scope.
token_endpoint_authobjectNoUpdates the token endpoint authentication configuration.

environment_variable

FieldTypeRequiredDescription
typestringYesMust be environment_variable.
secret_valuestringNoReplaces the secret value. Write-only and never returned in responses.

Example request

curl -X POST "https://api.qoder.com/api/v1/forward/vaults/vault_xxx/credentials/vcred_xxx" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "auth": {
      "type": "static_bearer",
      "token": "new-secret-token"
    },
    "metadata": {
      "rotated_by": "console"
    }
  }'

Example response

HTTP 200 OK
{
  "id": "vcred_xxx",
  "type": "vault_credential",
  "vault_id": "vault_xxx",
  "auth": {
    "type": "static_bearer",
    "mcp_server_url": "https://mcp.example.com"
  },
  "display_name": "",
  "metadata": {
    "rotated_by": "console"
  },
  "archived_at": null,
  "created_at": "2026-07-23T10:00:00Z",
  "updated_at": "2026-08-27T12:00:00Z"
}
The response is a Vault credential object. Token, secret, and other sensitive fields are never returned.
Credential updates are write-only. If the client does not receive a successful response, a subsequent GET can read only the redacted state and cannot prove whether the new secret took effect. Do not automatically retry a secret update.

Errors

HTTPTypeTrigger
400invalid_request_errorThe request body or path parameters are invalid. This includes no updatable fields, unsupported fields, a missing or mismatched auth.type, invalid field values, or an attempt to update refresh when no refresh configuration exists.
400invalid_request_errorIf the reserved key created_by is supplied, message is metadata key "created_by" is reserved.
401authentication_errorThe authentication token is missing or invalid.
403permission_errorThe caller cannot access the parent Vault or Credential.
404not_found_errorThe Vault or Credential does not exist or is not visible.
409conflict_errorThe Vault or Credential is archived, or the resource state conflicts.
500/502/503api_errorForward or a dependent service failed.
Authentication information in Credential requests is sensitive. Some detailed validation messages are replaced by a generic redacted message; the HTTP status and error type remain unchanged.