-
mr.shashikanconst express = require("express");
const bodyParser = require("body-parser");
const axios = require("axios");
const app = express();
app.use(bodyParser.json());
const JOTFORM_API_KEY = "<my api key goes here>";
const BASE_URL = "https://api.jotform.com";
// 🔴 Your Sign TEMPLATE ID
const SIGN_TEMPLATE_ID = "260294945219060";
/**
* Create Sign link for athlete
*/
app.post("/create-sign-link", async (req, res) => {
try {
const { athleteId, signerName, signerEmail } = req.body;
if (!athleteId || !signerName) {
return res.status(400).json({ error: "Missing data" });
}
/**
* 1️⃣ Create document from template
*/
const createResp = await axios.post(
`${BASE_URL}/sign/document/${SIGN_TEMPLATE_ID}/create`,
{
signers: [
{
name: signerName,
email: signerEmail || "" // email optional if no invite
}
],
metadata: {
athlete_id: athleteId
}
},
{
headers: {
Authorization: `Bearer ${JOTFORM_API_KEY}`
}
}
);
const documentId = createResp.data?.content?.id;
if (!documentId) {
return res.status(500).json({ error: "Document creation failed" });
}
/**
* 2️⃣ Generate signing link (NO INVITE)
*/
const linkResp = await axios.get(
`${BASE_URL}/sign/document/${documentId}/link`,
{
headers: {
Authorization: `Bearer ${JOTFORM_API_KEY}`
}
}
);
const signUrl = linkResp.data?.content?.url;
if (!signUrl) {
return res.status(500).json({ error: "Failed to generate sign link" });
}
/**
* 3️⃣ Save this signUrl in DB mapped to athlete
* (You do this part)
*/
res.json({
athlete_id: athleteId,
document_id: documentId,
sign_url: signUrl
});
} catch (err) {
console.error(err.response?.data || err.message);
res.status(500).json({ error: "Server error" });
}
});
app.listen(3000, () => {
console.log("Server running on port 3000");
});
I got this code generated by jotform AI.
BUT, ERROR I am getting is 404.
at this
`${BASE_URL}/sign/document/${SIGN_TEMPLATE_ID}/create`.
Please help me to fix this. -
Podo: Support SpecialistHi shashikant,
Thanks for reaching out to Jotform Support. I'm an AI assistant here to assist you.
The 404 error you are encountering at the endpoint https://api.jotform.com/sign/document/{SIGN_TEMPLATE_ID}/create indicates that this URL is not a valid or supported API endpoint in Jotform's API for creating sign documents from templates.
Based on the available Jotform Sign documentation and API usage, there is no direct API endpoint documented for creating a sign document from a template using the URL pattern you are using.
To create signable documents, Jotform typically uses the Workspace page or the Sign Builder interface, and the API endpoints for sign documents do not include a /create path under /sign/document/{templateId}.
Therefore, the 404 error suggests that the endpoint you are trying to call does not exist or is incorrect.
What you can do:
- Verify the API documentation: Check the latest Jotform API documentation for the correct endpoint to create sign documents from templates.
- Use the Workspace UI: Create sign documents from templates through the Jotform Workspace and Sign Builder interface as described in the Jotform Sign usage guide.
- Contact Jotform support or check developer resources: If you need to automate this via API, confirm if there is a supported API endpoint for this action or if there is an alternative method.
Currently, the API endpoint /sign/document/{templateId}/create is not recognized and causes a 404 error.
Give it a try and let us know how it goes.
-
mr.shashikanI checked, could not find exact endpoint to create document. most of them are related to form and submission.
-
Podo: Support SpecialistHi shashikant,
I understand you couldn't find an exact API endpoint for creating a sign document from a template, as most endpoints are related to forms and submissions.
Currently, Jotform does not provide a direct API endpoint to create sign documents from templates programmatically. The integration and creation of signable documents are primarily managed through the Jotform Workspace and Sign Builder interface.
As an alternative, you might consider using the form builder features or integrating with third-party services like DocuSign if you need advanced signing workflows. For example, you can add a DocuSign field to your form using the Form Builder, which allows you to collect signatures seamlessly.
Here’s how to add a DocuSign field to your form:
- In Form Builder, click on Add Element on the left side of the page.
- Under the Widgets tab, search for DocuSign and add it to your form.
- Authenticate your DocuSign account in the widget settings.
- Configure the document title and other settings as needed.
You can also explore connecting Jotform and DocuSign via Zapier for automation.
Give it a try and let us know if you need any help.
-
mr.shashikanCan I get this reply from the developers who manages the API?
-
Podo: Support SpecialistHi shashikant,
One of our Support Team members will take it from here to follow up shortly.
-
Hakan Enterprise Customer Success EngineerHi Shashikant,
I see that you started chatting with Podo and seeking more information about an API call. As Podo mentioned, there is not an endpoint regarding creating document. The full list of the API endpoints, you can refer to Jotform API Documentation page.
Give it a try and let us know if you have any other questions.
-
SShashikant
Hi Hakan,
Thanks for your reply,
I looked into the API Document but, I could not find the link which can help me.
Let me explain my requirement.
I created jotform sign document and invite link is:
https://www.jotform.com/sign/260294841846061/invite/01kg7tqsw3db61cc2cab2e0a2e?athlete_id=123.
If you see this link, there is athlete_id=123. I want to set this value in the sign document any of the field. Once signer signs, it should be sent to the webhook. This way I would get to know that who has signed the document by checking athlete_id value in my database.
Is this possible to achieve? If yes, please suggest the steps.
To tried by adding prefill[athlete_id]=123 in the query string as below, by adding a short text field but could not work:
https://www.jotform.com/sign/260294841846061/invite/01kg7tqsw3db61cc2cab2e0a2e?prefill[athlete_id]=123.To do above I follow this video:
https://www.jotform.com/help/71-prepopulating-fields-to-your-jotform-via-url-parameters/Help me to set the passed value in the sign document field, or suggest some other way to achieve this with the sign document so that I can get athlete_id in the webhook to check who has signed.
Thank you,
Shashikant Pandit
-
Sonnyfer Enterprise SupportHi Shashikant,
As creating a Sign Document via API isn't available yet, I've gone ahead and escalated your request to our developers as Feature Request. Exactly when or if it's developed depends on their workload, how viable it is, and how many other users also request it. If there are any updates, we’ll circle back to this thread and let you know.
I’ve also gone ahead and moved your other question to a separate thread to keep things tidy, and someone from our Support Team will help you out with it here.
Thanks for your patience and understanding, we appreciate it.

-
tammy151@all its viable, get on it
