Breached password detection is a critical component of secure applications.    Read the white paper

FusionAuth logo
FusionAuth logo
  • Features
    FusionAuth Reactor

    FusionAuth Reactor is a powerful suite of features developed to extend FusionAuth's core functionality.

    • Flexible Architecture   Flexible Architecture
    • Auth the Way You Want It   Auth the Way You Want It
    • Security & Compliance   Security & Compliance
    • Ultimate Password Control   Ultimate Password Control
    • Customizable User Experience   Customizable User Experience
    • Advanced Registration Forms   Advanced Registration Forms
    • Built for Devs   Built for Devs
    • User Management & Reporting   User Management & Reporting
    • Scalability   Scalability
    • Single Sign-on   Single Sign-on
    • Breached Password Detection   Breached Password Detection
    • Connectors   Connectors
    • FusionAuth Reactor   FusionAuth Reactor
  • Pricing
    Cloud Pricing

    Let us host, monitor, manage, and maintain your deployments in your own private cloud.

    SEE PRICING cloud pricing   See FusionAuth Cloud Pricing
    Editions Pricing

    A powerful set of features with available support that extends FusionAuth's core functionality.

    SEE PRICING edition pricing   See FusionAuth Edition Pricing
    Editions + Cloud

    FusionAuth will handle everything so you can get back to building something awesome.

    GET STARTED Get started
  • Docs
  • Downloads
  • Resources
    FusionAuth Resources
    • Upgrade from SaaS
    • Upgrade from Open Source
    • Upgrade from Home Grown
    • Blog   Blog
    • Forum   Forum
    • Community & Support   Community & Support
    • Customer & Partners   Customers & Partners
    • Video & Podcasts   Videos & Podcasts
    • Getting Started   Getting Started
  • Expert Advice
    Expert Advice for Developers

    Learn everything you need to know about authentication, authorization, identity, and access management from our team of industry experts.

    • Authentication   Authentication
    • CIAM   CIAM
    • Identity Basics   Identity Basics
    • OAuth   OAuth
    • Security   Security
    • Tokens   Tokens
    • Dev Tools   Dev Tools
  • Account
