API Versions
Consulter l'historique de publication et les instantanés de version de vos formulaires.
L'API Versions vous permet de consulter l'historique de publication d'un formulaire. Chaque fois que vous publiez un formulaire, NueForm crée un instantané versionné contenant la configuration complète du formulaire et toutes les questions à ce moment-là. Les versions incluent également un journal des modifications résumant ce qui a changé depuis la publication précédente.
Tous les corps de réponse utilisent des noms de champs en snake_case.
Lister les versions du formulaire
/api/v1/forms/:id/versionsRenvoie toutes les versions publiées d'un formulaire, triées par numéro de version (la plus récente en premier). Chaque version inclut l'instantané complet du formulaire et un journal des modifications.
Paramètres de chemin
idstringrequisL'identifiant du formulaire
Champs de réponse
idstringUnique version ID
form_idstringThe form this version belongs to
versionintegerSequential version number (1, 2, 3, ...)
published_bystringUser ID of the person who published this version
published_by_namestringDisplay name of the person who published
created_atstringISO 8601 timestamp of when this version was published
changelogarrayList of changes since the previous version
changelog[].typestringChange type (see Changelog Entry Types below)
changelog[].descriptionstringHuman-readable description of the change
snapshotobjectComplete form state at publish time (includes all form fields and questions)
Types d'entrées du journal des modifications
form_createdstringThe form was initially created
publishedstringA publish event (includes version number)
question_addedstringA new question was added
question_updatedstringAn existing question was modified
question_deletedstringA question was removed
question_reorderedstringQuestions were reordered
theme_changedstringA theme property was modified
settings_changedstringA form setting was modified
title_changedstringThe form title was changed
description_changedstringThe form description was changed
Réponse
{
"versions": [
{
"id": "66c3d4e5f6a7b8c9d0e1f2a3",
"form_id": "665a1b2c3d4e5f6a7b8c9d0e",
"version": 3,
"published_by": "665a0a1b2c3d4e5f6a7b8c9d",
"published_by_name": "Alice Johnson",
"created_at": "2026-02-28T14:00:00.000Z",
"changelog": [
{
"type": "question_updated",
"description": "Updated question: \"How did you hear about us?\""
},
{
"type": "question_added",
"description": "Added question: \"Would you recommend us to a friend?\""
},
{
"type": "theme_changed",
"description": "Changed theme color from #6366f1 to #2563eb"
}
],
"snapshot": {
"title": "Customer Feedback Survey",
"description": "Help us improve our product",
"theme_color": "#2563eb",
"background_color": "#ffffff",
"show_progress_bar": true,
"questions": [
{
"id": "66a1b2c3d4e5f6a7b8c9d001",
"type": "short_text",
"title": "What is your name?",
"required": true,
"order": 0,
"properties": {}
},
{
"id": "66a1b2c3d4e5f6a7b8c9d002",
"type": "multiple_choice",
"title": "How did you hear about us?",
"required": true,
"order": 1,
"properties": {
"choices": [
{ "label": "Search engine" },
{ "label": "Social media" },
{ "label": "Friend or colleague" },
{ "label": "Other" }
]
}
},
{
"id": "66a1b2c3d4e5f6a7b8c9d004",
"type": "yes_no",
"title": "Would you recommend us to a friend?",
"required": false,
"order": 2,
"properties": {}
}
]
}
},
{
"id": "66c2d3e4f5a6b7c8d9e0f1a2",
"form_id": "665a1b2c3d4e5f6a7b8c9d0e",
"version": 2,
"published_by": "665a0a1b2c3d4e5f6a7b8c9d",
"published_by_name": "Alice Johnson",
"created_at": "2026-02-15T10:30:00.000Z",
"changelog": [
{
"type": "question_added",
"description": "Added question: \"How did you hear about us?\""
}
],
"snapshot": { ... }
},
{
"id": "66c1d2e3f4a5b6c7d8e9f0a1",
"form_id": "665a1b2c3d4e5f6a7b8c9d0e",
"version": 1,
"published_by": "665a0a1b2c3d4e5f6a7b8c9d",
"published_by_name": "Alice Johnson",
"created_at": "2026-01-15T10:30:00.000Z",
"changelog": [
{
"type": "form_created",
"description": "Created form"
}
],
"snapshot": { ... }
}
]
}
Exemples de code
curl -X GET "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e/versions" \
-H "Authorization: Bearer YOUR_API_KEY"
Comment fonctionne le versionnement
- Edit -- Make changes to your form (add questions, update theme, modify settings). The form's
has_unpublished_changesflag is set totrue. - Publish -- Call
POST /api/v1/forms/:id/publishto create a new version. NueForm takes a snapshot of the current form state, records the changelog, and increments the version number. - Live form -- Respondents always see the latest published version. The
published_version_idon the form points to the active version. - Unpublish -- Call
DELETE /api/v1/forms/:id/publishto take the form offline. The version history is preserved.
The current form state (editable via the Forms API) may differ from the latest published version if edits have been made since the last publish.
Réponses d'erreur
Réponses d'erreur standard renvoyées par ce point d'accès.
Codes d'erreur
401UnauthorizedClé API manquante ou invalide
403ForbiddenPermissions insuffisantes pour les formulaires d'équipe
404Not FoundFormulaire introuvable
500Server ErrorErreur interne du serveur
Exemple d'erreur
{
"error": "Form not found"
}