Sign-ups from your site

Keep your own sign-up box. When someone submits it, your server sends their email to YouGrow with the launch's site key. YouGrow confirms the address by email, then the person joins the launch like anyone else: its journey, its broadcasts and its weekly newsletter.

Newsletter or app user? People you send to API v2 users get onboarding journeys only, never broadcasts or the weekly newsletter. A newsletter list is a launch, filled from your box with this call.

Who gets which emails

How they got inWhat they get
YouGrow's page or widgetThe launch's journey and its broadcasts. The weekly newsletter once they reach its weekly step.
Your own form, with a site keyThe same: the launch's journey, its broadcasts, and the weekly newsletter once they reach its weekly step.
Your app, through the API (users.update)Onboarding journeys only. Never broadcasts or the weekly newsletter.

Before you start

  1. In YouGrow, make a launch for the newsletter and publish its journey, with the weekly newsletter step on its Exit. The steps are in Newsletter from your own site.
  2. On the launch's Page & widget tab, choose Your own form and press Create site key. You get a key id (ygl_…) and a secret (ygls_…, shown once). Store both in your server's secret manager.
  3. Optional: set Send them to, the page people land on after confirming.

Add a sign-up

POST /api/v2/signups with HTTP Basic auth: the key id as the username and the secret as the password. The launch comes from the key. Server to server only: never put the secret in a page or an app.

curl
curl https://yougrow.ai/api/v2/signups \
  -u "$YOUGROW_KEY_ID:$YOUGROW_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"email":"sam@example.com","locale":"en-GB","source":"blog/first-post"}'
Node (fetch)
const res = await fetch("https://yougrow.ai/api/v2/signups", {
  method: "POST",
  headers: {
    Authorization: "Basic " + Buffer.from(`${process.env.YOUGROW_KEY_ID}:${process.env.YOUGROW_SECRET}`).toString("base64"),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ email, locale: "en-GB", source: "blog/first-post" }),
});
// Whatever it answers, tell your visitor: "Check your inbox to confirm."

Fields

FieldTypeNotes
emailstringRequired. The address to confirm and subscribe.
firstNamestringOptional. Used in the greeting.
localestringOptional, e.g. en-GB. Their emails use it when the launch offers that language.
sourcestringOptional, up to 200 characters. Where on your site they signed up, e.g. blog/first-post.

Any other field is refused with a 400.

Responses

StatusBodyWhat it means
202confirmation_sentThe confirmation email is on its way.
200already_confirmedThey're already on the list. Nothing was sent.
200not_sent: recently_sentA confirmation went to this address in the last day.
200not_sent: blockedEmail to this address bounced or was reported as spam. It's never emailed.
200not_sent: removedSomeone took them off the launch.
400invalidA field is wrong: fields lists each problem. Fix it; don't retry as it is.
401unauthorizedThe key id or secret is wrong, or the key was revoked.
404site_signups_disabledSign-ups from your site aren't turned on for this YouGrow.
409launch_closedThe launch is archived.
413body_too_largeThe body is over 8 KB.
429rate_limitedOver the limit. Wait Retry-After seconds.
503email_unavailableThe confirmation couldn't be sent. Retry after Retry-After.

Every call is safe to repeat: the same email on the same launch is one sign-up, and one email a day at most.

What happens next

  1. YouGrow emails the person from the brand's address, asking them to confirm.
  2. The link opens a page with a Confirm subscription button. Opening the link changes nothing, so email scanners can't confirm for anyone.
  3. Once they press it, they go to your Send them to page and join the launch's journey.
  4. The journey's weekly step puts them on the weekly newsletter.

Unsubscribes are handled in YouGrow. No webhook tells your server about these people, so don't keep a second mailing list of them. Someone who unsubscribed before can sign up again: confirming lifts their unsubscribe. A bounced address or a spam report is never lifted.

Limits

  • 60 calls a minute and 1,000 an hour, per key.
  • 8 KB per call.
  • One confirmation email per address per launch a day.

Keys

  • One key per launch. It can only add sign-ups to that launch, and it can't read anyone.
  • Rotate secret gives a new secret; the old one keeps working for 24 hours, so you can switch without missing sign-ups.
  • Revoke key stops it within a minute. A product's API key never works here, and a site key never works on API v2.

Good practice

  • Show your visitor the same "Check your inbox to confirm" message whatever the reply.
  • Keep a honeypot field or a captcha on your box, and limit how often one visitor can submit it.
  • Retry a 429 or a 503 after Retry-After, and a network error with backoff.