Navigate to...
  • Welcome
  • Getting Started
  • 5-Minute Setup Guide
  • Reactor
  • Core Concepts
    • Overview
    • Users
    • Roles
    • Groups
    • Registrations
    • Applications
    • Tenants
    • Identity Providers
    • Authentication and Authorization
    • Integration Points
    • Roadmap
  • Installation Guide
    • Overview
    • System Requirements
    • Server Layout
    • Cluster
    • Docker
    • Fast Path
    • Kickstart™
    • Homebrew
    • Packages
    • Database
    • FusionAuth App
    • FusionAuth Search
    • Securing
    • Upgrading
  • APIs
    • Overview
    • Authentication
    • Errors
    • Actioning Users
    • Applications
    • Audit Logs
    • Connectors
      • Overview
      • Generic
      • LDAP
    • Consent
    • Emails
    • Event Logs
    • Families
    • Forms
    • Form Fields
    • Groups
    • Identity Providers
      • Overview
      • Apple
      • Facebook
      • Google
      • HYPR
      • LinkedIn
      • Twitter
      • OpenID Connect
      • SAML v2
      • External JWT
    • Integrations
    • JWT
    • Keys
    • Lambdas
    • Login
    • Passwordless
    • Registrations
    • Reports
    • System
    • Tenants
    • Themes
    • Two Factor
    • Users
    • User Actions
    • User Action Reasons
    • User Comments
    • Webhooks
  • Client Libraries
    • Overview
    • Dart
    • Go
    • Java
    • JavaScript
    • .NET Core
    • Node
    • PHP
    • Python
    • Ruby
    • Typescript
  • Themes
    • Overview
    • Localization
    • Examples
  • Email & Templates
    • Overview
    • Configure Email
    • Email Templates
  • Events & Webhooks
    • Overview
    • Events
    • Writing a Webhook
    • Securing Webhooks
  • Example Apps
    • Overview
    • Go
    • Java
    • JavaScript
    • .NET Core
    • PHP
    • Python
    • Ruby
  • Lambdas
    • Overview
    • Apple Reconcile
    • External JWT Reconcile
    • Facebook Reconcile
    • Google Reconcile
    • HYPR Reconcile
    • JWT Populate
    • LDAP Connector Reconcile
    • LinkedIn Reconcile
    • OpenID Connect Reconcile
    • SAML v2 Populate
    • SAML v2 Reconcile
    • Twitter Reconcile
  • Identity Providers
    • Overview
    • Apple
    • Facebook
    • Google
    • HYPR
    • LinkedIn
    • Twitter
    • OpenID Connect
      • Overview
      • Azure AD
      • Github
      • Discord
    • SAML v2
      • Overview
      • ADFS
    • External JWT
      • Overview
      • Example
  • Connectors
    • Overview
    • Generic Connector
    • LDAP Connector
    • FusionAuth Connector
  • Integrations
    • Overview
    • CleanSpeak
    • Kafka
    • Twilio
  • OpenID Connect & OAuth 2.0
    • Overview
    • Endpoints
    • Tokens
  • SAML v2 IdP
    • Overview
    • Google
    • Zendesk
  • Plugins
    • Writing a Plugin
    • Password Encryptors
  • Guides
    • Overview
    • Advanced Registration Forms
    • Breached Password Detection
    • Migration
    • Passwordless
    • Securing Your APIs
    • Silent Mode
    • Single Sign-on
  • Tutorials
    • Overview
    • Setup Wizard & First Login
    • Register/Login a User
    • Migrate Users
    • JSON Web Tokens
    • Authentication Tokens
    • Start and Stop FusionAuth
    • Switch Search Engines
    • User Account Lockout
    • Two Factor
  • Reference
    • CORS
    • Configuration
    • Data Types
    • Known Limitations
    • Password Encryptors
  • Release Notes
  • Troubleshooting

Form APIs

Overview

A FusionAuth Form is a customizable object that contains one-to-many ordered steps. Each step is comprised of one or more Form Fields.

The following APIs are provided to manage Forms.

  • Create a Form

  • Retrieve a Form

  • Update a Form

  • Delete a Form

Create a Form

This API is used to create a new Form.

Request

Create a Form with a randomly generated Id

URI

POST /api/form

Create a Form with the provided unique Id

URI

POST /api/form/{formId}

Request Parameters

formId [UUID] Optional defaults to secure random UUID

The Id to use for the new Form. If not specified a secure random UUID will be generated.

Request Body

form.data [Object] Optional

An object that can hold any information about the Form that should be persisted.

form.name [String] Required

The unique name of the Form.

form.steps [Array<Object>] Required

An ordered list of objects containing one or more Form Fields. A Form must have at least one step defined.

Steps manifest in two different ways. When the form type is adminRegistration or adminUser steps will be rendered as sections because there are no multi-step forms within the UI. For registration each step will be considered a step within a multi-step form.

Localization

You may localize the displayed value of this key during registration by adding the key to your theme. For example, if you specify the key value of {user-form-section}1 this key value be rendered in the UI, where 1 specifies the section number to adjust the value of.

Adding the following message to your theme will cause the first section of the User add or edit form to be rendered as "Optionally name me!". This feature allows you to customize and optionally localize each section heading within the User form.

{user-form-section}1=Optionally name me!

You may optionally provide a specific label per tenant by prefixing the value the with the tenant Id as follows:

[cbeaf8fe-f4a7-4a27-9f77-c609f1b01856]{user-form-section}2=Tenant specific label for section 2

You may also optionally provide a specific label per application for a registration form by prefixing the value the with the application Id as follows:

[cfb5fab7-b3b6-41bb-adfa-d23ac83a96e5]{registration-form-section}2=Application specific label for section 2
form.steps[x].fields [Array<UUID>]

An ordered list of Form Field Ids assigned to this step.

form.type [String] Optional defaults to registration Available since 1.20.0

