Quickstart
Create a key, make your first call, add a subscriber and read it back in five minutes.
On this page
Make your first Seemly API call, add a reader and read it back in about five minutes. Every command on this page is run against a test copy of the API every time the documentation changes, so you can paste it as it is.
Before you start#
- The API is included with the Magnets & Promos and Pro plans. A Free workspace has no API access.
- Only the workspace owner can create a key. Open Developers in your dashboard and choose Create a key. Pick the Integration preset for this page.
- The full key is shown once. Copy it somewhere safe. Never put a key in a web address or in code that runs in a browser.
Put the key in an environment variable so the commands below work as written:
export SEEMLY_API_KEY="seemly_live_..."If you want to try everything without touching real readers, create a sandbox and use its test key instead. Test keys start with seemly_test_.
1. Check the key#
get_current_access needs no scope. It tells you which workspace the key belongs to, what the key may do, your plan's limits and whether sending is paused.
curl https://api.seemly.com/v1/whoami \
-H "Authorization: Bearer $SEEMLY_API_KEY"const response = await fetch("https://api.seemly.com/v1/whoami", {
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
},
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.get(
"https://api.seemly.com/v1/whoami",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
)
print(response.status_code, response.json())The callable_operations list in the answer is every operation this key may call right now. If a call you need is missing, the key lacks a scope: create a new key with it.
2. Look before you write#
Every change accepts dry_run=true. It runs every check and tells you what would happen, and it writes nothing. See dry runs.
curl -X POST 'https://api.seemly.com/v1/subscribers?dry_run=true' \
-H "Authorization: Bearer $SEEMLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "name": "Sam Reader", "tags": ["store-buyer"]}'const response = await fetch("https://api.seemly.com/v1/subscribers?dry_run=true", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"email": "[email protected]",
"name": "Sam Reader",
"tags": [
"store-buyer"
]
}),
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.post(
"https://api.seemly.com/v1/subscribers?dry_run=true",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
json={
"email": "[email protected]",
"name": "Sam Reader",
"tags": [
"store-buyer",
],
},
)
print(response.status_code, response.json())3. Add a reader#
A new reader is added as pending, and Seemly emails them a confirmation link (double opt-in). They join your list only when they click it. The Idempotency-Key header makes a retry safe: send the same key again and nothing runs twice. See idempotency.
curl -X POST https://api.seemly.com/v1/subscribers \
-H "Authorization: Bearer $SEEMLY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"email": "[email protected]", "name": "Sam Reader", "tags": ["store-buyer"]}'const response = await fetch("https://api.seemly.com/v1/subscribers", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
"email": "[email protected]",
"name": "Sam Reader",
"tags": [
"store-buyer"
]
}),
});
const result = await response.json();
console.log(response.status, result);import os
import uuid
import requests
response = requests.post(
"https://api.seemly.com/v1/subscribers",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"email": "[email protected]",
"name": "Sam Reader",
"tags": [
"store-buyer",
],
},
)
print(response.status_code, response.json())The answer holds a subscriber_id. To add a reader as already confirmed you need a different scope and evidence of consent: read adding subscribers and consent.
4. Read the reader back#
curl https://api.seemly.com/v1/subscribers/$SUBSCRIBER_ID \
-H "Authorization: Bearer $SEEMLY_API_KEY"const response = await fetch("https://api.seemly.com/v1/subscribers/$SUBSCRIBER_ID", {
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
},
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.get(
"https://api.seemly.com/v1/subscribers/$SUBSCRIBER_ID",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
)
print(response.status_code, response.json())Here $SUBSCRIBER_ID is the subscriber_id from the previous answer. The reader's status is pending until they confirm. To find a reader by address, send the address in a request body to find_subscriber_by_email; an address in a web address is refused.
5. When something goes wrong#
Every error is a small JSON document with a stable code, a fix sentence and the next operation to call. A request without a valid key looks like this:
# expect: 401
curl https://api.seemly.com/v1/whoami{
"type": "https://api.seemly.com/docs/api/errors/unauthenticated",
"title": "Authentication required",
"status": 401,
"code": "unauthenticated",
"retryable": false,
"fix": "Send a valid API key as Authorization: Bearer <key>."
}Branch on code, show fix to a person, and quote request_id if you contact support.
Where next#
- Authentication: scopes, key lifetime and OAuth.
- Webhooks: hear about new readers as they happen.
- Guide for AI agents: draft a mailing and ask the author to send it.
- Limits by plan, pagination.
- Every operation has its own page in the index, and the whole contract is the OpenAPI document.