---
title: "Two-factor authentication"
url: "https://docs.signnow.com/docs/two-factor-authentication"
type: "page"
section: "Documentation"
slug: "two-factor-authentication"
---

# Two-factor authentication

## About two-factor authentication

Two-factor authentication requires recipients to enter a password or a code before viewing and signing a document.

There are three ways to authenticate a recipient:

- Password
- Code:
  - Received in SMS
  - Received by phone call

Invite authentication is available for the following invite types:

- [Document field invite](/docs/document-field-invite/operations/post-field_invite)
- [Document group field invite](/docs/doc-group-field-invite/operations/invite-to-sign-document-group)
- [Document embedded signing](/docs/document-embedded-signing/operations/create-embedded-signing-invite)

<!-- theme: warning -->

> **Note**: Phone-based two-factor authentication (SMS code and phone call code) requires a paid API plan, an API free trial, or a Site License. It is not available on accounts without an active subscription. Customizing the authentication SMS message (`authentication_sms_message`) has the same requirement.

**Examples of authentication for a document field invite**

<!--
type: tab
title: Password
-->

```json
"authentication_type": "password",
"password": "P@$$word123!"
```

<!--
type: tab
title: Phone call code
-->

```json
"authentication_type": "phone",
"method": "phone_call",
"phone": "+12124567890"
```

<!--
type: tab
title: SMS code
-->

```json
"authentication_type": "phone",
"method": "sms",
"phone": "+12124567890",
"authentication_sms_message": "Your one-time code is {password}"
```

<!-- type: tab-end -->

For SMS authentication, `authentication_sms_message` is optional. You can use it for a custom message with a maximum of 140 symbols. The `{password}` placeholder is required and is automatically populated with a one-time code that a signer needs to enter.

## Send a document field invite with two-factor authentication

### Step 1: Authentication

[Generate](/docs/authentication) a bearer token to authenticate further requests.

### Step 2: Upload document

[Upload](/docs/entities) a document to be signed.

### Step 3: Add fields

[Add](/docs/fields) fields to the document.

### Step 4. Get role ID

Make a [Get document](/docs/document/operations/get-document) request to extract the role or role ID.

```json

curl -X GET \
https://api.signnow.com/document/{{document_id}} \
-H 'Authorization: Bearer {{access_token}}' \

```

The roles array lists role names and IDs. You need either a role or role ID, but you can use both. If you use both, ensure the roles and IDs correspond.

```json

"roles": [
    {
        "unique_id": "6e9580fa76ba4edca18fa6e680a36d10a6bab503",
        "signing_order": "1",
        "name": "Signer 1"
        }
]

```

<!-- theme: info -->

> **Note**: In the invite, all the roles from the document must be assigned to signers.

### Step 5: Send invite with SMS authentication

Send a [document field invite](/docs/document-field-invite/operations/post-field_invite) with SMS authentication.

```json
curl -X POST \
https://api.signnow.com/document/{{document_id}}/invite \
-H 'Authorization: Bearer {{access_token}}'\
-H 'Content-Type: application/json' \
-d '{
    "to": [
        {
            "email": "signer@email.com",
            "role": "Signer 1",
            "role_id": "6e9580fa76ba4edca18fa6e680a36d10a6bab503",
            "order": 1,
            "subject": "New document",
            "message": "You've got a new document to sign.",
            "authentication_type": "phone",
            "method": "sms",
            "phone": "+12124567890",
            "authentication_sms_message": "Your one-time code is {password}"
        }
    ],
    "from": "sender@email.com"
}'
```

## Try out in Postman

[Access](https://www.postman.com/signnow-api/signnow-public-collection/collection/65kpga4/signnow-extended-signing-session-features) this flow in Postman and use the two-factor authentication to secure your data.


---
*Full page: https://docs.signnow.com/docs/two-factor-authentication*
