Add contacts from your own form with the API
Last updated November 28, 2026
Use this guide if you want to build your own signup form, styled exactly like your website, and send each signup to Simpu with our API. You'll need someone who is comfortable with HTML and JavaScript.
If you'd rather not write code, use a Simpu signup form instead. See Add a signup form to your website.
How it works
Your form sends each signup from the visitor's browser straight to Simpu, using your publishable key, and Simpu adds it to your contacts.
- Endpoint:
POST https://api.v1.simpu.co/lists/contact/rows - Headers:
Authorization: <your publishable key>(the key on its own, with noBearer) andContent-Type: application/json - Body:
{"columns": {"<column ID>": "<value>"}}, with one entry for each field you send
Step 1: Get a publishable key
- In Simpu, go to Developers → API Keys.
- Under Publishable Key, click Generate publishable key.
- Under Allowed Origins, type your website's address and press Enter.
- Click Generate key, then copy the key. It starts with
spk__.

Type the address exactly as it appears in the browser's address bar when someone visits your site: include https://, and leave out the trailing slash and any page path (https://example.com, not https://example.com/). If your site opens on both example.com and www.example.com without one redirecting to the other, add both.
The key only works on those addresses. It can't read or delete your contacts, or overwrite anything in them, so it's safe to put in your website's code.
Step 2: Find your column IDs
Every field in your contact list (Name, Email, Phone and any you've added) has an ID. You need the ID of each field your form fills.

- On Developers → API Keys, under Secret Keys, click Generate key and copy the key. Simpu shows it only once.
- In a terminal, run this, replacing
YOUR_SECRET_KEY:
curl https://api.v1.simpu.co/lists/contact \
-H "Authorization: YOUR_SECRET_KEY"- In the response, find
data.table.columns. Note theidof each field you need:
{
"data": {
"table": {
"columns": [
{ "id": "674535b2b39158b9aae90188fcec23ec", "name": "Name", "type": "TEXT" },
{ "id": "674535b2b39158b9aae90188fcec23ed", "name": "Email", "type": "EMAIL" },
{ "id": "674535b2b39158b9aae90188fcec23ee", "name": "Phone", "type": "PHONE NUMBER" }
]
}
}
}Keep your secret key private. It can read and change all your contacts. Never put it in your website's code, and revoke it on Developers → API Keys if it leaks.
Step 3: Choose the fields your key can fill
The publishable key can only fill the fields that are visible on your signup form.
- Go to Contacts and click Form in the left panel.
- On the Fields tab, drag every field your form sends into Visible Fields.
- Click Save.

You don't have to use this form on your website. It only tells Simpu which fields your key may fill.
Mark a field Required there only if your form always sends it. Simpu refuses a signup that leaves a required field out.
Step 4: Add your form to your website
Here's a complete newsletter form. Replace the key and the two column IDs with yours, then style it however you like.
<form id="newsletter-form">
<label for="newsletter-name">Name</label>
<input id="newsletter-name" name="name" autocomplete="name">
<label for="newsletter-email">Email</label>
<input id="newsletter-email" name="email" type="email" autocomplete="email" required>
<button type="submit">Subscribe</button>
<p id="newsletter-status" role="status"></p>
</form>
<script>
(() => {
const SIMPU_KEY = "spk__your_publishable_key";
const COLUMN_IDS = {
name: "NAME_COLUMN_ID",
email: "EMAIL_COLUMN_ID",
};
const form = document.getElementById("newsletter-form");
const status = document.getElementById("newsletter-status");
const button = form.querySelector("button");
form.addEventListener("submit", async (event) => {
event.preventDefault();
button.disabled = true;
status.textContent = "Subscribing…";
const columns = {};
for (const [field, columnId] of Object.entries(COLUMN_IDS)) {
const value = form.elements[field].value.trim();
if (value) columns[columnId] = value;
}
try {
const response = await fetch("https://api.v1.simpu.co/lists/contact/rows", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: SIMPU_KEY,
},
body: JSON.stringify({ columns }),
});
if (!response.ok) throw new Error(`Simpu returned ${response.status}`);
form.reset();
status.textContent = "Thanks! You're on the list.";
} catch (error) {
console.error(error);
status.textContent = "Something went wrong. Please try again.";
} finally {
button.disabled = false;
}
});
})();
</script>On WordPress, paste it into a Custom HTML block where you want the form, then click Update. On other sites, paste it into the page's HTML or an Embed or Custom code block.
Here's that form on a bookshop's homepage, styled to match the site, just after someone signed up:

Values for each field type
- Text, Email, URL, Number and Date: send the value as text, for example
"ada@example.com". Send dates as"2026-12-31". - Phone number: text with the country code, for example
"+2348012345678". - Select: the option's
idfrom the column'soptionsin step 2, for example"3". - Multi-select: a list of option
ids, for example["3", "5"]. - Checkbox:
"true"when it's ticked. Leave it out otherwise.
Leave out any field the visitor left empty.
Step 5: Test it
- Open your website at its real address in a private browser window.
- Sign up with an email address that isn't in your contacts yet.
- In Simpu, go to Contacts → List. Your new contact is at the bottom of the list.

If it doesn't arrive, open the browser's developer tools and look at the request to api.v1.simpu.co:
- 401, "This website is not allowed to use this publishable key": the page's address isn't one of your allowed origins. Check
https://andwww.. - 401, "You are not authorized to access this resource": the key is wrong or has been regenerated.
- 400, "Please check the form and try again.": the
errorslist in the response says which field is wrong and why. "This form has no such field" means the column ID is wrong (step 2) or the field isn't visible on your form (step 3). - 429: too many signups in a short time. One internet address can send 20 a minute, and your form takes 300 an hour in total.
Sending signups from your server instead
If your website's server sends the signups, for example so it can check a CAPTCHA first, use your secret key with the same endpoint and body. The secret key isn't limited to your form's fields or your allowed origins, so keep it on the server only. The publishable key won't work from a server, because servers don't send your website's address with each request.
On WordPress, store the key in wp-config.php and send the signup from your theme or plugin:
define('SIMPU_SECRET_KEY', 'your_secret_key');
$response = wp_remote_post('https://api.v1.simpu.co/lists/contact/rows', [
'headers' => [
'Authorization' => SIMPU_SECRET_KEY,
'Content-Type' => 'application/json',
],
'body' => wp_json_encode([
'columns' => [
'EMAIL_COLUMN_ID' => sanitize_email($_POST['email']),
],
]),
]);What happens when someone signs up
- They're added to your contacts straight away. Simpu doesn't send a confirmation email first, as double opt-in isn't available yet. Tell people on your form what they're signing up for.
- Signing up twice doesn't add a second contact. Simpu looks for the email address (or the phone number, if no email is sent) in your contacts, and only fills in details that contact was missing. It never changes what's already there, or adds an email address or phone number. Signups sent with your secret key always add a new contact.
- People who unsubscribed stay unsubscribed. Signing up again doesn't take anyone off your Unsubscribers list.
- There's no CAPTCHA. If you need one, send signups from your server and check the CAPTCHA there.
Full API reference: docs.simpu.co.

