Technical Documentation

Form Submission API Reference: Endpoints & Codes

The public HTTP POST endpoint contract for Form2Lead — request formats, response codes, error payloads, and rate-limit headers, with examples.

Last updated: 2026-08-15
Direct Answer

What is the core specification for form submission api reference: endpoints & codes?

Form2Lead public endpoints (POST https://form2lead.com/api/v1/f/YOUR_FORM_ID) accept application/x-www-form-urlencoded, multipart/form-data, and application/json payloads. Valid browser submissions return 302 Found (redirect to your success page); AJAX submissions with Accept: application/json return 201 Created with a JSON body.

// Example Code
POST /api/v1/f/YOUR_FORM_ID HTTP/1.1
Host: form2lead.com
Content-Type: application/json

{
  "name": "Jane Doe",
  "email": "jane@example.com",
  "message": "Project quote inquiry"
}

Request contract

Send POST requests to /api/v1/f/{publicKey} where {publicKey} is your form’s public endpoint key from the dashboard. The endpoint is intentionally unauthenticated — the key identifies the form, not the caller. Every request is rate-limited, origin-checked, and spam-validated server-side.

Response codes

Browser submissions receive 302 Found to your success URL. AJAX submissions (Accept: application/json) receive 201 Created on success, 403 ORIGIN_NOT_ALLOWED when the Origin header is not in the form’s allowed-domains list, 404 FORM_NOT_FOUND for unknown keys, and 429 RATE_LIMITED for over-limit callers. Error bodies are JSON with an error code and message.

Form Submission API Reference: Endpoints & Codes FAQ

Direct Answer

Can I submit application/json payloads?

Yes. Send an Accept: application/json header with a JSON body and Form2Lead parses top-level keys into submission fields.