The type of form being created, a form type cannot be changed after the form has been created. This type will be used to identify how this form can be utilized by FusionAuth.

  • registration - This form will be used for self service registration.

  • adminRegistration - This form be used to customize the add and edit User Registration form in the FusionAuth UI. Available since 1.20.0

  • adminUser - This form can be used to customize the add and edit User form in the FusionAuth UI. Available since 1.20.0

Prior to version 1.20.0, the default form type was registration.

Example Request JSON
{
  "form": {
    "data": {
      "description": "This form customizes the registration experience."
    },
    "name": "Custom Registration Form",
    "steps": [
      {
        "fields": [
          "68259c40-0b4e-4245-8956-7e5af0959c2b",
          "00f24e72-52e2-4f55-8ea1-6a06bfe10df5"
        ]
      },
      {
        "fields": [
          "11a5b1b8-7ef5-476f-af7d-69e19796fa8b"
        ]
      }
    ]
  }
}

Response

The response for this API contains the Form that was created.

Table 1. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

Response Body

form.data [Object]

An object that can hold any information about the Form that should be persisted.

form.id [UUID]

The unique Id of the Form.

form.insertInstant [Long]

The instant that the Form was added to the FusionAuth database.

form.lastUpdateInstant [Long]

The instant that the Form was last updated in the FusionAuth database.

form.name [String]

The unique name of the Form.

form.steps [Array<Object>]

An ordered list of objects containing one or more Form Fields.

form.steps[x].fields [Array<UUID>]

An ordered list of Form Field Ids assigned to this step.

form.type [String]

The form type. The possible values are:

  • registration - This form will be used for self service registration.

  • adminRegistration - This form be used to customize the add and edit User Registration form in the FusionAuth UI. Available since 1.20.0

  • adminUser - This form can be used to customize the add and edit User form in the FusionAuth UI. Available since 1.20.0

Example Response JSON
{
  "form": {
    "data": {
      "description": "This form customizes the registration experience."
    },
    "id": "1188edfc-cef3-4555-910e-181ddf6153c0",
    "insertInstant": 1562189072183,
    "lastUpdateInstant": 1562189072183,
    "name": "Custom Registration Form",
    "steps": [
      {
        "fields": [
          "68259c40-0b4e-4245-8956-7e5af0959c2b",
          "00f24e72-52e2-4f55-8ea1-6a06bfe10df5"
        ]
      },
      {
        "fields": [
          "11a5b1b8-7ef5-476f-af7d-69e19796fa8b"
        ]
      }
    ],
    "type": "registration"
  }
}

Retrieve a Form

This API is used to retrieve a single Form by unique Id or all of the configured Forms.

Request

Retrieve all of the Forms

URI

GET /api/form

Retrieve a Form by Id

URI

GET /api/form/{formId}

Request Parameters

formId [UUID] Required

The unique Id of the Form to retrieve.

Response

The response for this API contains either a single Form or all of the Forms. When you call this API with an Id, the response will contain a single Form. When you call this API without an Id, the response will contain all of the Forms. Both response types are defined below along with an example JSON response.

Table 2. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

404

The object you requested doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

Response Body

form.data [Object]

An object that can hold any information about the Form that should be persisted.

form.id [UUID]

The unique Id of the Form.

form.insertInstant [Long]

The instant that the Form was added to the FusionAuth database.

form.lastUpdateInstant [Long]

The instant that the Form was last updated in the FusionAuth database.

form.name [String]

The unique name of the Form.

form.steps [Array<Object>]

An ordered list of objects containing one or more Form Fields.

form.steps[x].fields [Array<UUID>]

An ordered list of Form Field Ids assigned to this step.

form.type [String]

The form type. The possible values are:

  • registration - This form will be used for self service registration.

  • adminRegistration - This form be used to customize the add and edit User Registration form in the FusionAuth UI. Available since 1.20.0

  • adminUser - This form can be used to customize the add and edit User form in the FusionAuth UI. Available since 1.20.0

