Add someone to a list
US Region: https://public-api.sessionboard.com · EU Region: https://public-api-eu.sessionboard.com
Add a person who agreed elsewhere. With confirmed: true (your word that they agreed) they are subscribed now; otherwise they get the confirmation email first. An email on your suppression list is never subscribed. Requires write:marketing.
Request example
curl --request POST \ --url 'https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/audience/subscribers/create' \ --header 'x-access-token: <api-token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "jane@example.com", "firstName": "<string>", "lastName": "<string>", "company": "<string>", "listKey": "<string>", "eventId": 123, "confirmed": true}'const response = await fetch('https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/audience/subscribers/create', { method: 'POST', headers: { "x-access-token": "<api-token>", "Content-Type": "application/json" }, body: JSON.stringify({ "email": "jane@example.com", "firstName": "<string>", "lastName": "<string>", "company": "<string>", "listKey": "<string>", "eventId": 123, "confirmed": true }),});
const data = await response.json();console.log(data);import requests
response = requests.request( "POST", "https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/audience/subscribers/create", headers={ "x-access-token": "<api-token>", "Content-Type": "application/json" }, json={ "email": "jane@example.com", "firstName": "<string>", "lastName": "<string>", "company": "<string>", "listKey": "<string>", "eventId": 123, "confirmed": True },)
print(response.json())<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/audience/subscribers/create", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{ "email": "jane@example.com", "firstName": "<string>", "lastName": "<string>", "company": "<string>", "listKey": "<string>", "eventId": 123, "confirmed": true}', CURLOPT_HTTPHEADER => [ "x-access-token: <api-token>", "Content-Type: application/json", ],]);
$response = curl_exec($curl);curl_close($curl);
echo $response;package main
import ( "fmt" "io" "net/http" "strings")
func main() { req, _ := http.NewRequest("POST", "https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/audience/subscribers/create", strings.NewReader(`{ "email": "jane@example.com", "firstName": "<string>", "lastName": "<string>", "company": "<string>", "listKey": "<string>", "eventId": 123, "confirmed": true}`)) req.Header.Add("x-access-token", "<api-token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://public-api.sessionboard.com/v1/organization/{orgId}/marketing/audience/subscribers/create")) .header("x-access-token", "<api-token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{\n \"email\": \"jane@example.com\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"company\": \"<string>\",\n \"listKey\": \"<string>\",\n \"eventId\": 123,\n \"confirmed\": true\n}")) .build();
HttpResponse<String> response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Try it
Response headers
Authorizations
x-access-tokenstringheaderOrganization API token. Generate from Organization Settings → API Tokens.
AuthorizationBearer <token>headerorOAuth 2.1 access token. Obtained via the OAuth PKCE flow at
/oauth/token.
Send one of these. See Authentication.
Path parameters
orgIdstringpathrequiredYour organization ID. Any other organization returns
404.
Request body
emailstring<email>requiredfirstNamestringlastNamestringcompanystringlistKeystringDefault
newsletter.eventIdintegerconfirmedboolean
{ "email": "jane@example.com", "firstName": "<string>", "lastName": "<string>", "company": "<string>", "listKey": "<string>", "eventId": 123, "confirmed": true}Responses
200
payload.outcome (subscribed, pending, already_subscribed, suppressed, blocked) and payload.subscription
403
SCOPE_REQUIRED— the token lacksread:marketing(reads) orwrite:marketing(writes).ORG_WIDE_TOKEN_REQUIRED— the token is restricted to particular events; this operation reads the whole organization.FORBIDDEN— the organization's plan does not include Marketing, or the token's user cannot change goals (writes need an organization admin or the organization settings permission).
