Integrate TruePost forms on your site — endpoints, metadata fields, honeypots, and redirects.
Each form exposes a public POST endpoint. You can find the exact URL on the form page in TruePost.
POST /f/{form-id}
Content-Type: application/x-www-form-urlencoded
email=hello@example.com&message=Hello!
Send fields as top-level form keys, or wrap them in a JSON payload object when posting JSON.
For standard HTML form posts (not JSON), TruePost redirects the browser after a successful submission.
Set a default redirect URL in the form Settings tab. When a submission is accepted, the user is sent there.
Add a hidden _redirect field to override the redirect for that specific form instance. The URL must use an allowed origin for the form.
<form action="https://truepost.test/f/your-form-id" method="POST">
<input type="email" name="email" required>
<textarea name="message" required></textarea>
<input type="hidden" name="_redirect" value="https://yoursite.com/thank-you-contact">
<button type="submit">Send</button>
</form>
_redirect takes precedence when its host matches an allowed origin. It is not stored as submission data.
When protection is enabled, include a started_at timestamp (Unix seconds) when the user opened the form. Submissions that arrive too quickly may be flagged as spam.
The integration snippet on each form page includes this hidden field and loads TruePost's embed script automatically. You can also add it manually:
<input type="hidden" name="started_at" value="">
<script src="https://truepost.app/truepost.js" defer></script>
Add a honeypot field in the Fields tab (default name _website). Render a hidden input on your site with the same name. Real users leave it empty; bots that fill it are rejected when protection is enabled.
<input type="text" name="_website" tabindex="-1" autocomplete="off"
aria-hidden="true" class="sr-only">
The honeypot field name must match the field defined in TruePost. You can rename it, but both sides must stay in sync.
Send Accept: application/json to receive a JSON response instead of a browser redirect.
POST /f/{form-id}
Accept: application/json
Content-Type: application/json
{
"payload": {
"email": "hello@example.com",
"message": "Hello!"
},
"started_at": 1716123456
}
Accepted submissions return 201 with status: accepted. Rejected submissions return 422.
Drop one POST into your site. Get back a decision, a trace, and a clean inbox. Stop pruning spam by hand.