Inletbase Form Submission API Reference

Last updated:

Submit data programmatically from your own applications or use our drop-in HTML scripts. Every form you create in Inletbase automatically generates a secure, CORS-enabled submission endpoint.

Authentication
API Key Required

Via Header or Query Parameter.

Rate Limit
30 / min per IP

Plus 120 / min per API key.

Before you start, create an API key in your dashboard.


Zero-Code HTML Embed

The easiest way to integrate a static HTML site. Drop our script into your site's <footer> or <head> and add data attributes to your form. We handle the fetch() request and UI loading states automatically.

<!-- 1. Add the script (requires your API key) -->
<script src="https://inletbase.com/inletbase.js" data-api-key="YOUR_API_KEY"></script>

<!-- 2. Build your form (add data-inletbase-form with your form slug) -->
<form data-inletbase-form="your-form-slug" data-inletbase-loading="Sending..." data-inletbase-success="Thanks!">
  <input type="email" name="email" required />
  <button type="submit">Submit</button>
</form>

Attributes: Use data-inletbase-loading to customize the loading text on the submit button and data-inletbase-success to customize the success message shown after submission.


REST Endpoint

POSThttps://inletbase.com/api/v1/forms/{slug}/submit

Authentication

You must authenticate your requests using your API Key. This can be done in two ways:

1. Bearer Token (Recommended for backends)

Include the API Key in the Authorization header.

Authorization: Bearer YOUR_API_KEY

2. Magic URL (For Webflow, Framer, and No-Code)

Append the API Key directly to the endpoint URL as a query parameter. This is required for platforms like Webflow and Framer that do not allow custom headers in their form actions.

https://inletbase.com/api/v1/forms/{slug}/submit?apikey=YOUR_API_KEY

Is my API key safe to expose?

Treat it as publishable, not secret. The zero-code embed puts the key in your page source and the Magic URL puts it in a form action, so in both cases a visitor can read it. Nothing can be hidden inside a browser, so the key is designed to be submitted with, not protected from, your front end.

What that means in practice, and what limits the damage if someone copies it:

  • Allowed domains: list the sites that may use a form, under Settings → General. A browser cannot lie about which site it is on, so submissions from anywhere else are rejected.
  • Browser submissions only: the check above is only trustworthy for browser traffic, because a browser will not let a page lie about which site it is on. Anything that is not a browser can omit that information or state it falsely, and by default those submissions are still accepted. Turn this switch on, next to the domain list, to reject them. Leave it off if anything submits the form from a server rather than a browser, such as the WordPress plugin, a Framer webhook, or your own backend.
  • Scope: a key only reaches forms in the organization that created it, and it can only create submissions. It cannot read them, change settings, or touch billing.
  • Rate limits: 30 requests per minute per IP address and 120 per minute per key, which blunts bulk abuse but will not stop a determined caller from spending your monthly submission allowance. The domain list is the control that matters here.
  • One key per site: create a separate key for each site or integration under API keys. Then a leak is contained, and revoking one key does not break the others.
  • Revoke and rotate: revoking takes effect immediately. A revoked key returns 403.

For server-side use, keep the key on your server, send it in the Authorization header rather than the URL, and never ship it in client-side JavaScript you did not intend to be public.

Payload Structure

Send a JSON object where keys match the form fields defined in your Inletbase dashboard.

{
  "email": "user@example.com",
  "full_name": "John Doe",
  "message": "Hello from API"
}

Note: Any extra fields sent in the JSON payload that are not explicitly defined in your form will still be accepted and stored as metadata.

Code examples

Complete requests you can copy and run. Replace YOUR_FORM_SLUG with your form's slug and YOUR_API_KEY with your key. Both send the key in a request header, which keeps it out of the URL and out of your server logs.

cURL

curl -X POST \
  https://inletbase.com/api/v1/forms/YOUR_FORM_SLUG/submit \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@example.com",
    "full_name": "Jane Doe",
    "message": "Hello from cURL"
  }'

JavaScript (fetch)

Checks res.ok before trusting the response, and reads the error body so a failed submission can be shown to the person who filled in the form.

const res = await fetch(
  'https://inletbase.com/api/v1/forms/YOUR_FORM_SLUG/submit',
  {
    method: 'POST',
    headers: {
      Authorization: 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      email: 'jane@example.com',
      full_name: 'Jane Doe',
      message: 'Hello from fetch',
    }),
  }
);

