---
title: "Send TOTP code"
method: POST
path: "/v1/credentials/totp"
tags: ["Credentials"]
---

# Send TOTP code

`POST /v1/credentials/totp`

Forward a TOTP (2FA, MFA) email or sms message containing the code to Skyvern. This endpoint stores the code in database so that Skyvern can use it while running tasks/workflows.

## Headers

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

## Request body

- TOTPCodeCreate
  - `totp_identifier` string, required — The identifier of the TOTP code. It can be the email address, phone number, or the identifier of the user.
  - `task_id` string, nullable — The task_id the totp code is for. It can be the task_id of the task that the TOTP code is for.
  - `workflow_id` string, nullable — The workflow ID the TOTP code is for. It can be the workflow ID of the workflow that the TOTP code is for.
  - `workflow_run_id` string, nullable — The workflow run id that the TOTP code is for. It can be the workflow run id of the workflow run that the TOTP code is for.
  - `source` string, nullable — An optional field. The source of the TOTP code. e.g. email, sms, etc.
  - `content` string, required — The content of the TOTP code. It can be the email content that contains the TOTP code, or the sms message that contains the TOTP code. Skyvern will automatically extract the TOTP code from the content.
  - `expired_at` string, date-time, nullable — The timestamp when the TOTP code expires
  - `type` 'totp' | 'magic_link'

## Response `200`

Successful Response

- TOTPCode
  - `totp_identifier` string, required — The identifier of the TOTP code. It can be the email address, phone number, or the identifier of the user.
  - `task_id` string, nullable — The task_id the totp code is for. It can be the task_id of the task that the TOTP code is for.
  - `workflow_id` string, nullable — The workflow ID the TOTP code is for. It can be the workflow ID of the workflow that the TOTP code is for.
  - `workflow_run_id` string, nullable — The workflow run id that the TOTP code is for. It can be the workflow run id of the workflow run that the TOTP code is for.
  - `source` string, nullable — An optional field. The source of the TOTP code. e.g. email, sms, etc.
  - `content` string, required — The content of the TOTP code. It can be the email content that contains the TOTP code, or the sms message that contains the TOTP code. Skyvern will automatically extract the TOTP code from the content.
  - `expired_at` string, date-time, nullable — The timestamp when the TOTP code expires
  - `type` 'totp' | 'magic_link'
  - `totp_code_id` string, required — The skyvern ID of the TOTP code.
  - `code` string, required — The TOTP code extracted from the content.
  - `organization_id` string, required — The ID of the organization that the TOTP code is for.
  - `created_at` string, date-time, required — The timestamp when the TOTP code was created.
  - `modified_at` string, date-time, required — The timestamp when the TOTP code was modified.
  - `otp_type` 'totp' | 'magic_link'

## Other responses

- `402` — Insufficient credits to parse OTP content
- `422` — Validation Error

---

[API](https://skmtc.net/skyvern-ai/apis/skyvern-api-2.md) · [All operations](https://skmtc.net/skyvern-ai/apis/skyvern-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/skyvern-ai/skyvern-api-2/versions/5116249dfff3/schema)
