Skip to content

Create Credential

POST/v5/credentials

Create a new credential for storing sensitive data like API keys, tokens, or other secrets.

Body ParametersJSONExpand Collapse
name: string

User-friendly name for the credential

minLength1
payload: string

The credential payload to be encrypted

minLength1
formatpassword
type: string

Type of credential: key or json

minLength1
credential_metadata: optional map[unknown]

Optional unencrypted credential_metadata

description: optional string

Optional description

ReturnsExpand Collapse
Credential object { id, created_at, created_by_identity_type, 7 more }
id: string
created_at: string
formatdate-time
created_by_identity_type: string
created_by_user_id: string
credential_metadata: map[unknown]
description: string
name: string
type: string
updated_at: string
formatdate-time
object: optional string

Create Credential

curl https://api.egp.scale.com/v5/credentials \
    -H 'Content-Type: application/json' \
    -H "x-api-key: $SGP_API_KEY" \
    -d '{
          "name": "x",
          "payload": "x",
          "type": "x"
        }'
{
  "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"
}