NueForm

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

GET/api/v1/forms/:id/versions

Renvoie 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

idstringrequis

L'identifiant du formulaire

Champs de réponse

idstring

Unique version ID

form_idstring

The form this version belongs to

versioninteger

Sequential version number (1, 2, 3, ...)

published_bystring

User ID of the person who published this version

published_by_namestring

Display name of the person who published

created_atstring

ISO 8601 timestamp of when this version was published

changelogarray

List of changes since the previous version

changelog[].typestring

Change type (see Changelog Entry Types below)

changelog[].descriptionstring

Human-readable description of the change

snapshotobject

Complete form state at publish time (includes all form fields and questions)

Types d'entrées du journal des modifications

form_createdstring

The form was initially created

publishedstring

A publish event (includes version number)

question_addedstring

A new question was added

question_updatedstring

An existing question was modified

question_deletedstring

A question was removed

question_reorderedstring

Questions were reordered

theme_changedstring

A theme property was modified

settings_changedstring

A form setting was modified

title_changedstring

The form title was changed

description_changedstring

The form description was changed

Réponse

json
{
  "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

bash
curl -X GET "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e/versions" \
  -H "Authorization: Bearer YOUR_API_KEY"

Comment fonctionne le versionnement

  1. Edit -- Make changes to your form (add questions, update theme, modify settings). The form's has_unpublished_changes flag is set to true.
  2. Publish -- Call POST /api/v1/forms/:id/publish to create a new version. NueForm takes a snapshot of the current form state, records the changelog, and increments the version number.
  3. Live form -- Respondents always see the latest published version. The published_version_id on the form points to the active version.
  4. Unpublish -- Call DELETE /api/v1/forms/:id/publish to 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

401Unauthorized

Clé API manquante ou invalide

403Forbidden

Permissions insuffisantes pour les formulaires d'équipe

404Not Found

Formulaire introuvable

500Server Error

Erreur interne du serveur

Exemple d'erreur

json
{
  "error": "Form not found"
}
Dernière mise à jour : 6 avril 2026