Docs Sending submissions
Docs
Sending submissions
Every endpoint gets one
email and
message) — see below for why.
The endpoint URL
Every endpoint has its own URL in this shape:
https://postto.dev/api/v1/send/YOUR_TOKEN
YOUR_TOKEN is a unique, unguessable identifier generated when you create the endpoint — it's shown in the dashboard and doubles as
the credential for token mode. You'll find the exact URL to copy on your endpoint's page.
Sending a request
PostTo accepts JSON, standard form encoding, and multipart form data — whatever your form or HTTP client sends by default is fine. The request
body must include at least one field, or PostTo rejects it with empty_submission; beyond that, any field name is accepted and
stored as-is.
Four field names are also read as shortcuts for building the outgoing email — subject, message, email,
and name (see field mapping for the full detail, including how to use
different names). None of them are individually required by PostTo, but if you skip message and email entirely, the
email you receive won't have a body or a reply-to address — so in practice, include at least those two.
curl -X POST https://postto.dev/api/v1/send/YOUR_TOKEN \
-H "Content-Type: application/json" \
-d '{"subject":"Contact form","message":"Hello, I would like to...","email":"[email protected]","name":"Jane Smith"}'
<form method="POST" action="https://postto.dev/api/v1/send/YOUR_TOKEN">
<input type="text" name="name" placeholder="Name">
<input type="email" name="email" placeholder="Email">
<input type="text" name="subject" placeholder="Subject">
<textarea name="message" placeholder="Message"></textarea>
<button type="submit">Send</button>
</form>
await fetch('https://postto.dev/api/v1/send/YOUR_TOKEN', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
subject: 'Contact form',
message: 'Hello, I\'d like to...',
email: '[email protected]',
name: 'Jane Smith',
}),
});
$ch = curl_init('https://postto.dev/api/v1/send/YOUR_TOKEN');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'subject' => 'Contact form',
'message' => "Hello, I'd like to...",
'email' => '[email protected]',
'name' => 'Jane Smith',
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
]);
curl_exec($ch);
curl_close($ch);
Http::post('https://postto.dev/api/v1/send/YOUR_TOKEN', [
'subject' => 'Contact form',
'message' => "Hello, I'd like to...",
'email' => '[email protected]',
'name' => 'Jane Smith',
]);
import requests
requests.post(
'https://postto.dev/api/v1/send/YOUR_TOKEN',
json={
'subject': 'Contact form',
'message': "Hello, I'd like to...",
'email': '[email protected]',
'name': 'Jane Smith',
},
)
What comes back
A plain HTML form (no special headers) gets redirected to a hosted "thanks" page — nothing for you to build. If your client sends Accept:
application/json, you get a JSON response instead — the right choice for a fetch/AJAX submission that shows its own success or error
message without a full page reload. Full detail on both shapes is on the response format
page.
Accept header — there's no browser involved to
redirect.
Try it against your own form
Create an endpoint and get a working URL in under a minute — free plan, no credit card.
Start for free