Skip to main content

Endpoint

POST /api/f/{form_slug}
No authentication required for form submissions.

Request

Headers

Content-Type: application/json
Accept: application/json  # Optional, for JSON response

Body

Any JSON object with your form fields:
{
  "name": "John Doe",
  "email": "[email protected]",
  "message": "Hello!"
}

Examples

cURL

curl -X POST https://spike.ac/api/f/YOUR_FORM_SLUG \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"email":"[email protected]","message":"Hello"}'

JavaScript

const response = await fetch('https://spike.ac/api/f/YOUR_FORM_SLUG', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  },
  body: JSON.stringify({
    email: '[email protected]',
    message: 'Hello!'
  })
});

const result = await response.json();

Form Data

const formData = new FormData();
formData.append('email', '[email protected]');
formData.append('message', 'Hello!');

const response = await fetch('https://spike.ac/api/f/YOUR_FORM_SLUG', {
  method: 'POST',
  body: formData,
  headers: { 'Accept': 'application/json' }
});

Response

Success (200)

{
  "success": true,
  "message": "Form submitted successfully"
}

Redirect

Without Accept: application/json, successful submissions redirect to:
  1. The _next field value (if provided)
  2. The form’s configured redirect URL
  3. A default thank-you page

Special Fields

These fields control behavior and are not stored:
FieldDescription
_nextRedirect URL after submission
_subjectCustom email subject
_replytoReply-to email address
_gotchaHoneypot field (keep hidden)
g-recaptcha-responsereCAPTCHA token