Skip to content

Update Credential

credentials.update(strcredential_id, CredentialUpdateParams**kwargs) -> Credential
PATCH/v5/credentials/{credential_id}

Update an existing credential’s properties including name, description, type, payload, and metadata.

ParametersExpand Collapse
credential_id: str
credential_metadata: Optional[Dict[str, object]]

Optional unencrypted credential_metadata

description: Optional[str]

Optional description

name: Optional[str]

User-friendly name for the credential

payload: Optional[str]

The credential payload to be encrypted

formatpassword
type: Optional[str]

Type of credential: key or json

ReturnsExpand Collapse
class Credential: …
id: str
created_at: datetime
formatdate-time
created_by_identity_type: Optional[str]
created_by_user_id: Optional[str]
credential_metadata: Optional[Dict[str, object]]
description: Optional[str]
name: str
type: str
updated_at: datetime
formatdate-time
object: Optional[str]

Update Credential

import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
credential = client.credentials.update(
    credential_id="credential_id",
)
print(credential.id)
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by_identity_type": "created_by_identity_type",
  "created_by_user_id": "created_by_user_id",
  "credential_metadata": {
    "foo": "bar"
  },
  "description": "description",
  "name": "name",
  "type": "type",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "object": "object"
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by_identity_type": "created_by_identity_type",
  "created_by_user_id": "created_by_user_id",
  "credential_metadata": {
    "foo": "bar"
  },
  "description": "description",
  "name": "name",
  "type": "type",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "object": "object"
}