Documentation

Signup forms

A signup form you embed on your site, with double opt-in, a bot check and a consent record for every person it adds.

A signup form adds the people who fill it in to one of your audiences. You create it here or in the dashboard under Audiences, Forms, then paste its embed_code into your site. The form is an iframe served by SendRaven, so it works on any site or site builder and needs no code of yours to receive the submission.

Double opt-in is on by default. A submission sends the person a confirmation email, and they are added to the audience only after they press the button on the page it links to. Until then they are not a contact: no campaign, segment or automation can reach them. The link works once and expires after 72 hours. Opening the link only shows the page; the button confirms, because security scanners open every link in incoming mail.

With double_opt_in: false people are added as soon as they submit. Because anyone can type anyone's address, a single opt-in form never adds someone who unsubscribed, bounced or complained. With double opt-in, pressing the confirmation button resubscribes someone who had unsubscribed from your marketing mail. Nothing a form does lifts a hard bounce or a spam complaint.

What a signup does

Once a person is added (on submission, or on confirmation with double opt-in):

  • they join the form's audience_id, with the first name, last name and contact property values the form asked for. Only fields the form declares are stored; anything else in the submission is ignored;
  • they get the form's tags, and are opted in to each of its topic_keys;
  • any automation triggered by a contact joining that audience, or by one of those tags, starts, exactly as when a contact is added through the API.

Someone who is already a subscribed member of the audience is not sent a confirmation and nothing about them changes. The form shows them the same success message as everyone else, so the form never reveals who is on your list.

The confirmation email

The confirmation is sent from confirm@ the form's identity_id, or from your oldest verified transactional sending domain when none is set. Its subject is "Confirm your subscription to" followed by sender_name (or your workspace name). Its wording is fixed: it goes to an address someone typed into a public form, so it carries nothing else you write. Its link is on your own tracking hostname when that domain has one.

It goes through the normal send path as a transactional email: a suppressed address is not mailed, a verified payment method is needed, and each confirmation counts as one email sent. A submission whose confirmation could not be sent is rejected, and its rejection says why.

Spam protection

