By the end of this lab you will have:
-
Used the Docusign AI assistant to create an IK and generate an access token.
-
Bulk uploaded agreement documents to Navigator using an API call.
- Clone the project repo into VS Code.
git clone https://github.com/docusign/docusign-discover-workshop-2.git- Install dependencies:
npm install-
Copy the
example.envfile to a new file named.env. -
Start the server in development mode:
npm run dev- Open http://localhost:3000 in your browser.
- You should see a list of agreements.
- These are coming from a Postman mock server, not your real Docusign account.
- Open your .env file and update the variable BASE_PATH to the value api-d.docusign.com.
Endpoints detailed in bulkUploadWithAPI.md.
- The
trystatement includes an emptybodyconstant. Add the following as the value ofbody:
{
"job_name": "test_name",
"expected_number_of_docs": 2,
"language": "en_us"
}-
The
resconstant uses afetchstatement. Add the URL for the create job endpoint as the first argument. -
The
completeResconstant uses afetchstatement. Add the URL for the complete job endpoint as the first argument. -
The
bulkUploadStatusfunction makes a request to check the status ofjobId. Complete thestatusCheckconstant with a fetch statement to the check status endpoint that includesAuthorization,Accept, andContent-Typeheaders. -
Click the Bulk Upload button. You should see a modal confirming successful upload of 2 agreements.
-
Click the Check Status button. You should see a modal providing the status of the agreement upload and processing. Status should report complete after about 60 seconds.
The code currently fetches agreements using a REST API call.
getAgreements.js
Replace this with the equivalent SDK call to Navigator:
client.navigator.agreements.getAgreementsList({ accountId });TIP it is expected to get a response validation error from the SDK. Use the following workaround:
} catch (err) {
if (err?.message?.includes('Response validation failed') && err?.rawValue) {
console.warn('getAgreements: response validation failed — using rawValue fallback');
data = err.rawValue;
} else {
...Restart your server and refresh the browser — you should now see real agreements from your Docusign account.
You can filter agreements by properties such as status, expiration date, party name, etc. The full list of available query parameters is documented on the API reference page.
Try extending your SDK method calls with additional query parameters. Experiment with different combinations to see how you can sort and filter agreements in ways that match the requirements of various use cases.
let options = {
accountId: accountId,
limit: 10,
"effective_date[gte]": "2015-01-01",
sort: "effective_date",
direction: "asc"
};
client.navigator.agreements.getAgreementsList( options );- In the project there’s a stubbed-out function for Delete Agreement using the SDK.
deleteAgreement.js
Your job is to complete that function:
client.navigator.agreements.deleteAgreement({ accountId, agreementId });- Test it by deleting one of your agreements.
-
Right now you pasted in an access token manually.
-
For a production app, you should implement an OAuth flow to fetch/refresh tokens automatically.
-
Choose either:
-
Authorization Code Grant (browser + server flow)
-
JWT Grant (server-to-server)
-
-
The project has an
auth.jsfile stubbed out for you to implement.
Events detailed in createWebhooks.md.
-
Click Add Configuration > Custom.
-
In the Name box, type Navigator API test or another configuration name of your choosing.
-
In a new tab, open https://webhook.site, then click the generated URL to copy it.
-
Return to your Custom Connect configuration, then in the URL to Publish box paste the URL you copied.
-
In the Trigger Events section, open the Navigator list and check all 5 events.
-
Click Add Configuration.
-
In a new tab, open https://apps-d.docusign.com/send/documents, then in the sidebar, click Completed.
-
Click an agreement with the icon for AI suggestions (purple star), click Review All, approve one of the AI-suggested values, then click Save.
-
On the webhook.site tab, review the agreement-extractions-reviewed message.
-
In your open agreement, click Review All, approve all remaining AI-suggested values, then click Save.
-
On the webhook.site tab, review the agreement-reviews-complete message.
-
In your open agreement, click the edit icon (pencil), change a data value, then click Save.
-
On the webhook.site tab, review the agreement-updated message.
-
Return to your open agreement close it, in the agreements list click the vertical ellipsis (⋮) for the agreement, click Remove, then click Remove Agreement.
-
On the webhook.site tab, review the agreement-deleted message.
Check out the discover-mcp-workshop branch of this repo. You'll need to work in this branch to ensure clean context for the agent you're building.
git checkout discover-mcp-workshopSee Docusign MCP Workshop: AI-Powered Agreement Analysis for your instructions.