Accounts
Account Members
List, add and remove the contacts that belong to an account
POST
/
api
/
v1
/
accounts
/
{externalId}
/
members
Account Members
curl --request POST \
--url https://api.sequenzy.com/api/v1/accounts/{externalId}/members \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"externalId": "<string>",
"role": "<string>",
"firstName": "<string>",
"lastName": "<string>"
}
'import requests
url = "https://api.sequenzy.com/api/v1/accounts/{externalId}/members"
payload = {
"email": "<string>",
"externalId": "<string>",
"role": "<string>",
"firstName": "<string>",
"lastName": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
externalId: '<string>',
role: '<string>',
firstName: '<string>',
lastName: '<string>'
})
};
fetch('https://api.sequenzy.com/api/v1/accounts/{externalId}/members', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequenzy.com/api/v1/accounts/{externalId}/members",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'externalId' => '<string>',
'role' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/accounts/{externalId}/members"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"role\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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))
}HttpResponse<String> response = Unirest.post("https://api.sequenzy.com/api/v1/accounts/{externalId}/members")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"role\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/accounts/{externalId}/members")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"role\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"account": { "id": "acc_abc123", "externalId": "org_123", "memberCount": 3 },
"member": { "subscriberId": "sub_1", "email": "jane@acme.com", "externalId": null, "role": "owner", "created": true, "subscriberCreated": false }
}
{
"success": true,
"account": { "id": "acc_abc123", "externalId": "org_123" },
"members": [
{ "subscriberId": "sub_1", "email": "jane@acme.com", "role": "owner" }
]
}
{
"success": true,
"account": { "id": "acc_abc123", "externalId": "org_123", "memberCount": 2 },
"removed": true
}
{
"success": false,
"error": "Provide `email` to create a contact that does not exist yet."
}
{ "success": false, "error": "Account not found" }
Account Members
Members are contacts with a role:owner, admin or member. Account events pick recipients by role, and {{account.role}} is available in emails.
GET /api/v1/accounts/{externalId}/memberslists members (owners first, then admins, then members)POST /api/v1/accounts/{externalId}/membersadds or updates a memberDELETE /api/v1/accounts/{externalId}/membersremoves a member
Request
string
required
Your organization ID.
number
default:"500"
GET only. Maximum members to return (up to 5,000).string
Contact email. On
POST, a new email creates the contact.string
Contact external ID, as an alternative to
email.string
default:"member"
POST only. owner, admin or member. Re-adding an existing member with a
role updates it; without a role keeps the current one.string
POST only. Set when creating the contact.string
POST only. Set when creating the contact.curl -X POST "https://api.sequenzy.com/api/v1/accounts/org_123/members" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{ "email": "jane@acme.com", "role": "owner" }'
curl -X DELETE "https://api.sequenzy.com/api/v1/accounts/org_123/members" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{ "email": "bob@acme.com" }'
Responses
{
"success": true,
"account": { "id": "acc_abc123", "externalId": "org_123", "memberCount": 3 },
"member": { "subscriberId": "sub_1", "email": "jane@acme.com", "externalId": null, "role": "owner", "created": true, "subscriberCreated": false }
}
{
"success": true,
"account": { "id": "acc_abc123", "externalId": "org_123" },
"members": [
{ "subscriberId": "sub_1", "email": "jane@acme.com", "role": "owner" }
]
}
{
"success": true,
"account": { "id": "acc_abc123", "externalId": "org_123", "memberCount": 2 },
"removed": true
}
{
"success": false,
"error": "Provide `email` to create a contact that does not exist yet."
}
{ "success": false, "error": "Account not found" }
⌘I
Account Members
curl --request POST \
--url https://api.sequenzy.com/api/v1/accounts/{externalId}/members \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"externalId": "<string>",
"role": "<string>",
"firstName": "<string>",
"lastName": "<string>"
}
'import requests
url = "https://api.sequenzy.com/api/v1/accounts/{externalId}/members"
payload = {
"email": "<string>",
"externalId": "<string>",
"role": "<string>",
"firstName": "<string>",
"lastName": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
externalId: '<string>',
role: '<string>',
firstName: '<string>',
lastName: '<string>'
})
};
fetch('https://api.sequenzy.com/api/v1/accounts/{externalId}/members', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequenzy.com/api/v1/accounts/{externalId}/members",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'externalId' => '<string>',
'role' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/accounts/{externalId}/members"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"role\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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))
}HttpResponse<String> response = Unirest.post("https://api.sequenzy.com/api/v1/accounts/{externalId}/members")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"role\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/accounts/{externalId}/members")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"externalId\": \"<string>\",\n \"role\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"account": { "id": "acc_abc123", "externalId": "org_123", "memberCount": 3 },
"member": { "subscriberId": "sub_1", "email": "jane@acme.com", "externalId": null, "role": "owner", "created": true, "subscriberCreated": false }
}
{
"success": true,
"account": { "id": "acc_abc123", "externalId": "org_123" },
"members": [
{ "subscriberId": "sub_1", "email": "jane@acme.com", "role": "owner" }
]
}
{
"success": true,
"account": { "id": "acc_abc123", "externalId": "org_123", "memberCount": 2 },
"removed": true
}
{
"success": false,
"error": "Provide `email` to create a contact that does not exist yet."
}
{ "success": false, "error": "Account not found" }