Forms API
फॉर्म बनाएं, प्राप्त करें, अपडेट करें, हटाएं, प्रकाशित करें, और डुप्लिकेट करें।
Forms API आपको प्रोग्रामेटिक रूप से अपने NueForm फॉर्म प्रबंधित करने देता है। आप फॉर्म की सूची देख सकते हैं, बना सकते हैं, प्राप्त कर सकते हैं, अपडेट कर सकते हैं, हटा सकते हैं, प्रकाशित कर सकते हैं, अप्रकाशित कर सकते हैं, और डुप्लिकेट कर सकते हैं।
सभी request और response bodies snake_case फ़ील्ड नामों का उपयोग करते हैं।
फॉर्म की सूची
/api/v1/formsauthenticated उपयोगकर्ता के पास जिन फॉर्म्स तक पहुंच है, उनकी paginated सूची लौटाता है, जिसमें व्यक्तिगत फॉर्म और उपयोगकर्ता जिन टीमों का सदस्य है उनके फॉर्म शामिल हैं।
Query Parameters
pageintegerपेज नंबर (डिफ़ॉल्ट: 1)
per_pageintegerप्रति पेज परिणाम (डिफ़ॉल्ट: 50)
searchstringशीर्षक के अनुसार फॉर्म फ़िल्टर करें (case-insensitive आंशिक मिलान)
team_idstringकेवल इस टीम से संबंधित फॉर्म लौटाएं
publishedbooleanप्रकाशित स्थिति के अनुसार फ़िल्टर करें (true या false)
Response
{
"forms": [
{
"id": "665a1b2c3d4e5f6a7b8c9d0e",
"title": "Customer Feedback Survey",
"description": "Quarterly satisfaction survey for Q1 2026",
"slug": "a1b2c3d4e5f6",
"published": true,
"created_at": "2026-01-15T10:30:00.000Z",
"updated_at": "2026-02-20T14:22:00.000Z",
"theme_color": "#6366f1",
"background_color": "#0a0a0a",
"response_count": 142,
"team": {
"id": "665b2c3d4e5f6a7b8c9d0e1f",
"name": "Marketing"
}
}
],
"total": 24,
"page": 1,
"per_page": 50
}
कोड उदाहरण
curl -X GET "https://api.nueform.io/api/v1/forms?page=1&per_page=10&published=true" \
-H "Authorization: Bearer YOUR_API_KEY"
फॉर्म बनाएं
/api/v1/formsएक नया फॉर्म बनाता है। आप वैकल्पिक रूप से फॉर्म के साथ बनाने के लिए प्रश्नों की एक array शामिल कर सकते हैं।
Request Body
titlestringफॉर्म शीर्षक (खाली नहीं हो सकता)
descriptionstringफॉर्म विवरण
team_idstringफॉर्म को एक टीम को असाइन करें (create_forms अनुमति आवश्यक)
publishedbooleanफॉर्म प्रकाशित है या नहीं (डिफ़ॉल्ट: false)
theme_colorstringप्राथमिक थीम रंग (hex, डिफ़ॉल्ट: #6366f1)
background_colorstringबैकग्राउंड रंग (hex, डिफ़ॉल्ट: #0a0a0a)
text_colorstringप्रश्न टेक्स्ट रंग (hex)
answer_text_colorstringउत्तर इनपुट टेक्स्ट रंग (hex)
placeholder_colorstringइनपुट placeholder रंग (hex)
button_colorstringबटन बैकग्राउंड रंग (hex)
button_text_colorstringबटन टेक्स्ट रंग (hex)
title_colorstringशीर्षक टेक्स्ट रंग (hex)
description_colorstringविवरण टेक्स्ट रंग (hex)
option_text_colorstringचॉइस विकल्प टेक्स्ट रंग (hex)
indicator_bg_colorstringस्टेप इंडिकेटर बैकग्राउंड रंग (hex)
indicator_text_colorstringस्टेप इंडिकेटर टेक्स्ट रंग (hex)
font_familystringप्रश्न font family
font_family_answerstringउत्तर इनपुट font family
font_family_buttonstringबटन font family
font_family_descriptionstringविवरण font family
font_family_optionstringचॉइस विकल्प font family
font_family_indicatorstringस्टेप इंडिकेटर font family
question_font_sizestringप्रश्न font size (जैसे, "24px")
custom_cssstringफॉर्म renderer में inject किया गया custom CSS
show_progress_barbooleanप्रोग्रेस बार दिखाएं (डिफ़ॉल्ट: true)
branding_logo_urlstringब्रांडिंग लोगो के लिए URL
branding_footer_textstringकस्टम फुटर टेक्स्ट
hide_brandingbooleanNueForm ब्रांडिंग छुपाएं (डिफ़ॉल्ट: false)
top_logo_urlstringफॉर्म के शीर्ष पर दिखाए जाने वाले लोगो के लिए URL
top_logo_sizestringशीर्ष लोगो आकार (जैसे, "120px")
top_logo_alignmentstringशीर्ष लोगो alignment ("left", "center", "right")
top_logo_cssstringशीर्ष लोगो के लिए custom CSS
watermark_cssstringवॉटरमार्क के लिए custom CSS
welcome_titlestringस्वागत स्क्रीन शीर्षक
welcome_descriptionstringस्वागत स्क्रीन विवरण
welcome_button_textstringस्वागत स्क्रीन बटन टेक्स्ट (डिफ़ॉल्ट: "Start")
thank_you_titlestringधन्यवाद स्क्रीन शीर्षक (डिफ़ॉल्ट: "Thank you!")
thank_you_descriptionstringधन्यवाद स्क्रीन विवरण
modestringफॉर्म मोड: "standard", "knowledge_quiz", "lead_qualification", "match_quiz" (डिफ़ॉल्ट: "standard")
quiz_settingsobjectक्विज़ कॉन्फ़िगरेशन (क्विज़ मोड के लिए)
variablesobjectलॉजिक के लिए फॉर्म-level variables
start_logic_jumpsarrayफॉर्म शुरू होने पर लागू logic jump नियम
webhook_urlstringसबमिशन पर POST प्राप्त करने के लिए URL (Pro प्लान आवश्यक)
limit_one_responsebooleanप्रति विज़िटर एक रिस्पॉन्स तक सीमित करें (डिफ़ॉल्ट: false)
incremental_submissionbooleanउत्तरदाता आगे बढ़ने पर उत्तरों को incrementally सेव करें (डिफ़ॉल्ट: false)
questionsarrayबनाने के लिए प्रश्न objects की array (नीचे देखें)
Request उदाहरण
{
"title": "Customer Feedback Survey",
"description": "Help us improve our product",
"theme_color": "#2563eb",
"background_color": "#ffffff",
"show_progress_bar": true,
"welcome_title": "We value your feedback",
"welcome_description": "This survey takes about 3 minutes.",
"welcome_button_text": "Let's go",
"thank_you_title": "Thank you!",
"thank_you_description": "Your feedback helps us build a better product.",
"questions": [
{
"type": "short_text",
"title": "What is your name?",
"required": true
},
{
"type": "multiple_choice",
"title": "How did you hear about us?",
"required": true,
"properties": {
"choices": [
{ "label": "Search engine" },
{ "label": "Social media" },
{ "label": "Friend or colleague" },
{ "label": "Other" }
],
"allow_multiple": false
}
},
{
"type": "rating",
"title": "How would you rate your overall experience?",
"required": true,
"properties": {
"steps": 5,
"shape": "star"
}
}
]
}
Response
बनाया गया फॉर्म object सभी प्रश्नों के साथ लौटाता है:
{
"id": "665a1b2c3d4e5f6a7b8c9d0e",
"title": "Customer Feedback Survey",
"description": "Help us improve our product",
"slug": "a1b2c3d4e5f6",
"published": false,
"created_at": "2026-02-28T12:00:00.000Z",
"updated_at": "2026-02-28T12:00:00.000Z",
"theme_color": "#2563eb",
"background_color": "#ffffff",
"show_progress_bar": true,
"welcome_title": "We value your feedback",
"welcome_description": "This survey takes about 3 minutes.",
"welcome_button_text": "Let's go",
"thank_you_title": "Thank you!",
"thank_you_description": "Your feedback helps us build a better product.",
"questions": [
{
"id": "66a1b2c3d4e5f6a7b8c9d001",
"type": "short_text",
"title": "What is your name?",
"description": null,
"required": true,
"order": 0,
"properties": {},
"logic_jumps": [],
"validations": {}
},
{
"id": "66a1b2c3d4e5f6a7b8c9d002",
"type": "multiple_choice",
"title": "How did you hear about us?",
"description": null,
"required": true,
"order": 1,
"properties": {
"choices": [
{ "label": "Search engine" },
{ "label": "Social media" },
{ "label": "Friend or colleague" },
{ "label": "Other" }
],
"allow_multiple": false
},
"logic_jumps": [],
"validations": {}
},
{
"id": "66a1b2c3d4e5f6a7b8c9d003",
"type": "rating",
"title": "How would you rate your overall experience?",
"description": null,
"required": true,
"order": 2,
"properties": {
"steps": 5,
"shape": "star"
},
"logic_jumps": [],
"validations": {}
}
]
}
कोड उदाहरण
curl -X POST "https://api.nueform.io/api/v1/forms" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Customer Feedback Survey",
"description": "Help us improve our product",
"questions": [
{
"type": "short_text",
"title": "What is your name?",
"required": true
}
]
}'
फॉर्म प्राप्त करें
/api/v1/forms/:idID द्वारा एक फॉर्म प्राप्त करता है, जिसमें सभी प्रश्न उनकी स्थिति के अनुसार क्रमबद्ध होते हैं।
Path Parameters
idstringफॉर्म ID
Response
{
"id": "665a1b2c3d4e5f6a7b8c9d0e",
"title": "Customer Feedback Survey",
"description": "Help us improve our product",
"slug": "a1b2c3d4e5f6",
"published": true,
"created_at": "2026-01-15T10:30:00.000Z",
"updated_at": "2026-02-20T14:22:00.000Z",
"theme_color": "#2563eb",
"background_color": "#ffffff",
"text_color": null,
"answer_text_color": null,
"placeholder_color": null,
"button_color": null,
"button_text_color": null,
"font_family": null,
"question_font_size": null,
"custom_css": null,
"show_progress_bar": true,
"incremental_submission": false,
"limit_one_response": false,
"welcome_title": "We value your feedback",
"welcome_description": "This survey takes about 3 minutes.",
"welcome_button_text": "Let's go",
"thank_you_title": "Thank you!",
"thank_you_description": "Your feedback helps us build a better product.",
"branding_logo_url": null,
"branding_footer_text": null,
"hide_branding": false,
"mode": "standard",
"webhook_url": null,
"has_unpublished_changes": false,
"published_version_id": "66c3d4e5f6a7b8c9d0e1f2a3",
"response_count": 142,
"questions": [
{
"id": "66a1b2c3d4e5f6a7b8c9d001",
"type": "short_text",
"title": "What is your name?",
"description": null,
"required": true,
"order": 0,
"properties": {},
"logic_jumps": [],
"validations": {}
}
]
}
कोड उदाहरण
curl -X GET "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e" \
-H "Authorization: Bearer YOUR_API_KEY"
फॉर्म अपडेट करें
/api/v1/forms/:idफॉर्म के फ़ील्ड अपडेट करता है और उसके प्रश्नों को synchronize करता है। जब आप questions array शामिल करते हैं, NueForm:
- मौजूदा प्रश्नों को अपडेट करेगा (
idसे मिलान) - नए प्रश्न बनाएगा (कोई
idनहीं या अपरिचितid) - उन प्रश्नों को हटाएगा जो फॉर्म पर मौजूद हैं लेकिन array में नहीं हैं
यदि फॉर्म वर्तमान में प्रकाशित है, तो has_unpublished_changes flag स्वचालित रूप से true पर सेट हो जाता है।
Path Parameters
idstringफॉर्म ID
Request Body
team_id को छोड़कर फॉर्म बनाएं के सभी फ़ील्ड स्वीकार करता है। केवल वे फ़ील्ड शामिल करें जिन्हें आप बदलना चाहते हैं।
Request उदाहरण
{
"title": "Updated Survey Title",
"description": "Revised description for Q2",
"theme_color": "#10b981",
"questions": [
{
"id": "66a1b2c3d4e5f6a7b8c9d001",
"type": "short_text",
"title": "What is your full name?",
"required": true
},
{
"type": "long_text",
"title": "Any additional comments?",
"required": false
}
]
}
Response
अपडेट किया गया फॉर्म object सभी प्रश्नों के साथ लौटाता है (फॉर्म प्राप्त करें जैसा ही schema)।
कोड उदाहरण
curl -X PUT "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Survey Title",
"theme_color": "#10b981"
}'
फॉर्म हटाएं
/api/v1/forms/:idएक फॉर्म और उससे जुड़े सभी डेटा को स्थायी रूप से हटाता है, जिसमें प्रश्न, रिस्पॉन्स, versions, और changelog entries शामिल हैं। संबंधित फ़ाइल अपलोड asynchronously रूप से साफ़ किए जाते हैं।
यह क्रिया अपरिवर्तनीय है। इस फॉर्म के लिए एकत्र किए गए सभी रिस्पॉन्स स्थायी रूप से हटा दिए जाएंगे।
Path Parameters
idstringफॉर्म ID
Response
{
"success": true
}
कोड उदाहरण
curl -X DELETE "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e" \
-H "Authorization: Bearer YOUR_API_KEY"
फॉर्म प्रकाशित करें
/api/v1/forms/:id/publishवर्तमान फॉर्म और उसके प्रश्नों का एक versioned snapshot बनाकर फॉर्म प्रकाशित करता है। प्रत्येक publish version नंबर बढ़ाता है। फॉर्म अपने shareable URL पर सार्वजनिक रूप से उपलब्ध हो जाता है।
Path Parameters
idstringफॉर्म ID
Response
नए version नंबर को दर्शाने वाले published_version फ़ील्ड के साथ फॉर्म object लौटाता है:
{
"id": "665a1b2c3d4e5f6a7b8c9d0e",
"title": "Customer Feedback Survey",
"slug": "a1b2c3d4e5f6",
"published": true,
"has_unpublished_changes": false,
"published_version_id": "66c3d4e5f6a7b8c9d0e1f2a3",
"published_version": 3,
"questions": [ ... ]
}
कोड उदाहरण
curl -X POST "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e/publish" \
-H "Authorization: Bearer YOUR_API_KEY"
फॉर्म अप्रकाशित करें
/api/v1/forms/:id/publishएक फॉर्म को अप्रकाशित करता है, जिससे वह अपने सार्वजनिक URL पर अब उपलब्ध नहीं रहता। प्रकाशित version snapshot बना रहता है ताकि आप बाद में पुनः प्रकाशित कर सकें।
Path Parameters
idstringफॉर्म ID
Response
published को false पर सेट करके अपडेट किया गया फॉर्म object लौटाता है।
{
"id": "665a1b2c3d4e5f6a7b8c9d0e",
"title": "Customer Feedback Survey",
"published": false,
"questions": [ ... ]
}
कोड उदाहरण
curl -X DELETE "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e/publish" \
-H "Authorization: Bearer YOUR_API_KEY"
फॉर्म डुप्लिकेट करें
/api/v1/forms/:id/duplicateसभी प्रश्नों सहित एक मौजूदा फॉर्म की प्रति बनाता है। Logic jump references स्वचालित रूप से नए प्रश्न IDs पर remap हो जाते हैं। डुप्लिकेट फॉर्म हमेशा अप्रकाशित स्थिति में बनाया जाता है।
Path Parameters
idstringडुप्लिकेट करने वाले फॉर्म की ID
Request Body
titlestringनए फॉर्म का शीर्षक (डिफ़ॉल्ट: "Original Title (Copy)")
team_idstringडुप्लिकेट को किसी अन्य टीम को असाइन करें
Request उदाहरण
{
"title": "Customer Feedback Survey v2",
"team_id": "665b2c3d4e5f6a7b8c9d0e1f"
}
Response
published को false पर सेट करके नया बनाया गया फॉर्म object लौटाता है (फॉर्म प्राप्त करें जैसा ही schema)।
कोड उदाहरण
curl -X POST "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e/duplicate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "title": "Customer Feedback Survey v2" }'
Error Responses
सभी endpoints मानक error responses लौटाते हैं।
Error Codes
400Bad RequestValidation error या आवश्यक फ़ील्ड गायब है
401UnauthorizedAPI key गायब या अमान्य है
403Forbiddenटीम फॉर्म्स के लिए अपर्याप्त अनुमतियां
404Not Foundफॉर्म नहीं मिला
500Server ErrorInternal server error
Error उदाहरण
{
"error": "Title is required"
}