---
title: "Create credential"
method: POST
path: "/v1/credentials"
tags: ["Credentials"]
---

# Create credential

`POST /v1/credentials`

Creates a new credential for the current organization

## Headers

- `x-api-key` string, nullable — Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings.

## Request body

- CreateCredentialRequest — Request model for creating a new credential.
  - `name` string, required — Name of the credential
  - `credential_type` 'password' | 'credit_card' | 'secret', required — Type of credential stored in the system.
  - `credential` union, required — The credential data to store
    - NonEmptyPasswordCredential — Password credential model that requires non-empty values.
      - `password` string, required — The password value (must not be empty)
      - `username` string, required — The username associated with the credential (must not be empty)
      - `totp` string, nullable — Optional TOTP (Time-based One-Time Password) string used to generate 2FA codes
      - `totp_type` 'authenticator' | 'email' | 'text' | 'none' — Type of 2FA/TOTP method used.
      - `totp_identifier` string, nullable — Identifier (email or phone number) used to fetch TOTP codes
    - NonEmptyCreditCardCredential — Credit card credential model that requires non-empty values.
      - `card_number` string, required — The full credit card number (must not be empty)
      - `card_cvv` string, required — The card's CVV (must not be empty)
      - `card_exp_month` string, required — The card's expiration month (must not be empty)
      - `card_exp_year` string, required — The card's expiration year (must not be empty)
      - `card_brand` string, required — The card's brand (must not be empty)
      - `card_holder_name` string, required — The name of the card holder (must not be empty)
    - SecretCredential — Generic secret credential.
      - `secret_value` string, required — The secret value
      - `secret_label` string, nullable — Optional label describing the secret

## Response `201`

Successful Response

- CredentialResponse — Response model for credential operations.
  - `credential_id` string, required — Unique identifier for the credential
  - `credential` union, required — The credential data
    - PasswordCredentialResponse — Response model for password credentials, containing only the username.
      - `username` string, required — The username associated with the credential
      - `totp_type` 'authenticator' | 'email' | 'text' | 'none' — Type of 2FA/TOTP method used.
      - `totp_identifier` string, nullable — Identifier (email or phone number) used to fetch TOTP codes
    - CreditCardCredentialResponse — Response model for credit card credentials, containing only the last four digits and brand.
      - `last_four` string, required — Last four digits of the credit card number
      - `brand` string, required — Brand of the credit card
    - SecretCredentialResponse — Response model for secret credentials.
      - `secret_label` string, nullable — Optional label for the stored secret
  - `credential_type` 'password' | 'credit_card' | 'secret', required — Type of credential stored in the system.
  - `name` string, required — Name of the credential

## Other responses

- `422` — Validation Error

## Changes

- **2026-02-04** `a8899e7707c4` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/skyvern-ai/apis/skyvern-api-2/changes/v1/credentials/post.md)

---

[API](https://skmtc.dev/skyvern-ai/apis/skyvern-api-2.md) · [All operations](https://skmtc.dev/skyvern-ai/apis/skyvern-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/skyvern-ai/apis/skyvern-api-2/revisions/ec25ca3a20bb?raw)
