> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL.
>
> Documentation indexes by section:
> - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt
> - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt
> - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt
> - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt
>
> Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth
> Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks
>
> OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json
> MCP server: https://docusign.docs.buildwithfern.com/_mcp/server

# How to send a signature request to a notary group

> Demonstrates how to use the eSignature REST API to send a signature request to a notary group via email.

This topic demonstrates how to use the eSignature REST API to send a signature request to a notary group via email. A notary group consists of one notary and up to four signers who are all participating in a remote online notary (RON) session.

**Important**: In the Required data table and the code, the sender of the envelope is called the `SIGNER`.

## Prerequisites

* The sender’s API account ID must be provisioned for the [Notary base URI](/docs/notary-api/go-live) to join the RON session. For closed beta participants interested in adding Notary API functionality to your production account, contact your Docusign representative.
* The notary must be an active notary in the sender’s Docusign account.

> **Note**
>
> Run this code example from our [Quickstart](/docs/esign-rest-api/quickstart) or launcher projects: [Bash](https://github.com/docusign/code-examples-bash), [PowerShell](https://github.com/docusign/code-examples-powershell).

## Required data

Running the code in this how-to requires this data:

| Data element             | Description                                                                                                                                                                                                                                                                                                            |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \{API_ACCOUNT_ID}        | A [GUID](http://guid.one/) value that identifies your account. This value is automatically generated by Docusign for any account you create. Copy the value from the **API Account ID** field on the [Apps and Keys](https://admindemo.docusign.com/authenticate?goTo=appsAndKeys) page.                               |
| \{BASE_PATH}             | A string value that forms the root of the URL required to make API calls. The base path value in the example code is set to target the developer environment at https\://\<domain>/restapi Where \<domain> is demo.docusign.net for the developer environment and is the result of the GetUserInfo call in production. |
| \{DOCUMENT_ID}           | A document identifier such as a name or ID. You can get a [list of envelope documents](/docs/esign-rest-api/how-to/list-envelope-documents) to obtain this information.                                                                                                                                                |
| Document to be signed    | You must provide at least one document to be signed. Document used in this how-to:- [DOCX file](https://github.com/docusign/code-examples-java/blob/master/src/main/resources/World_Wide_Corp_Battle_Plan_Trafalgar.docx)                                                                                              |
| \{NOTARY_API_ACCOUNT_ID} | A [GUID](http://guid.one/) value that identifies the notary's account. Copy the value from the **API Account ID** field on the [Apps and Keys](https://admindemo.docusign.com/authenticate?goTo=appsAndKeys) page.                                                                                                     |
| \{NOTARY_EMAIL}          | A string value for the email address where the notary will receive a notification.                                                                                                                                                                                                                                     |
| \{NOTARY_NAME}           | A string value for the full name of the notary.                                                                                                                                                                                                                                                                        |
| \{SIGNER_EMAIL}          | A string value for the email address where the signer will receive a notification of the signing request.                                                                                                                                                                                                              |
| \{SIGNER_NAME}           | A string value for the full name of the signer.                                                                                                                                                                                                                                                                        |

## Step 1. Obtain your OAuth token

To make the API call shown in this how-to, you need a valid OAuth access token. Docusign supports access tokens for three different recommended OAuth grant types: Public Authorization Code Grant, Confidential Authorization Code Grant, and JSON Web Token (JWT) Grant. Choose the OAuth grant type appropriate for your scenario.

Docusign Notary OAuth access tokens are the same ones used for our [eSignature REST API](/docs/esign-rest-api/esign101/auth), although you must request four [scopes](/docs/notary-api/notary101/auth) to call the Docusign Notary API endpoints: `notary_read`, `notary_write`, `organization_read`, and `signature`.

> **Note**
>
> See [Authentication](/docs/notary-api/notary101/auth) for guidance on your options to get an OAuth token.

![Three icons that represent the three methods a user can use to obtain an OAuth token: JSON Web Token (JWT), Public Authorization Code Grant (ACG), and Confidential Authorization Code grant](/_fern-files/_img/64f473773042ee439449a096bf7673292b1585b86a4ccc55f82ba0dda41f61a1.webp)

## Step 2. Construct your API headers

After you have a valid OAuth access token, you are ready to construct the API headers that you will pass to the API call. Construct your headers like this, but make sure to substitute your valid OAuth access token for \{ACCESS_TOKEN}.

**`Bash`**

```bash title="Bash"
declare -a Headers=('--header' "Authorization: Bearer ${ACCESS_TOKEN}" \
    '--header' "Accept: application/json" \
    '--header' "Content-Type: application/json")
```

**`PowerShell`**

```text title="PowerShell"
$headers = @{
  'Authorization' = "Bearer $accessToken";
  'Accept'        = "application/json";
  'Content-Type'  = "application/json";
}
```

## Step 3. Construct the request body

Next, create the request body. The first step in requesting a signature by email is to create a new envelope definition. The accompanying code demonstrates how to:

* Attach a document to your envelope.
* Set notary and signer recipient data.
* Create and assign a notary-specific field to the notary recipient within the document.
* Create and assign signable fields to specific signers within the document.

**Note:** When sending a request to a notary group, you must set the same value for `routingOrder` for the notary and the signers.

Make sure to substitute your values for \{NOTARY_EMAIL}, \{NOTARY_NAME}, \{NOTARY_API_ACCOUNT_ID}, \{SIGNER_EMAIL}, and \{SIGNER_NAME}.

**`Bash`**

```bash title="Bash"
printf \
'{
    "emailSubject": "Please sign this document set",
    "documents": [
        {
            "documentBase64": "' >> $request_data
                cat $doc_base64 >> $request_data
                printf '",
            "name": "Order acknowledgement",
            "fileExtension": "html",
            "documentId": "1",
        },
    ],
    "recipients": {
        "notaries": [
            {
                "email": "'"$NOTARY_EMAIL"'",
                "name": "'"$NOTARY_NAME"'",
                "recipientId": "1",
                "routingOrder": "1",
                "tabs": {
                    "notarySealTabs": [
                        {
                            "xPosition": "300",
                            "yPosition": "235",
                            "documentId": "1",
                            "pageNumber": "1",
                        },
                    ],
                    "signHereTabs": [
                        {
                            "xPosition": "300",
                            "yPosition": "150",
                            "documentId": "1",
                            "pageNumber": "1",
                        },
                    ]
                },
                "userId": "'"$NOTARY_API_ACCOUNT_ID"'",
                "notaryType": "remote",
            },
        ],
        "signers": [
            {
                "clientUserId": "12345",
                "email": "'"$SIGNER_EMAIL"'",
                "name": "'"$SIGNER_NAME"'",
                "recipientId": "2",
                "routingOrder": "1",
                "notaryId": "1",
                "tabs": {
                    "signHereTabs": [
                        {
                            "documentId": "1",
                            "xPosition": "200",
                            "yPosition": "235",
                            "pageNumber": "1",
                        },
                        {
                            "stampType": "stamp",
                            "documentId": "1",
                            "xPosition": "200",
                            "yPosition": "150",
                            "pageNumber": "1",
                        },
                    ],
                },
            },
        ],
    },
    "status": "sent"
}' >> $request_data
```

**`PowerShell`**

```text title="PowerShell"
@{
   emailSubject = "Please sign this document set";
   documents    = @(
       @{
           documentBase64 = "$(Get-Content $docBase64)";
           name           = "Order acknowledgement";
           fileExtension  = "html";
           documentId     = "1";
       };
   );
   recipients   = @{
       notaries = @(
           @{
               email        = $variables.NOTARY_EMAIL;
               name         = $variables.NOTARY_NAME;
               recipientId  = "1";
               routingOrder = "1";
               tabs         = @{
                   notarySealTabs = @(
                       @{
                           xPosition = "300";
                           yPosition = "245";
                           documentId = "1";
                           pageNumber = "1";
                       };
                   );
                   signHereTabs = @(
                       @{
                           xPosition = "300";
                           yPosition = "150";
                           documentId = "1";
                           pageNumber = "1";
                       };
                   )
               };
               userId = $variables.NOTARY_API_ACCOUNT_ID;
               notaryType = "remote";
           };
       );
       signers      = @(
           @{
               clientUserId = "12345";
               email        = $variables.SIGNER_EMAIL;
               name         = $variables.SIGNER_NAME;
               recipientId  = "2";
               routingOrder = "1";
               notaryId = "1";
               tabs         = @{
                   signHereTabs = @(
                       @{
                           documentId  = "1";
                           xPosition = "200";
                           yPosition = "245";
                           pageNumber = "1";
                       };
                       @{
                           stampType  = "stamp";
                           documentId = "1";
                           xPosition   = "200";
                           yPosition = "150";
                           pageNumber = "1";
                       };
                   );
               };
           };
       );
   };
   status       = "sent";
} | ConvertTo-Json -Depth 32 > $requestData
```

## Step 4. Call the eSignature REST API

Now that you have constructed your API headers and request body, you can send the envelope with the [Envelopes:create](/docs/esign-rest-api/reference/envelopes/envelopes/create) method to the notary and any other recipients you have specified. Here’s how you make the call, but make sure to substitute your API account ID for \{ACCOUNT_ID}.

> **Note**
>
> View the source code for this how-to on GitHub: [Bash](https://github.com/docusign/code-examples-bash/blob/master/examples/Notary/eg001SignatureRequestToNotaryGroup.sh), [PowerShell](https://github.com/docusign/code-examples-powershell/blob/master/examples/Notary/signatureRequestToNotaryGroup.ps1).

**`Bash`**

```bash title="Bash"
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
     --header "Content-Type: application/json" \
     --data-binary @${request_data} \
     --request POST ${base_path}/v2.1/accounts/${account_id}/envelopes \
     --output $response

echo "Response: "
cat $response
```

**`PowerShell`**

```text title="PowerShell"
Invoke-RestMethod `
    -Uri "${apiUri}/v2.1/accounts/${accountId}/envelopes" `
    -Method 'POST' `
    -Headers $headers `
    -InFile (Resolve-Path $requestData).Path `
    -OutFile $response

Write-Output "Response: $(Get-Content -Raw $response)"
```

## Expected response

If you run this code example from our Quickstart or launcher projects, you should see a JSON response similar to the code shown.

In addition, the notary receives an email invite to the audio-visual RON session.

**`Sample response`**

```json title="Sample response"
{
  "envelopeId": "9217ce73-xxxx-xxxx-xxxx-a708ea14ecdb",
  "uri": "/envelopes/9217ce73-xxxx-xxxx-xxxx-a708ea14ecdb",
  "statusDateTime": "2023-06-29T00:13:39.5970000Z",
  "status": "sent"
}
```

## Step 5. The notary joins the remote online notary session

First, the notary must authenticate in their Docusign account in a regular browser window (cannot be incognito). Then the notary selects the “Join Session” link in their email to start the audio-visual session. See [Perform Remote Online Notarization ](https://support.docusign.com/s/document-item?rsc_301=\&bundleId=vnn1603923633199\&topicId=yqk1619197809977.html) for details.

## Step 6. The signers join the remote online notary session

When the notary joins the audio-visual session, this triggers invites to the signers. The signers select the “Join Notary Session” link in their email to start the audio-visual session.

## Next steps

* Run this code example from our [Quickstart](/docs/esign-rest-api/quickstart) or launcher projects: [Bash](https://github.com/docusign/code-examples-bash), [PowerShell](https://github.com/docusign/code-examples-powershell).
* Learn more about [remote online notary](/docs/notary-api/notary101).
* See [Perform Remote Online Notarization ](https://support.docusign.com/s/document-item?rsc_301=\&bundleId=vnn1603923633199\&topicId=yqk1619197809977.html) for details about the audio-visual session.
* Learn [How to invite a notary to your pool](/docs/notary-api/how-to/invite-notary-notary-pool).
* Learn [How to get a list of enabled jurisdictions](/docs/notary-api/how-to/get-list-enabled-jurisdictions).
* See how to [Go-Live](/docs/notary-api/go-live) with a completed app and find the base path for API calls in the production environment.