Every form runs Cloudflare Turnstile, an invisible check that most people never see, plus a hidden field that only bots fill in. On top of that:

  • one connection can submit your forms 10 times an hour;
  • the same address on the same form within 10 minutes is stored once;
  • one address can be sent at most 3 confirmations a day across every SendRaven form, so nobody can use forms to flood a stranger's inbox;
  • your forms together accept 2,000 submissions an hour (200 in a workspace's first week).

An address over its daily limit gets the same answer as a successful signup.

Embedding a form

embed_code is a placeholder and a script that puts the form in an iframe and sizes it to fit:

<div data-sendraven-form="7b1d2c3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e"></div>
<script src="https://api.sendraven.ai/f/embed.js" async></script>

For a site builder that strips scripts, use iframe_code, a fixed-height iframe. A workspace whose sending domain has a tracking hostname can also link people straight to https://link.<your domain>/f/<form id>, a page of its own with the form on it.

Every form carries a small "Powered by SendRaven" link under the button.

The form object

Every field is always present.

FieldTypeDescription
idstringUnique identifier (UUID).
namestringFor you. Never shown to the person signing up.
status"active" | "paused"A paused form shows "not available" and accepts nothing.
audience_idstringWhere signups land.
tagsstring[]Applied to everyone who signs up.
topic_keysstring[]Topics the person opts in to.
fieldsobject[]The inputs after the email address: kind (first_name, last_name or attribute), property (the contact property key for attribute, otherwise null), label and required.
double_opt_inbooleanWhether a confirmation click is needed.
identity_idstring | nullThe transactional identity confirmations are sent from. null uses the oldest verified one.
sender_namestring | nullWho the confirmation says the list belongs to. null uses the workspace name.
titlestringThe heading on the form.
descriptionstring | nullA line under the heading.
button_textstringThe button's label.
success_messagestringShown in place of the form after a submission.
consent_textstring | nullShown under the button, and stored with every submission.
accent_colorstring | nullThe button colour, #rrggbb.
redirect_urlstring | nullAn https page to send people to after they submit, and after they confirm, instead of the message.
form_urlstringThe form's own page, which the embed loads.
embed_codestringThe snippet to paste into your site.
iframe_codestringA fixed-height iframe, for builders that strip scripts.
created_atstring (ISO 8601)When the form was created.
updated_atstring (ISO 8601)When it last changed.

List forms

GET /v1/forms · requires contacts:read

Returns the workspace's forms newest first, cursor-paged. See Pagination. Takes limit (default 50, at most 100) and cursor.

curl https://api.sendraven.ai/v1/forms \
  -H "Authorization: Bearer $SENDRAVEN_API_KEY"

Create a form

POST /v1/forms · requires contacts:write

Body

FieldTypeRequiredDescription
namestringyesUp to 120 characters.
audience_idstringyesAn audience id from GET /v1/audiences.
fieldsobject[]noUp to 10. An attribute field names a declared contact property; a form never creates one.
tagsstring[]noUp to 20.
topic_keysstring[]noKeys from GET /v1/topics.
double_opt_inbooleannoDefaults to true.
status, identity_id, sender_name, title, description, button_text, success_message, consent_text, accent_color, redirect_urlnoAs in the object above.

Refused with 403 forbidden for a key with guardrails (requires_approval, allowed_recipients or daily_send_limit): a form sends confirmation emails to whoever submits it, later and without the key.

Example

curl https://api.sendraven.ai/v1/forms \
  -H "Authorization: Bearer $SENDRAVEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Blog footer",
    "audience_id": "5e8f2a1b-3c4d-4e5f-9a6b-7c8d9e0f1a2b",
    "fields": [{ "kind": "first_name", "required": false }],
    "tags": ["blog"],
    "consent_text": "One email a month. Unsubscribe at any time."
  }'

Response

201 Created with the form object.

Retrieve a form

GET /v1/forms/{id} · requires contacts:read

Returns the form object, or 404 not_found.

Update a form

PATCH /v1/forms/{id} · requires contacts:write

Send only the fields to change; null clears an optional one. Set status to paused to stop the form taking signups. Returns the form as stored. Refused for a key with guardrails, as for create.

Delete a form

DELETE /v1/forms/{id} · requires contacts:write

The form stops working wherever it is embedded, and unclicked confirmation links stop working. Its submissions are kept, because they are the consent record for the contacts it added. Returns { "id": "...", "deleted": true }.

List a form's submissions

GET /v1/forms/{id}/submissions · requires contacts:read

Every submission, newest first, cursor-paged. status filters to pending, subscribed, rejected or expired.

FieldTypeDescription
idstringUnique identifier (UUID).
form_idstringThe form.
emailstringLower-cased.
first_name, last_namestring | nullAs submitted.
attributesobjectValues for the form's attribute fields, by property key.
statusstringpending (the confirmation is on its way or waiting for a click), subscribed, rejected or expired (unclicked after 72 hours).
rejectionstring | nullWhy a rejected submission was not added: suppressed (bounced, complained, or unsubscribed on a single opt-in form), undeliverable_domain (the address's domain has no mail server), no_verified_identity, payment_method_required, billing_past_due, plan_limit_reached, budget_exceeded, workspace_suspended, form_unavailable or send_failed.
already_subscribedbooleanThe person was already on the audience; nothing was sent or changed.
double_opt_inbooleanWhether the form needed a confirmation at the time.
consent_textstring | nullThe consent wording the form showed.
page_urlstring | nullThe page the form was embedded on, without its query string.
confirmation_sent_atstring (ISO 8601) | nullWhen the confirmation email was sent.
confirmed_atstring (ISO 8601) | nullWhen the button was pressed.
subscribed_atstring (ISO 8601) | nullWhen the person was added.
created_atstring (ISO 8601)When the form was submitted.

On this page