Skip to content

Add or update a subscriber

On this page
POST/v1/subscribersupsert_subscriber
Riskwrite
AuthenticationAPI key or OAuth access token
Scopessubscribers:write
Idempotencysupported: send an Idempotency-Key header to make retries safe
Dry runyes: add dry_run=true to the query
Success status200
Response typeapplication/json

What it does#

  • Use when: A reader signs up on your site or store; double_opt_in is the default.
  • Do not use when: the reader unsubscribed or bounced (it cannot be re-added), or you add many (call bulk_upsert_subscribers).
  • Side effects: Creates the subscriber; Queues one confirmation email unless already_confirmed.
  • Reversible: Yes, call unsubscribe_subscriber.
  • Required scope: subscribers:write.
  • Idempotency: supported (Idempotency-Key header).
  • Typical next step: call get_subscriber or add_subscriber_tags.

Scopes#

  • subscribers:write: Add subscribers with double opt-in, update them, unsubscribe them, and change their lists and tags.

Side effects#

  • Creates the subscriber
  • Queues one confirmation email unless already_confirmed

Request#

Path parameters#

None.

Query parameters#

None.

Every mutation also accepts dry_run=true: it runs every check and returns {"dry_run": true, "would": {...}} without writing anything.

Body (application/json)#

FieldTypeRequiredDescription
emailstring, max 254 charactersyes
namestring, max 400 charactersno
confirmationone of "double_opt_in", "already_confirmed", default "double_opt_in"no
consentobjectno
consent.collected_atstring (date-time)yes
consent.methodone of "signup_form", "reader_magnet", "store_or_checkout", "in_person", "other"yes
consent.source_urlstring (uri), max 2048 charactersno
consent.notice_textstring, max 1000 charactersno
listsarray of string, max 100 characters, max 50 itemsno
tagsarray of string, max 50 characters, max 20 itemsno

Response#

FieldTypeRequiredDescription
statusone of "added_pending", "confirmation_resent", "added_confirmed", "updated", "already_subscribed", "already_pending", "cannot_resubscribe", "invalid", "plan_limit", "daily_limit", "unavailable"yes
emailstringyes
messagestringyes
codestringno
subscriber_idstringno

Examples#

double opt-in#

Request:

curl -X POST 'https://api.seemly.com/v1/subscribers' \
  -H "Authorization: Bearer $SEEMLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "[email protected]",
  "name": "Sam Reader",
  "lists": [
    "Main list"
  ],
  "tags": [
    "store-buyer"
  ]
}'

Response: 200:

JSON
{
  "status": "added_pending",
  "email": "[email protected]",
  "message": "Added. A confirmation email is on its way. They stay pending until they click it.",
  "subscriber_id": "sub_0123456789abcdefghjkmnpq"
}

Errors#

Every error is an application/problem+json body with a code, a fix sentence and next_actions. See reading a problem response.

Typical next steps#

View this page as MarkdownReport a problem with this page

Type to search. Try a method and path, an operation name or an error code.