Standard HTML forms

Post a native HTML form and use the configured success redirect.

No JavaScript is required for a basic form. The browser posts URL-encoded data and receives a 303 redirect on success.

<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>

<form action="https://api.postvia.dev/v1/forms/abc123/submissions" method="POST">
  <label>Name <input name="name" autocomplete="name" required></label>
  <label>Email <input name="email" type="email" autocomplete="email" required></label>
  <label>Message <textarea name="message" required></textarea></label>

  <div hidden>
    <input name="_honeypot" tabindex="-1" autocomplete="off">
  </div>

  <div class="cf-turnstile" data-sitekey="YOUR_SITE_KEY" data-action="contact"></div>

  <button type="submit">Send</button>
</form>

Success redirect

The API redirects to the form’s configured HTTPS success URL. If none is configured, it redirects to the hosted thank-you page at https://api.postvia.dev/thanks.

The redirect URL is validated when saved. Postvia never redirects to a URL supplied by the visitor.

Idempotency for HTML forms

Use the reserved field if you need safe retries without JavaScript:

<input type="hidden" name="_idempotency_key" value="550e8400-e29b-41d4-a716-446655440000">

Do not combine a different Idempotency-Key header with this field. Conflicting values are rejected.

Errors

Native form errors render a generic, accessible HTML page. The page never echoes private input. For field-level errors, use a JavaScript integration and read the JSON 422 response.