# /forms/{formId}/prefill

Generate a prefilled form URL with specified field values

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Formstack API v2025.0",
    "version": "0.0.4"
  },
  "servers": [
    {
      "url": "https://www.formstack.com/api/v2025",
      "description": "Production server"
    },
    {
      "url": "https://staging-formstack.com/api/v2025",
      "description": "Staging server"
    },
    {
      "url": "https://dev-formstack.com/api/v2025",
      "description": "Development server"
    }
  ],
  "paths": {
    "/forms/{formId}/prefill": {
      "post": {
        "tags": [
          "Forms",
          "Classic"
        ],
        "description": "Generate a prefilled form URL with specified field values",
        "operationId": "createFormPrefill",
        "parameters": [
          {
            "name": "formId",
            "in": "path",
            "description": "The ID of the form",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFormPrefillApiDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Get form prefill URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefillResponseApiDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Form not found"
          },
          "500": {
            "description": "Unable to save prefill for form"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PrefillResponseApiDto": {
        "title": "Prefill Response",
        "description": "Prefill response",
        "properties": {
          "prefilledUrl": {
            "description": "Url for prefilled form",
            "type": "string",
            "nullable": false
          }
        },
        "type": "object"
      },
      "CreateFormPrefillApiDto": {
        "title": "Create Form Prefill",
        "description": "Create form prefill",
        "properties": {
          "incompletePassword": {
            "description": "Password for prefill",
            "type": "string",
            "nullable": true
          },
          "workflowStepKey": {
            "description": "Internal use only. Used by Workflows (Copilot) to link form submissions back to workflow steps. Not applicable for standard API usage.",
            "type": "string",
            "nullable": true
          },
          "fields": {
            "description": "Array of field data to prefill with their values",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrefillParsedFieldApiDto"
            },
            "nullable": false
          }
        },
        "type": "object"
      },
      "PrefillParsedFieldAddressValueApiDto": {
        "title": "Prefill Parsed Field Address Value",
        "description": "Prefill parsed field address value",
        "properties": {
          "address": {
            "description": "First part of the address",
            "type": "string",
            "nullable": true
          },
          "address2": {
            "description": "Second part of the address",
            "type": "string",
            "nullable": true
          },
          "city": {
            "description": "City of the address",
            "type": "string",
            "nullable": true
          },
          "country": {
            "description": "Country of the address",
            "type": "string",
            "nullable": true
          },
          "state": {
            "description": "State of the address",
            "type": "string",
            "nullable": true
          },
          "zip": {
            "description": "Zip of the address",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object"
      },
      "PrefillParsedFieldCheckboxValueApiDto": {
        "title": "Prefill Parsed Field Checkbox Value",
        "description": "Prefill parsed field checkbox value",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSubValuesApiDto"
          }
        ]
      },
      "PrefillParsedFieldDatetimeValueApiDto": {
        "title": "Prefill Parsed Field Datetime Value",
        "description": "Prefill parsed field datetime value",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          },
          {
            "properties": {
              "value": {
                "description": "Value of the datetime field",
                "type": "string",
                "nullable": true
              }
            },
            "type": "object"
          }
        ]
      },
      "PrefillParsedFieldEmailValueApiDto": {
        "title": "Prefill Parsed Field Email Value",
        "description": "Prefill parsed field email value",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          },
          {
            "properties": {
              "value": {
                "description": "Value of the email field",
                "type": "string",
                "nullable": true
              }
            },
            "type": "object"
          }
        ]
      },
      "PrefillParsedFieldMatrixValueApiDto": {
        "title": "Prefill Parsed Field Matrix Value",
        "description": "Prefill parsed field matrix value",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSubValuesApiDto"
          }
        ]
      },
      "PrefillParsedFieldNameValueApiDto": {
        "title": "Prefill Parsed Field Name Value",
        "description": "Prefill parsed field name value",
        "properties": {
          "prefix": {
            "description": "Prefix of the name",
            "type": "string",
            "nullable": true
          },
          "first": {
            "description": "First name of the name",
            "type": "string",
            "nullable": true
          },
          "initial": {
            "description": "Initial of the name",
            "type": "string",
            "nullable": true
          },
          "middle": {
            "description": "Middle of the name",
            "type": "string",
            "nullable": true
          },
          "last": {
            "description": "Last name of the name",
            "type": "string",
            "nullable": true
          },
          "suffix": {
            "description": "Suffix of the name",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object"
      },
      "PrefillParsedFieldNumberValueApiDto": {
        "title": "Prefill Parsed Field Number Value",
        "description": "Prefill parsed field number value",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          },
          {
            "properties": {
              "value": {
                "description": "Value of the number field",
                "type": "string",
                "nullable": true
              }
            },
            "type": "object"
          }
        ]
      },
      "PrefillParsedFieldPhoneValueApiDto": {
        "title": "Prefill Parsed Field Phone Value",
        "description": "Prefill parsed field phone value",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          }
        ]
      },
      "PrefillParsedFieldProductValueApiDto": {
        "title": "Prefill Parsed Field Product Value",
        "description": "Prefill parsed field product value",
        "properties": {
          "chargeType": {
            "description": "ChargeType of the product",
            "type": "string",
            "nullable": false
          },
          "quantity": {
            "description": "Quantity of the product",
            "type": "string",
            "nullable": true
          },
          "total": {
            "description": "Total of the product",
            "type": "string",
            "nullable": true
          },
          "unitPrice": {
            "description": "UnitPrice of the product",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object"
      },
      "PrefillParsedFieldRadioValueApiDto": {
        "title": "Prefill Parsed Field Radio Value",
        "description": "Prefill parsed field radio value",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          }
        ]
      },
      "PrefillParsedFieldRatingValueApiDto": {
        "title": "Prefill Parsed Field Rating Value",
        "description": "Prefill parsed field rating value",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          }
        ]
      },
      "PrefillParsedFieldSelectValueApiDto": {
        "title": "Prefill Parsed Field Select Value",
        "description": "Prefill parsed field select value",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          }
        ]
      },
      "PrefillParsedFieldSingleValueApiDto": {
        "title": "Prefill Parsed Field Single Value",
        "description": "Prefill parsed field single value",
        "properties": {
          "value": {
            "description": "Value of the prefill field",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object"
      },
      "PrefillParsedFieldSubValueApiDto": {
        "title": "Prefill Parsed Field SubValue",
        "description": "Prefill parsed field subvalue",
        "properties": {
          "subvalue": {
            "description": "Subvalue of the prefill field",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object"
      },
      "PrefillParsedFieldSubValuesApiDto": {
        "title": "Prefill Parsed Field SubValues",
        "description": "Prefill parsed field subvalues",
        "properties": {
          "subvalues": {
            "description": "Subvalues of the prefill field",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrefillParsedFieldSubValueApiDto"
            },
            "nullable": true
          }
        },
        "type": "object"
      },
      "PrefillParsedFieldTableCellValueApiDto": {
        "title": "Prefill Parsed Field Table Cell Value",
        "description": "Prefill parsed field table cell value",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          },
          {
            "properties": {
              "value": {
                "description": "Value of the table cell field",
                "type": "string",
                "nullable": true
              }
            },
            "type": "object"
          }
        ]
      },
      "PrefillParsedFieldTextValueApiDto": {
        "title": "Prefill Parsed Field Text Value",
        "description": "Prefill parsed field text value",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          }
        ]
      },
      "PrefillParsedFieldTextareaValueApiDto": {
        "title": "Prefill Parsed Field Textarea Value",
        "description": "Prefill parsed field textarea value",
        "allOf": [
          {
            "$ref": "#/components/schemas/PrefillParsedFieldSingleValueApiDto"
          }
        ]
      },
      "PrefillParsedFieldApiDto": {
        "title": "Prefill Parsed Field",
        "description": "Prefill parsed field",
        "properties": {
          "id": {
            "description": "Id of the prefill field",
            "type": "string",
            "nullable": false
          },
          "value": {
            "description": "Value of the prefill field",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/PrefillParsedFieldTextValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldNameValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldAddressValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldProductValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldTableCellValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldDatetimeValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldRatingValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldRadioValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldNumberValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldPhoneValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldEmailValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldTextareaValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldMatrixValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldCheckboxValueApiDto"
              },
              {
                "$ref": "#/components/schemas/PrefillParsedFieldSelectValueApiDto"
              }
            ]
          }
        },
        "type": "object"
      }
    }
  },
  "tags": [
    {
      "name": "Forms",
      "description": "Forms are the core resource of the Formstack API. Use these endpoints to create, retrieve, update, copy, and delete forms, list the forms in an account with filtering and sorting, generate prefilled form URLs, and fetch the embed JavaScript or rendered HTML for a form. Most other resources—fields, submissions, emails, and submit actions—are scoped to a form."
    },
    {
      "name": "Classic",
      "description": "Classic"
    }
  ]
}
```