Credentials

Update credential

Changed on

Update a credential's name or values. When values are provided, they are merged with existing values (new keys are added, existing keys are overwritten).

patch/credentials/{id_or_name}

Request

  • Base URL
    https://api.onkernel.com
  • URL
    https://api.onkernel.com/credentials/{id_or_name}
  • Auth
    HTTP bearer

Path parameters

id_or_namestring required

Credential ID or name

Request body

namestring

New name for the credential

remove_value_keysstring[]

Field names to remove from the credential's stored values. Removals are applied before values are merged, so a key present in both is kept with its new value.

sso_providerstring nullable

If set, indicates this credential should be used with the specified SSO provider. Set to empty string or null to remove.

totp_algorithm'SHA1' | 'SHA256' | 'SHA512'

HMAC algorithm used to generate TOTP codes. Requires totp_secret and is ignored when an otpauth:// URI supplies the algorithm.

totp_digitsinteger

Number of digits in generated TOTP codes. Requires totp_secret and is ignored when an otpauth:// URI supplies the digit count.

totp_periodinteger

TOTP rotation period in seconds. Requires totp_secret and is ignored when an otpauth:// URI supplies the period.

totp_secretstring

Accepts a 16-128 character base32-encoded TOTP secret or an otpauth://totp/... URI. Only URI parameters present override the corresponding explicit TOTP fields. When rotating a raw secret, omitted fields preserve their existing values; a new URI defaults unspecified fields to SHA1/6/30. Set to empty string to remove the secret and its metadata.

valuesobject

Field name to value mapping. Values are merged with existing values (new keys added, existing keys overwritten).

Example request

{
  "name": "my-updated-login",
  "remove_value_keys": [
    "old_field"
  ],
  "sso_provider": "google",
  "totp_algorithm": "SHA1",
  "totp_digits": 6,
  "totp_period": 30,
  "totp_secret": "JBSWY3DPEHPK3PXP",
  "values": {
    "password": "newpassword",
    "username": "user@example.com"
  }
}

Response

Credential updated successfully

created_atstring date-time required

When the credential was created

domainstring required

Target domain this credential is for

has_totp_secretboolean

Whether this credential has a TOTP secret configured for automatic 2FA

has_valuesboolean

Whether this credential has stored values (email, password, etc.)

idstring required

Unique identifier for the credential

namestring required

Unique name for the credential within the project

sso_providerstring nullable

If set, indicates this credential should be used with the specified SSO provider (e.g., google, github, microsoft). When the target site has a matching SSO button, it will be clicked first before filling credential values on the identity provider's login page.

totp_algorithm'SHA1' | 'SHA256' | 'SHA512'

HMAC algorithm used to generate TOTP codes. Defaults to SHA1 for credentials created before this metadata was stored.

totp_codestring

Current TOTP code. Only included in create/update responses when totp_secret was just set.

totp_code_expires_atstring date-time

When the totp_code expires. Only included when totp_code is present.

totp_digitsinteger

Number of digits in generated TOTP codes. Defaults to 6 for credentials created before this metadata was stored.

totp_periodinteger

TOTP rotation period in seconds. Defaults to 30 for credentials created before this metadata was stored.

updated_atstring date-time required

When the credential was last updated

value_keysstring[]

The field names stored in this credential's values (e.g., username, password). Values themselves are never returned. Included on single-credential responses (create, get by id or name, update); omitted from list responses.

Example response

{
  "created_at": "2025-01-15T10:30:00Z",
  "domain": "netflix.com",
  "has_values": true,
  "id": "cred_abc123xyz",
  "name": "my-netflix-login",
  "sso_provider": "google",
  "totp_algorithm": "SHA1",
  "totp_code": "847291",
  "totp_code_expires_at": "2025-01-15T10:30:30Z",
  "totp_digits": 6,
  "totp_period": 30,
  "updated_at": "2025-01-15T10:30:00Z",
  "value_keys": [
    "username",
    "password"
  ]
}

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status