Skip to main content
GET
Get 2FA code
Note:
  • Both permissioned_user_id and domain are required.
  • If the entry has more than one 2FA method, pass method (AUTHENTICATOR, EMAIL, SMS or MAGIC_LINK); otherwise a 400 is returned. A method the entry does not have returns 409.
  • Pass field with the name of a Totp additional field to get that field’s current code. field implies AUTHENTICATOR; combining it with another method returns 400. A missing field returns 404; a field that is not Totp returns 400.
  • For authenticator (TOTP) credentials, a fresh code is generated and the response includes expires_in_seconds.
  • For email credentials, the most recently received code is returned if it arrived within the freshness window; otherwise a 404 is returned. The response includes received_at.
  • SMS and magic-link credentials are not supported on this endpoint (409). SMS codes arrive at a single shared phone number with no per-credential marker (and the message body often has no service name), so they can’t be reliably attributed to the requested credential — use email or authenticator.
  • Codes are returned with Cache-Control: no-store. Do not log or cache them.

Authorizations

cc-key
string
header
required

API key-based authentication. Provide your CloudCruise API key in the cc-key header.

Query Parameters

permissioned_user_id
string
required

Unique identifier for the vault entry.

domain
string
required

Target domain of the vault entry.

method
enum<string>

2FA method to read. Required when the entry has more than one method. Must be one of the entry's tfa_methods.

Available options:
AUTHENTICATOR,
EMAIL,
SMS,
MAGIC_LINK
field
string

Name of a Totp additional field on the entry. Returns that field's current code (type is authenticator). Implies method=AUTHENTICATOR.

Response

2FA code successfully retrieved.

The current 2FA code for a vault entry. expires_in_seconds is present for authenticator (TOTP) codes; received_at is present for email/SMS codes.

type
enum<string>
required

The 2FA method this code was produced for.

Available options:
authenticator,
email
code
string
required

The one-time code.

Example:

"123456"

expires_in_seconds
integer

Seconds until the authenticator code rotates (authenticator only).

Example:

23

received_at
string<date-time>

When the email/SMS code was received (email/SMS only).