Example Response JSON
{
  "form": {
    "data": {
      "description": "This form customizes the registration experience."
    },
    "id": "1188edfc-cef3-4555-910e-181ddf6153c0",
    "insertInstant": 1562189072183,
    "lastUpdateInstant": 1562189072183,
    "name": "Custom Registration Form",
    "steps": [
      {
        "fields": [
          "68259c40-0b4e-4245-8956-7e5af0959c2b",
          "00f24e72-52e2-4f55-8ea1-6a06bfe10df5"
        ]
      },
      {
        "fields": [
          "11a5b1b8-7ef5-476f-af7d-69e19796fa8b"
        ]
      }
    ],
    "type": "registration"
  }
}

Response Body

forms [Array]

The list of Form objects.

forms[x].data [Object]

An object that can hold any information about the Form that should be persisted.

forms[x].id [UUID]

The unique Id of the Form.

forms[x].insertInstant [Long]

The instant that the Form was added to the FusionAuth database.

forms[x].lastUpdateInstant [Long]

The instant that the Form was last updated in the FusionAuth database.

forms[x].name [String]

The unique name of the Form.

forms[x].steps [Array<Object>]

An ordered list of objects containing one or more Form Fields.

forms[x].steps[x].fields [Array<UUID>]

An ordered list of Form Field Id’s assigned to this step.

forms[x].type [String]

The Form type. The possible values are:

  • registration - This form will be used for self service registration.

  • adminRegistration - This form be used to customize the add and edit User Registration form in the FusionAuth UI. Available since 1.20.0

  • adminUser - This form can be used to customize the add and edit User form in the FusionAuth UI. Available since 1.20.0

Example Response JSON
{
  "forms": [
    {
      "data": {
        "description": "This form customizes the registration experience.",
      },
      "id": "1188edfc-cef3-4555-910e-181ddf6153c0",
      "insertInstant": 1562189072183,
      "lastUpdateInstant": 1562189072183,
      "name": "Custom Registration Form",
      "steps": [
        {
          "fields": [
            "68259c40-0b4e-4245-8956-7e5af0959c2b",
            "00f24e72-52e2-4f55-8ea1-6a06bfe10df5"
          ]
        },
        {
          "fields": [
            "11a5b1b8-7ef5-476f-af7d-69e19796fa8b"
          ]
        }
      ],
      "type": "registration"
    }
  ]
}

Update a Form

This API is used to update an existing Form.

Request

Update the Form with the given Id

URI

PUT /api/form/{formId}

PATCH /api/form/{formId}

Available since 1.12.0

When using the PATCH method, use the same request body documentation that is provided for the PUT request. The PATCH method will merge the provided request parameters into the existing object, this means all parameters are optional when using the PATCH method and you only provide the values you want changed. A null value can be used to remove a value. Patching an Array will result in all values from the new list being appended to the existing list, this is a known limitation to the current implementation of PATCH.

 

Request Parameters

formId [UUID] Required

The Id of the Form to update.

Request Body

form.data [Object] Optional

An object that can hold any information about the Form that should be persisted.

form.name [String] Required

The unique name of the Form.

form.steps [Array<Object>] Required

An ordered list of objects containing one or more Form Fields. A Form must have at least one step defined.

Steps manifest in two different ways. When the form type is adminRegistration or adminUser steps will be rendered as sections because there are no multi-step forms within the UI. For registration each step will be considered a step within a multi-step form.

Localization

You may localize the displayed value of this key during registration by adding the key to your theme. For example, if you specify the key value of {user-form-section}1 this key value be rendered in the UI, where 1 specifies the section number to adjust the value of.

Adding the following message to your theme will cause the first section of the User add or edit form to be rendered as "Optionally name me!". This feature allows you to customize and optionally localize each section heading within the User form.

{user-form-section}1=Optionally name me!

You may optionally provide a specific label per tenant by prefixing the value the with the tenant Id as follows:

[cbeaf8fe-f4a7-4a27-9f77-c609f1b01856]{user-form-section}2=Tenant specific label for section 2

You may also optionally provide a specific label per application for a registration form by prefixing the value the with the application Id as follows:

