NueForm

API Thèmes

Personnaliser l'apparence visuelle de vos formulaires avec des propriétés de thème détaillées.

L'API Thèmes vous permet de lire et mettre à jour le thème visuel complet d'un formulaire. Les propriétés de thème contrôlent les couleurs, les polices, l'image de marque et la mise en page pour le formulaire lui-même et les éléments d'interface individuels comme les boutons, les indicateurs et les options.

Tous les corps de requête et de réponse utilisent des noms de champs en snake_case.

Obtenir le thème du formulaire

GET/api/v1/forms/:id/theme

Récupère toutes les propriétés de thème d'un formulaire.

Paramètres de chemin

idstring

L'identifiant du formulaire

Réponse

json
{
  "theme_color": "#6366f1",
  "background_color": "#0a0a0a",
  "text_color": "#ffffff",
  "answer_text_color": "#e5e7eb",
  "placeholder_color": "#6b7280",
  "button_color": "#6366f1",
  "button_text_color": "#ffffff",
  "title_color": "#f9fafb",
  "description_color": "#d1d5db",
  "option_text_color": "#e5e7eb",
  "indicator_bg_color": "#1f2937",
  "indicator_text_color": "#9ca3af",
  "font_family": "Inter",
  "font_family_answer": "Inter",
  "font_family_button": "Inter",
  "font_family_description": "Inter",
  "font_family_option": "Inter",
  "font_family_indicator": "Inter",
  "question_font_size": "24px",
  "custom_css": null,
  "show_progress_bar": true,
  "branding_logo_url": null,
  "branding_footer_text": null,
  "hide_branding": false,
  "top_logo_url": null,
  "top_logo_size": null,
  "top_logo_alignment": "center",
  "top_logo_css": null,
  "watermark_css": null,
  "welcome_title": "Welcome",
  "welcome_description": null,
  "welcome_button_text": "Start",
  "thank_you_title": "Thank you!",
  "thank_you_description": null
}

Exemples de code

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

Mettre à jour le thème du formulaire

PUT/api/v1/forms/:id/theme

Met à jour les propriétés de thème d'un formulaire. Incluez uniquement les champs que vous souhaitez modifier. Les champs non spécifiés conservent leurs valeurs actuelles.

Paramètres de chemin

idstring

L'identifiant du formulaire

Request Body

Incluez toute combinaison de propriétés de thème de la Référence des propriétés de thème ci-dessous.

Exemple de requête

json
{
  "theme_color": "#2563eb",
  "background_color": "#ffffff",
  "text_color": "#111827",
  "button_color": "#2563eb",
  "button_text_color": "#ffffff",
  "font_family": "Poppins",
  "question_font_size": "28px",
  "show_progress_bar": true,
  "hide_branding": true,
  "top_logo_url": "https://cdn.example.com/logo.svg",
  "top_logo_size": "140px",
  "top_logo_alignment": "left"
}

Réponse

Renvoie l'objet thème complet et mis à jour (même schéma que Obtenir le thème du formulaire).

Exemples de code

bash
curl -X PUT "https://api.nueform.io/api/v1/forms/665a1b2c3d4e5f6a7b8c9d0e/theme" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "theme_color": "#2563eb",
    "background_color": "#ffffff",
    "text_color": "#111827",
    "font_family": "Poppins"
  }'

Référence des propriétés de thème

Voici la liste complète des propriétés de thème disponibles pour la personnalisation.

Propriétés de couleur

theme_colorstring

Primary accent color used throughout the form (focus rings, highlights). Default: "#6366f1"

background_colorstring

Form background color. Default: "#0a0a0a"

text_colorstring

Primary question text color. Default: null

answer_text_colorstring

Color of text typed into answer inputs. Default: null

placeholder_colorstring

Placeholder text color for empty inputs. Default: null

button_colorstring

Background color for submit/next buttons. Default: null

button_text_colorstring

Text color for submit/next buttons. Default: null

title_colorstring

Question title text color (overrides text_color for titles). Default: null

description_colorstring

Question description text color. Default: null

option_text_colorstring

Text color for multiple-choice and dropdown options. Default: null

indicator_bg_colorstring

Background color for the step/question number indicator. Default: null

indicator_text_colorstring

Text color for the step/question number indicator. Default: null

Propriétés de police

font_familystring

Font family for question titles. Supports any Google Font or system font. Default: null

font_family_answerstring

Font family for answer input text. Default: null

font_family_buttonstring

Font family for button labels. Default: null

font_family_descriptionstring

Font family for question descriptions. Default: null

font_family_optionstring

Font family for multiple-choice option labels. Default: null

font_family_indicatorstring

Font family for step/question number indicators. Default: null

question_font_sizestring

Font size for question titles (e.g., "24px", "1.5rem"). Default: null

Mise en page et progression

show_progress_barboolean

Whether to display a progress bar at the top of the form. Default: true

Image de marque

branding_logo_urlstring

URL for a branding logo displayed in the footer area. Default: null

branding_footer_textstring

Custom text displayed in the form footer. Default: null

hide_brandingboolean

Hide the default NueForm branding footer. Default: false

top_logo_urlstring

URL for a logo displayed at the top of the form. Default: null

top_logo_sizestring

Size of the top logo (e.g., "120px", "80px"). Default: null

top_logo_alignmentstring

Horizontal alignment of the top logo: "left", "center", "right". Default: null

top_logo_cssstring

Custom CSS applied to the top logo container. Default: null

watermark_cssstring

Custom CSS applied to the branding watermark. Default: null

Écrans d'accueil et de remerciement

welcome_titlestring

Title text displayed on the welcome screen. Default: null

welcome_descriptionstring

Description text on the welcome screen. Default: null

welcome_button_textstring

Button label on the welcome screen. Default: "Start"

thank_you_titlestring

Title text on the completion screen. Default: "Thank you!"

thank_you_descriptionstring

Description text on the completion screen. Default: null

Avancé

custom_cssstring

Arbitrary CSS injected into the form renderer. Use for advanced customizations that theme properties do not cover. Default: null


Réponses d'erreur

Réponses d'erreur standard renvoyées par ces points 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