Skip to main content
POST
/
credentials
Create a credential
curl --request POST \
  --url https://api.deck.co/v2/credentials \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "source_id": "<string>",
  "auth_method": "<string>",
  "auth_credentials": "<unknown>",
  "external_id": "<string>"
}
'
{
  "id": "<string>",
  "object": "<string>",
  "status": "<string>",
  "external_id": "<string>",
  "source_id": "<string>",
  "auth_method": "<string>",
  "auth_credentials": {
    "username": "<string>",
    "key": "<string>"
  },
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "request_id": "<string>"
}

Authorizations

Authorization
string
header
required

Secret key (sk_live_...)

Body

Request body for creating a new credential.

source_id
string
required

The source to authenticate against. Prefixed with src_.

auth_method
null | string

Authentication method for the source. One of username_password or none. Defaults to none if not provided.

auth_credentials
any

Credentials payload. Structure depends on auth_method. For username_password, pass { "username": "...", "password": "..." }.

external_id
null | string

An identifier from your system to associate with this credential. Max 255 characters. See the external IDs guide for multi-tenant patterns.

Response

Created

id
string
required

Unique identifier for the credential, prefixed with cred_.

object
string
required

Always credential.

status
string
required

Credential status: unverified, verified, invalid, or deleted.

external_id
null | string
required

External identifier from your system, if set.

source_id
string
required

The source this credential authenticates against. Prefixed with src_.

auth_method
string
required

Authentication method: username_password or none.

auth_credentials
object
required

Summary of stored credentials. Sensitive values are not returned.

created_at
string<date-time>
required

ISO 8601 timestamp of when the resource was created.

updated_at
string<date-time>
required

ISO 8601 timestamp of when the resource was last updated.

request_id
string
required

Unique identifier for the API request. Include this when contacting support.