[cfb5fab7-b3b6-41bb-adfa-d23ac83a96e5]{registration-form-section}2=Application specific label for section 2
form.steps[x].fields [Array<UUID>]

An ordered list of Form Field Ids assigned to this step.

form.type [String] Optional defaults to registration Available since 1.20.0

The type of form being created, a form type cannot be changed after the form has been created. This type will be used to identify how this form can be utilized by FusionAuth.

  • registration - This form will be used for self service registration.

  • adminRegistration - This form be used to customize the add and edit User Registration form in the FusionAuth UI. Available since 1.20.0

  • adminUser - This form can be used to customize the add and edit User form in the FusionAuth UI. Available since 1.20.0

Prior to version 1.20.0, the default form type was registration.

Example Request JSON
{
  "form": {
    "data": {
      "description": "This form customizes the registration experience."
    },
    "name": "Custom Registration Form",
    "steps": [
      {
        "fields": [
          "68259c40-0b4e-4245-8956-7e5af0959c2b",
          "00f24e72-52e2-4f55-8ea1-6a06bfe10df5"
        ]
      },
      {
        "fields": [
          "11a5b1b8-7ef5-476f-af7d-69e19796fa8b"
        ]
      }
    ]
  }
}

Response

The response for this API contains the Form that was updated.

Table 3. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

404

The object you are trying to updated doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

Response Body

form.data [Object]

An object that can hold any information about the Form that should be persisted.

form.id [UUID]

The unique Id of the Form.

form.insertInstant [Long]

The instant that the Form was added to the FusionAuth database.

form.lastUpdateInstant [Long]

The instant that the Form was last updated in the FusionAuth database.

form.name [String]

The unique name of the Form.

form.steps [Array<Object>]

An ordered list of objects containing one or more Form Fields.

form.steps[x].fields [Array<UUID>]

An ordered list of Form Field Ids assigned to this step.

form.type [String]

The form type. The possible values are:

  • registration - This form will be used for self service registration.

  • adminRegistration - This form be used to customize the add and edit User Registration form in the FusionAuth UI. Available since 1.20.0

  • adminUser - This form can be used to customize the add and edit User form in the FusionAuth UI. Available since 1.20.0

Example Response JSON
{
  "form": {
    "data": {
      "description": "This form customizes the registration experience."
    },
    "id": "1188edfc-cef3-4555-910e-181ddf6153c0",
    "insertInstant": 1562189072183,
    "lastUpdateInstant": 1562189072183,
    "name": "Custom Registration Form",
    "steps": [
      {
        "fields": [
          "68259c40-0b4e-4245-8956-7e5af0959c2b",
          "00f24e72-52e2-4f55-8ea1-6a06bfe10df5"
        ]
      },
      {
        "fields": [
          "11a5b1b8-7ef5-476f-af7d-69e19796fa8b"
        ]
      }
    ],
    "type": "registration"
  }
}

Delete a Form

This API is used to permanently delete a Form. A form cannot be deleted when in use by one or more applications.

Request

Delete a Form by Id

URI

DELETE /api/form/{formId}

Request Parameters

formId [UUID] Required

The unique Id of the Form to delete.

Response

This API does not return a JSON response body.

Table 4. Response Codes
Code Description

200

The request was successful. The response will be empty.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

404

The object you are trying to delete doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.

Feedback

How helpful was this page?

See a problem?

File an issue in our docs repo

Quick Links

  • Download
  • Cloud Pricing
  • Editions Pricing
  • Contact Us
  • Jobs (come work with us)
  • My Account

Resources

  • Docs
  • Blog
  • Community & Support
  • Upgrade from SaaS
  • Upgrade from Homegrown
  • Upgrade from Open Source

Everything Else

  • Privacy Policy
  • Product Privacy Policy
  • License
  • License FAQ
  • Enterprise Sales FAQ
  • Security (contact, bug bounty, etc)
  • Technical Support

Connect with Us

logo
Subscribe for Updates
We only send dev friendly newsletters. No marketing fluff!
© 2021 FusionAuth