Skip to content

API - POST Form Submission ​

Use our API to simply integrate HeadlessForms into your project.

sh
https://api.headlessforms.cloud/api/v1/form/{FORM_TOKEN}

Request Example ​

Headers ​

KeyValue
Content-Typeapplication/json
Acceptapplication/json

Request Body ​

json
{
  "name": "John Doe",
  "email": "john@mail.com"
}

CURL request ​

sh
curl --location --request POST 'https://api.headlessforms.cloud/api/v1/form/{FORM_TOKEN}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
	"name": "John Doe",
	"email": "john@mail.com"
}'

Possible Responses ​

Success (200 OK)
json
{
  "status": 200,
  "error": null,
  "message": "Submission Stored",
  "data": []
}
Validation (Error 422 Unprocessable Entity)
json
{
  "status": 422,
  "error": "Validation Failed",
  "message": "Error",
  "data": {
    "email": [
      "The email must be a valid email address."
    ]
  }
}
Form Token Expired (403 Forbidden)
json
{
  "status": 403,
  "error": "Form Token Expired",
  "message": "Error",
  "data": []
}
Unknown Domain (403 Forbidden)
json
{
  "status": 403,
  "error": "Access Denied",
  "message": "Error",
  "data": []
}