API Documentation

Everything you need to integrate API4Forms

Complete API reference, guides, and examples to get your forms up and running in minutes.

Quick Start

1. Get your Form ID

Sign up for free and create your first form to get a unique Form ID.

2. Choose your integration method

<form action="https://api.api4forms.com/submit/your-form-id" method="POST">
  <input type="text" name="name" placeholder="Your Name" required>
  <input type="email" name="email" placeholder="Your Email" required>
  <textarea name="message" placeholder="Your Message" required></textarea>
  <button type="submit">Send Message</button>
</form>

Authentication

API4Forms supports both public and authenticated endpoints. For public form submissions, no authentication is required. For accessing your dashboard data, use your API key.

API Key Authentication

Include your API key in the X-API-Key header:

X-API-Key: api4f_1234567890abcdef

Security Note: Never expose your API key in client-side code. Use it only in server-side applications or secure environments.

API Reference

Base URL: https://api.api4forms.com

POST
/submit/{form-id}
Optional

Submit form data

GET
/forms
Required

List all your forms

POST
/forms
Required

Create a new form

GET
/forms/{form-id}/submissions
Required

Get form submissions

DELETE
/forms/{form-id}
Required

Delete a form

Webhooks

Webhooks allow you to receive real-time notifications when forms are submitted. Configure webhook URLs in your dashboard to receive POST requests with submission data.

Webhook Payload Example

{
  "event": "form.submitted",
  "form_id": "your-form-id",
  "submission_id": "sub_1234567890",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "name": "John Doe",
    "email": "john@example.com",
    "message": "Hello from API4Forms!"
  },
  "metadata": {
    "ip_address": "192.168.1.1",
    "user_agent": "Mozilla/5.0...",
    "referrer": "https://yoursite.com/contact"
  }
}

Error Handling

API4Forms uses conventional HTTP response codes to indicate success or failure.

200
Success - Form submitted successfully
400
Bad Request - Invalid form data or missing required fields
401
Unauthorized - Invalid or missing API key
403
Forbidden - Form submissions disabled or quota exceeded
404
Not Found - Form ID does not exist
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error - Something went wrong on our end

Rate Limits

To ensure fair usage and prevent abuse, API4Forms implements rate limits based on your plan.

Free

60 requests/hour

100/month

Pro

1,000 requests/hour

10,000/month

Team

10,000 requests/hour

100,000/month

Rate limit information is included in response headers:X-RateLimit-Remaining andX-RateLimit-Reset

Official SDKs & Libraries

JavaScript/Node.js

Available
npm install api4forms

Python

Available
pip install api4forms

PHP

Coming Soon
composer require api4forms/php-sdk

Ruby

Coming Soon
gem install api4forms