---
title: "JWT Docusign Setup"
canonical: "https://help.agiloft.com/space/HELP/597884958/JWT+Docusign+Setup"
format: markdown
---
This article provides instructions for integrating Docusign with Agiloft CLM using JSON Web Token Grant (JWT) authentication. It guides you through creating a Docusign developer account if you don’t have one, creating the demo Docusign integration app that you’ll promote to production, connecting the demo app to your KB for testing, and then integrating the production app with your KB. The article also includes recommendations for optimizing your integration after the initial setup.

> ℹ️ **Prerequisites**
> ℹ️ 
> ℹ️ - Make sure you have admin access to your Agiloft KB and Docusign before you begin the setup. You'll need to log in to Agiloft as a Docusign admin to complete the setup.
> ℹ️ - You can have multiple active Docusign accounts connected to a single KB. However, each Docusign user can only be associated with one account. Users can’t switch between connections.

# Creating a Docusign Account

If you don’t already have a Docusign account, you can create a developer account for free. You can use the account for testing during the initial setup. If you already have a Docusign developer account, proceed to [Creating the Docusign Demo App](#docusign_demo).

To create a developer account:

1. Go to [Docusign for Developers](https://developers.docusign.com/) and click Try for Free.
2. Enter the required details and finish creating the account.
3. Next, log in to your developer account, click the profile icon in the top right, and then click My Apps and Keys in the drop-down.
4. In the sidebar under Users and Groups, click Permission Profiles.
5. Next to the DS Admin permission profile, click **Actions > View** to open it.
6. Go to the User Permissions tab.
7. Ensure that the "Allow send on behalf of other users through API" check box is selected. If the option is disabled, create a copy of the permission set and then select this option.

Now you can start setting up the developer or demo app.

# > Macro (anchor)

Creating the Docusign Demo App

To create a Docusign application:

1. In your developer account, click the profile icon in the top right and go to My Apps and Keys.
2. On the Apps and Keys screen, click Add App and Integration Key.
3. Give the integration a name, then click Create App. Docusign creates the app.
4. In the app configuration under Integration Type, select Third-party integration key.
5. Ignore the Authentication settings.
6. Under Service Integration**, **click Generate RSA.
7. Copy the Public and Private Keys in their entirety, including the header and footer. Save them in a safe and accessible location where you can access them later.

> 📝 Be sure to save both keys to a safe place. You won't be able to view them again, and you'll need them in later steps to complete the setup.

8. If you’ll get individual consent when you [grant consent](#grant_consent) for the app, add a redirect URI. The redirect URI is a splash page or internal site where the user is sent after they grant consent for the app. If you like, you can use an Agiloft hosted splash page and set the redirect URI to: `https://www.agiloft.com/success/`
9. Leave the Additional Settings as they are and click Save.
10. On the Apps and Keys screen, save the API Account ID, Account Base URI, and Integration Key for the new app in an accessible location, just like your Public and Private Keys.
11. Finally, in order to integrate and test the demo app with Agiloft, you need to [grant consent](#grant_consent) for it.

## > Macro (anchor)

Granting Consent

Before your application can obtain access tokens for users, users must grant the client consent. There are two options for granting consent: you can grant it administratively or ask each user to grant access individually. Some integrations use a single one of these options, while others may require both. Generally, both consent options are required if not all users have the same domain for their email addresses. You can find more information about these options in Docusign's documentation [here](https://www.docusign.com/blog/developers/oauth-jwt-granting-consent).

- Admin consent grants consent to every Docusign user in your domain simultaneously. This method is usually quicker and makes it easier to add more users in the future. For integrations that require admin consent, complete the [Granting Admin Consent](#admin_consent) section below.

> 📝 To grant admin consent, your Docusign account must include the Access Management with SSO feature.

- Individual consent requires each Docusign user to grant consent to the API by logging in to confirm permission. This can be used for one main account or in cases where each user has an individual login but might use a different domain, such as contractors. For integrations that require individual consent, complete the [Getting Individual Consent](#individual_consent) section below.
- For integrations that require both methods, complete both sections.

### > Macro (anchor)

Granting Admin Consent

If your Docusign account includes the Access Management with SSO feature, you can follow the steps below to grant admin consent. If you don't have access to grant admin consent, see [Getting Individual Consent](#individual_consent) instead.

To grant administrative consent, you first need to configure an organization in Docusign.

1. If you have an existing Docusign organization that has claimed the domain you'd like to use, follow Docusign's instructions to [Link Administered Accounts to an Organization](https://support.docusign.com/s/document-item?language=en_US&rsc_301&bundleId=rrf1583359212854&topicId=mtc1583359175678.html&_LANG=enus), and then skip to step 3 below.
2. Otherwise, create an organization:
  1. In Docusign [Admin](https://apps-d.docusign.com/admin/admin-dashboard), click Overview in the sidebar, then click Get Started in the upper right corner and follow Docusign's instructions to [Create an Organization](https://support.docusign.com/s/document-item?language=en_US&rsc_301&bundleId=rrf1583359212854&topicId=nkj1583359134234.html&_LANG=enus).  
:info: If you don't see the Get Started button, Docusign Admin is not enabled on the account. Contact Docusign customer support for assistance.
  2. Enter an Organization Name and an optional Description, then click Next.
  3. The account you used to create the organization is automatically linked. Add any other accounts you want to manage centrally, and click Create.
3. Once the Organization is created, you can use the app launcher button to navigate between the eSignature Admin and the Docusign Admin interfaces. Make sure you're on the Docusign Admin interface.
4. Navigate to the Connected Apps menu in the Organization Dashboard.
5. Click Authorize Application.
6. Select your app. Under the Permissions field, enter: `signature impersonation`
7. Click Add. This adds the app to the organization, and grants impersonation for every user. This feature requires that you claim your organization domain before it can become functional.
8. Follow the [Docusign instructions](https://support.docusign.com/en/guides/org-admin-guide-domains) to prove ownership. This requires you to work with your domain admin to make changes to the DNS and CNAME.

> 📝 When claiming a domain, ensure that you claim the domain used by the email addresses you use with Docusign. A domain can only be claimed by one Docusign organization. If an organization has claimed and verified a domain, then another organization can’t claim it. An organization can claim the same domain in both the demo and production environments.

9. Complete [Individual Consent](#individual_consent) if you plan to use it or continue to [Integrating the Demo App with Agiloft](#integrate_demo).

### > Macro (anchor)

Getting Individual Consent

To request individual consent:

1. First, construct a consent URI based on the following syntax. Replace the SERVER, INTEGRATION_KEY, and REDIRECT_URI placeholders with the appropriate values:
  - For SERVER:
    - When setting up a test environment, use: `account-d.docusign.com`
    - When switching to production, use: `account.docusign.com`
  - For INTEGRATION_KEY, use the key you copied when you created the app.
  - For REDIRECT_URI, use the URI you used when creating the app. If you used Agiloft’s splash page, the URI is: `https://www.agiloft.com/success/`

> ℹ️ **Example**
> ℹ️ 
> ℹ️ Below is an example URI for a test environment with the Agiloft success page as the redirect URI:
> ℹ️ 
> ℹ️ `https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature%20impersonation&client_id=90ede1f-67f3-611e-8dc2-a1ef8f333&redirect_uri=https://www.agiloft.com/success/`

2. Copy your completed consent URI and open it in a browser.
3. Log in with your individual account and grant consent for the application.
4. Send the same link to all users who need to grant individual consent, so they can log in with their accounts and also grant consent. If users encounter issues, check the construction of your URI, and have the users open the link in a private or incognito browser.

Now that consent is granted, you can [integrate the demo app with Agiloft](#integrate_demo).

# > Macro (anchor)

Integrating the Demo App with Agiloft

To connect the demo app to your KB:

1. Log in to your KB as the Docusign admin user.
2. Go to **Setup** **> Integration > Docusign Extension** and click **Configure**.
3. Your KB comes with a Demo (demo.docusign.net) account that you can use to integrate with the demo app. Edit the existing account or click New to create a new account. You can connect multiple Docusign accounts with a single KB. It isn't necessary in most cases, but it can useful if you need a separate account to purchase a smaller number of more expensive envelopes in order to avoid higher charges under the primary Docusign account. Note that you can’t use multiple Docusign accounts if any of the active accounts are configured to use ACG authentication.
4. Give the account a name. If you have multiple accounts, make sure the new name differentiates this account.
5. If necessary, set Use Default Integration Keys to No. Then provide the API Account ID, Integration Key, and RSA Private Key. For RSA Private Key, include the header and footer.
6. Click Save.

Now, add user information to your KB.

1. Go to the Docusign Users tab.
2. If you are the Docusign administrator for Agiloft, add yourself as a Docusign User. Or, if someone else will serve as the Docusign administrator, add that person. The user you choose should have admin rights in both the KB and Docusign and needs to be able to add and remove users and manage other aspects of the Docusign setup. It's best to have a separate account only for this purpose. That way, it's easier to transition responsibility internally if needed. To add the user:
  1. Click New.
  2. Use the look-up for the Login or Full Name to find the Agiloft user. For this first record, select the user you'd like to make the Docusign administrator.
  3. If you see an option to choose how to authenticate, select JWT. If you don't see this option, proceed to the next step.
  4. Get the user’s Docusign User ID for the development environment by navigating to the User tab in Docusign, opening the user's profile, and copying the User ID. Then, enter it into the User ID field. For the first user, this should be an admin user account in Docusign, with the permission profile set to DS Admin.  
:note: In older KBs, this field might not be included in the layout. To make the User ID field visible, open Setup for the Docusign Users table, go to the Layout tab, and add the User ID field to the layout.
  5. Click Grant Access to Docusign, then close the user record and account configuration.
3. If you chose another user account to be the administrator, log out of Agiloft and log in again as that Docusign admin user. If you are the Docusign admin, stay logged in.
  1. Return to **Setup** **> Integration > Docusign Extension**, click Configure, and edit the account again.
  2. On the Docusign Account tab, select the Docusign admin user in the Account Administrator drop-down.
  3. Click Enable Docusign Connect. If Docusign is fully enabled, you are returned to the account list and the Accept Real-Time Updates? value is set to Yes. You can also confirm your connection by opening the account configuration again and checking that a Connect ID now appears. You can now begin testing or continue to the next step to add users.

> 📝 You might see an error message if the hotlink server URL is set to localhost. To update this value, set the Hotlink Server URL [global variable](https://agiloft-public.atlassian.net/wiki/spaces/HELP/pages/43713942) value to your server's domain name. For other issues, consult [Docusign Troubleshooting](https://agiloft-public.atlassian.net/wiki/pages/createpage.action?spaceKey=help&title=Docusign%20Troubleshooting&linkCreation=true&fromPageId=597884958).

4. Return to Docusign Users. For each employee who needs to send Docusign envelopes in this test environment, follow step 2 above to create a Docusign User entry. When completing step 2d for each user:
  - To send envelopes under a user's own Docusign name, input their Docusign User ID.
  - To send envelopes under one main account, input the Docusign Admin User ID for every subsequent user granted access to Docusign. Make sure that in Docusign administration, you go to **Settings > Users and Groups > Permission Profiles **and enable "Allow send on behalf of other users through API" for the admin user's permission profile.

Now that Agiloft is connected to your demo app, you can test the integration by [creating and sending envelopes](https://agiloft-public.atlassian.net/wiki/spaces/HELP/pages/599064639). When you’re ready to promote the demo app to a production account, proceed to [Going Live with Docusign](#going_live).

> Macro (include)

# > Macro (anchor)

Integrating the Production App with Agiloft

Once your app has been verified and promoted to production, follow the steps below to connect your KB to the production account.

> ℹ️ **Prerequisites**
> ℹ️ 
> ℹ️ If you integrated your demo app with Agiloft, complete the following steps before setting up the production account:
> ℹ️ 
> ℹ️ 1. Disable Docusign Connect:
> ℹ️   1. Go to **Setup > Integration > Docusign Extension** and click Configure.
> ℹ️   2. Edit the existing account configuration.
> ℹ️   3. Click Disable Docusign Connect.
> ℹ️ 2. Revoke user access:
> ℹ️   1. Go to the Docusign Users tab.
> ℹ️   2. For each user listed, open the record and click Revoke Access. If you don't remove user access, you’ll be unable to change the server from the demo server to the production one.

1. Log in to your Docusign Production account at [https://account.docusign.com/](https://account.docusign.com/), not your developer account.
2. Go to the Admin UI and go to Apps and Keys under Integrations.
3. Next to the app you want to integrate, select **Actions > Edit**.
4. Generate an RSA key for this app. Make sure you save the resulting public and private keys to a safe place that you can access later.
5. If you’ll get individual consent for this app, add the redirect URI. If you want to use the Agiloft hosted splash page, set the redirect URI to: `https://www.agiloft.com/success/`
6. Save the changes to the app.
7. Next, follow the appropriate steps to [grant consent](#grant_consent) for the production app.

Now, configure your KB:

1. Log in to Agiloft as the Docusign administrator.
2. Go to **Setup > Integration > Docusign Extension** and click Configure.
3. Edit the existing account configuration.
4. Click Change Server. Select the Account Base server for the production app and click Set Server.
5. Next, change the API Account ID and RSA Private Key values to the values for the production app. In RSA Private Key, include the header and footer.
6. Save the record and go to the Docusign Users tab.
7. For each user, open the record, add their Docusign production user ID, and click Grant Access to Docusign.
8. Go back to the Docusign Account tab and select the Account Administrator from the list of Docusign users and save the record.
9. Finally, click Enable Docusign Connect. If Docusign is fully enabled, you are returned to the account list and the Accept Real-Time Updates? value is set to Yes. You can also confirm your connection by opening the account configuration again and checking that a Connect ID now appears.

Now that your production account is integrated with Agiloft, you can test it by creating a new contract and sending it out for signature. Also see [Recommended Optional Setup](#recommended_setup) below for ways to optimize your integration.

# > Macro (anchor)

Recommended Optional Setup

There are a few optional features we recommend you set up to optimize your Docusign integration.

## Matching Agiloft Users to Docusign Accounts Automatically

You can set up your KB so the system automatically queries Docusign for a matching user whenever a new user is created in Agiloft. If a match is found, the Agiloft user account is automatically linked to the Docusign User record, and the user is granted access so they can immediately complete e-signature workflows in Agiloft.

To configure your system this way, first configure the Docusign Users table to look for a matching user:

1. First, confirm that you are logged in to Agiloft as the Docusign admin user, and confirm that your Docusign User record is connected to a Docusign account that is an account administrator.
2. Go to Setup Docusign Users and go to the Rules tab.
3. Create a new rule and give it a description, such as "Set Default Value to DSUser and Grant Access."
4. On the Rule Type tab, leave "When a Docusign User is created/edited/deleted" selected.
5. On the Condition tab, set the following options:
  1. Apply the rule only when a Docusign User is created.
  2. Only by means of Web or API.
  3. When saving a record, run rules and update defaults.
6. On the Schedule tab, leave Always selected.
7. On the Action tab, create a new U: Update Fields Action.
  1. Give the action a name, such as Set Default DS Account Name.
  2. On the Fields tab, select the Docusign Account field.
  3. On the Values tab, select the default Docusign account.
  4. Click Finish. This adds the new action to the rule.
8. Still on the Action tab, select the existing ext: Grant Access to Docusign action and use the arrow button to add it to the Selected Actions list.
9. Click Finish.

Now, configure the People table:

1. Go to Setup Employees, under the People table, and go to the Rules tab.
2. Create a new rule and give it a description, such as "Create Docusign User."
3. On the Rule Type tab, leave "When an Employee is created/edited/deleted" selected.
4. On the Condition tab, set the following options:
  1. Apply the rule only when an Employee created
  2. Only by means of Web or API.
  3. When saving a record, run rules and update defaults.
5. On the Schedule tab, leave Always selected.
6. On the Action tab, create a new C: Data Conversion Action.
  1. Give the action a name, such as Create Docusign User.
  2. On the Conversion tab, click New.
  3. Give the conversion a name, such as Create Docusign User, and select the Docusign user table in the list.
  4. On the Field Mapping tab, map the Full Name field to the Full Name (Person:Full Name) field and the Login field to the Login (Person:Login) field.
  5. Click Next, then Finish.
7. Select your new conversion and click Finish to finish creating the action. This adds the new action to the rule.
8. Still on the Action tab, select the existing ext: Add/Update Docusign User and use the arrow button to add it to the Selected Actions list.
9. Click Finish.

Now, whenever a new Employee record is created, the employee name and login are automatically searched against Docusign. If a match is found, the system creates a Docusign User account for the employee and does the rest of the setup for you.

> Macro (include)

#### Related articles

> Macro (contentbylabel)