Complete guide to integrating with Forms API
Start with 100 free submissions
Forms API lets you collect form submissions without building backend infrastructure. Create forms, get an endpoint, and start collecting data in minutes.
Create your account and get your unique API key from the dashboard.
Design your form in the dashboard or use one of our templates.
Use our API to submit form data and view submissions in your dashboard.
Use this endpoint to submit data to your forms. Requires a valid API key and an active subscription.
Include your API key in the request body. You can find your API key in your dashboard after signing up.
Headers
Content-Type: application/json
JSON Payload
{
"apikey": "YOUR_API_KEY",
"formId": "YOUR_FORM_ID",
"formData": {
"name": "John Doe",
"email": "john@example.com",
"message": "Hello from Forms API!"
}
}
Note: Replace YOUR_API_KEY
and YOUR_FORM_ID
with your actual values from the dashboard.
200 OK
{
"success": true,
"remaining": 19
}
The remaining
field shows how many submissions you have left in your current billing period.
Error Examples
{
"error": "Missing fields"
}
{
"error": "Invalid API key"
}
{
"error": "Active subscription required. Please upgrade your plan.",
"code": "SUBSCRIPTION_REQUIRED"
}
{
"error": "Monthly submission limit exceeded (20).",
"code": "SUBSCRIPTION_LIMIT_EXCEEDED"
}
{
"error": ["Name is required", "Email must be one of a@b.com, c@d.com"]
}
Code | Description |
---|---|
200 | Success - Form submitted successfully |
400 | Bad Request - Missing fields or validation failed |
403 | Forbidden - Invalid API key, no access, or subscription inactive |
404 | Not Found - Form not found |
410 | Gone - Form is archived |
429 | Too Many Requests - Rate limit or submission limit exceeded |
500 | Internal Server Error - Server error |
Basic cURL Request
curl -X POST https://apiforms.com/api/forms/submit \
-H "Content-Type: application/json" \
-d '{
"apikey": "YOUR_API_KEY",
"formId": "YOUR_FORM_ID",
"formData": {
"name": "John Doe",
"email": "john@example.com",
"message": "Hello from Forms API!"
}
}'
Using fetch()
const response = await fetch("https://apiforms.com/api/forms/submit", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
apikey: "YOUR_API_KEY",
formId: "YOUR_FORM_ID",
formData: {
name: "John Doe",
email: "john@example.com",
message: "Hello from Forms API!"
}
})
});
const result = await response.json();
console.log(result);
Using requests library
import requests
response = requests.post("https://apiforms.com/api/forms/submit", json={
"apikey": "YOUR_API_KEY",
"formId": "YOUR_FORM_ID",
"formData": {
"name": "John Doe",
"email": "john@example.com",
"message": "Hello from Forms API!"
}
})
result = response.json()
print(result)
Using cURL in PHP
<?php
$url = 'https://apiforms.com/api/forms/submit';
$data = [
'apikey' => 'YOUR_API_KEY',
'formId' => 'YOUR_FORM_ID',
'formData' => [
'name' => 'John Doe',
'email' => 'john@example.com',
'message' => 'Hello from Forms API!'
]
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$result = json_decode($response, true);
echo json_encode($result, JSON_PRETTY_PRINT);
curl_close($ch);
?>
Our documentation covers the basics, but if you need help implementing Forms API or have questions about advanced features, we're here to help.