> 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 invite a notary to your pool

> Demonstrates how to invite a notary to your pool.

This topic demonstrates how to invite a notary to your [pool](/docs/notary-api/notary101/concepts/notary-pool). Each Docusign [organization](https://support.docusign.com/s/document-item?language=rsc_301\&bundleId=rrf1583359212854\&topicId=tif1583359135245.html) is allowed to have only one pool.

**Important**: You will receive a 400 error if you invite a notary who is already pending or active 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 notary-d.docusign.net for the developer environment and na-notary.docusign.net for production.       |
| \{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.                                                                                                                                                                                                                                                                    |
| \{ORGANIZATION_ID} | A [GUID](http://guid.one/) value that identifies the the organization that contains the account to which the user will be added. Copy the value from the **Organization ID** field in the **Organization** section of the [Account Profile](https://admindemo.docusign.com/authenticate?goTo=accountProfile) page. |
| \{POOL_ID}         | A [GUID](http://guid.one/) value that identifies the [notary pool](/docs/notary-api/notary101/concepts/notary-pool) within your organization.                                                                                                                                                                      |

## Step 1. Obtain your OAuth token

To make the API calls 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 = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.add("Authorization", "Bearer $accessToken")
$headers.add("Content-Type", "application/json")
```

## Step 3. Retrieve your notary pool ID

Now, create a GET request to the [Pool:getPools](/docs/notary-api/reference/organizations/pool/getpools) endpoint to retrieve your pool ID. Here's how you make the call, but make sure to substitute your organization ID for \{ORGANIZATION_ID}.

**`Bash`**

```bash title="Bash"
Status=$(curl -w '%{http_code}' -i --request GET ${base_path}/v1.0/organizations/${ORGANIZATION_ID}/pools \
     "${Headers[@]}" \
     --output ${response})

POOL_ID=$(cat "$response" | sed -n 's/.*"poolId":"\([^"]*\)".*/\1/p')
```

**`PowerShell`**

```text title="PowerShell"
Invoke-RestMethod `
    -UseBasicParsing `
    -Uri "${apiUri}/v1.0/organizations/${organizationId}/pools/" `
    -Headers $headers `
    -Method 'GET' `
    -OutFile $response

Write-Output "Response: $(Get-Content -Raw $response)"
$POOL_ID = $(Get-Content $response | ConvertFrom-Json).pools[0].poolId
```

## Step 4. Construct the request body

Next, create the request body. Make sure to substitute the notary’s name for \{NOTARY_NAME} and their email address for \{NOTARY_EMAIL}.

**`Bash`**

```bash title="Bash"
printf \
'
{
  "email" : "'"${NOTARY_EMAIL}"'",
  "name" : "'"${NOTARY_NAME}"'",
}' >$request_data
```

**`PowerShell`**

```text title="PowerShell"
write-Output ""
$NOTARY_NAME = Read-Host "Enter a name for the notary"
$NOTARY_EMAIL = Read-Host "Enter an email address for the notary"

$body = @"
{
  "email" : "${NOTARY_EMAIL}",
  "name" : "${NOTARY_NAME}",
}
"@
```

## Step 5. Call the Notary API

Now that you have constructed your API headers and request body, you can make a POST request to the [PoolInvite:createPoolInvite](/docs/notary-api/reference/organizations/poolinvite/createpoolinvite) endpoint to send the pool invitation to the notary you have specified. Here’s how you make the call, but make sure to substitute your organization ID for \{ORGANIZATION_ID} and pool ID for \{POOL_ID}.

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

**`Bash`**

```bash title="Bash"
Status=$(curl -w '%{http_code}' -i --request POST ${base_path}/v1.0/organizations/${ORGANIZATION_ID}/pools/${POOL_ID}/invites \
     "${Headers[@]}" \
     --data-binary @${request_data} \
     --output ${response})
```

**`PowerShell`**

```text title="PowerShell"
Invoke-RestMethod `
    -Uri "${apiUri}/v1.0/organizations/${organizationId}/pools/${POOL_ID}/invites" `
    -Headers $headers `
    -Method 'POST' `
    -Body $body `
    -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.

**`Sample response`**

```json title="Sample response"
{
  "poolInviteId": "b18ac890-xxxx-xxxx-xxxx-ef9830699f62",
  "createdByUserId": "dfb914c4-xxxx-xxxx-xxxx-2c91443f632e",
  "createdDate": "2023-06-28T23:50:43.8688272Z",
  "lastupdatedByUserId": "dfb914c4-xxxx-xxxx-xxxx-2c91443f632e",
  "lastUpdatedDate": "2023-06-28T23:50:43.8688272Z",
  "poolId": "f622a36a-xxxx-xxxx-xxxx-2c104f60e126",
  "email": "example_notary@example.com",
  "name": "Example Notary"
}
```

## 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).
* Learn [How to send a signature request to a notary group](/docs/notary-api/how-to/send-signature-request-notary-group).
* 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.