const data = await res.json();

if (!res.ok) {
  // Errors carry either "error" or "message". On a 400,
  // "details" holds one entry per field that needs fixing.
  console.error(data.error || data.message, data.details);

  if (res.status === 429) {
    console.log('Retry after', res.headers.get('Retry-After'), 'seconds');
  }
  return;
}

console.log('Submitted:', data.submissionId);

Response Format

Success (200 OK)

{
  "success": true,
  "submissionId": "abc123",
  "message": "Form submitted successfully",
  "status": 200
}

Error Responses

If validation fails, the API returns a 400 with the fields that need fixing:

{
  "success": false,
  "message": "Validation failed",
  "details": {
     "email": "Invalid email address format."
  },
  "status": 400
}

Authentication and lookup errors return a simpler shape with the matching HTTP status, for example401 when the API key is missing, 403 when it is invalid, and 404 when the form is not found:

{
  "error": "Invalid API Key"
}

Status codes

Every status the submit endpoint can return. There are two error bodies: validation and quota errors use the success / message / details shape, while authentication, rate limit, size and lookup errors use the shorter error shape. Read data.error || data.message to cover both.

CodeMeaningBody
200Submission accepted.success, submissionId, message, status
303Redirect, when you send a _redirect to your own origin.No body
400Validation failed, or the body could not be parsed.details lists each field, or error
401No API key was sent.error
403Key invalid, key from another organization, domain not allowed, monthly limit reached, or uploads not permitted.error or message
404No form with that slug in your organization.error
413Request body is larger than 5MB.error
429Rate limit hit: 30 per minute per IP, or 120 per minute per API key.error, plus a Retry-After header
500Something failed on our side. Safe to retry.error or message

There is no 415. The endpoint accepts application/json, application/x-www-form-urlencoded and multipart/form-data; anything else it cannot parse returns 400. Successful responses also carry X-RateLimit-Limit and X-RateLimit-Remaining, so you can back off before hitting 429.

Machine-readable spec

The submit endpoint is also published as an OpenAPI 3.1 document at /openapi.json, for generating clients or importing into Postman and Insomnia.


Frequently Asked Questions

How do I submit a form to Inletbase using the API?

Send a POST request to https://inletbase.com/api/v1/forms/{slug}/submit with your API key and a JSON body whose keys match your form fields. A successful request returns 200 OK with success set to true and a submissionId.

How do I authenticate API requests?

Authenticate with your API key in one of two ways. Send it in the Authorization header as Bearer YOUR_API_KEY (recommended for backends), or add it to the endpoint URL as the apikey query parameter (Magic URL).

What is a Magic URL and when should I use it?

A Magic URL is the submission endpoint with your API key added as a query parameter: https://inletbase.com/api/v1/forms/{slug}/submit?apikey=YOUR_API_KEY. Use it on platforms such as Webflow and Framer that do not allow custom headers in form actions.

How do I use the zero-code HTML embed?

Add the Inletbase script, with your API key in the data-api-key attribute, to your site's head or footer. Then add data-inletbase-form with your form slug to your form tag. The script sends the request and handles loading states for you. Use data-inletbase-loading and data-inletbase-success to customize the button text and the success message.

What are the API rate limits?

Requests are limited to 30 per minute per IP address, plus 120 per minute per API key.

What does the API return on success or error?

A successful submission returns 200 with success, submissionId, message and status fields. If validation fails, the API returns 400 with a details object listing the fields that need fixing.

Can I send fields that are not in my form?

Yes. Extra fields in the JSON payload that are not defined in your form are still accepted and stored as metadata.

What do the 401, 403 and 404 errors mean?

401 means the API key is missing, 403 means it is invalid, and 404 means the form was not found. These errors return a simple JSON body with an error message.

Is my API key safe to put in public HTML?

Treat it as publishable rather than secret. The zero-code embed and the Magic URL both place the key where a visitor can read it, because nothing can be hidden inside a browser. Limit what a copied key can do by listing allowed domains for the form, turning on browser submissions only so scripts cannot skip that list, and creating a separate key for each site so you can revoke one without breaking the others. A key can only create submissions; it cannot read them or change settings.