Accounts
Create or Update Account
Upsert an account by your own organization ID
POST
/
api
/
v1
/
accounts
Create or Update Account
curl --request POST \
--url https://api.sequenzy.com/api/v1/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"externalId": "<string>",
"name": "<string>",
"domain": "<string>",
"attributes": {},
"replaceAttributes": true,
"members": [
{}
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/accounts"
payload = {
"externalId": "<string>",
"name": "<string>",
"domain": "<string>",
"attributes": {},
"replaceAttributes": True,
"members": [{}]
}
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({
externalId: '<string>',
name: '<string>',
domain: '<string>',
attributes: {},
replaceAttributes: true,
members: [{}]
})
};
fetch('https://api.sequenzy.com/api/v1/accounts', 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",
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([
'externalId' => '<string>',
'name' => '<string>',
'domain' => '<string>',
'attributes' => [
],
'replaceAttributes' => true,
'members' => [
[
]
]
]),
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"
payload := strings.NewReader("{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"domain\": \"<string>\",\n \"attributes\": {},\n \"replaceAttributes\": true,\n \"members\": [\n {}\n ]\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"domain\": \"<string>\",\n \"attributes\": {},\n \"replaceAttributes\": true,\n \"members\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/accounts")
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 \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"domain\": \"<string>\",\n \"attributes\": {},\n \"replaceAttributes\": true,\n \"members\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"created": true,
"account": {
"id": "acc_abc123",
"externalId": "org_123",
"name": "Acme",
"domain": "acme.com",
"attributes": { "plan": "pro", "seats": 5, "trialEndsAt": "2026-09-20" },
"memberCount": 1,
"lastEventAt": null,
"createdAt": "2026-09-04T09:00:00.000Z",
"updatedAt": "2026-09-04T09:00:00.000Z"
},
"members": [
{ "subscriberId": "sub_1", "email": "jane@acme.com", "externalId": null, "role": "owner", "created": true }
]
}
{
"success": true,
"created": false,
"account": {
"id": "acc_abc123",
"externalId": "org_123",
"attributes": { "plan": "pro" }
}
}
{
"success": false,
"error": "Account `domain` must be a hostname such as `acme.com`."
}
{ "success": false, "error": "Unauthorized" }
{
"success": false,
"error": "Contacts in this workspace already use the custom attribute `account.plan`. Accounts reserve the `account` attribute name for organization data, so turning Accounts on would stop those contact attributes from updating in segments. Rename them (for example to `company.plan`), then try again."
}
Create or Update Account
Creates the account whenexternalId is new, otherwise updates it. Attributes merge into the stored attributes: send null to delete a key, or replaceAttributes: true to replace them all. Attribute changes fan out to every member for segments and {{account.*}} merge tags.
Your first account turns Accounts on for the workspace. If your contacts already carry a custom attribute named account or account.<name>, this returns 409 until you rename it, because account data takes over the account.* names in segments.
Request
string
required
Your organization ID. Case-sensitive, unique per workspace, up to 255
characters.
string
Display name.
null clears it.string
Primary domain, normalized to a hostname (
https://www.acme.com/ becomes
acme.com). null clears it.object
Up to 100 attributes such as
plan, seats, mrr, trialEndsAt. Values may
be strings, numbers, booleans, arrays of those, or nested objects (flattened
to dotted names). Keys starting with internal__ are reserved.boolean
default:"false"
Replace all stored attributes instead of merging.
array
Up to 100 contacts to add in the same call. Each item takes
email or
externalId, an optional role (owner, admin, member), firstName and
lastName. New emails create the contact; external-ID-only members must
already exist. Member roles and identities are checked before changing the
account or adding contacts.curl -X POST "https://api.sequenzy.com/api/v1/accounts" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"externalId": "org_123",
"name": "Acme",
"domain": "acme.com",
"attributes": { "plan": "pro", "seats": 5, "trialEndsAt": "2026-09-20" },
"members": [{ "email": "jane@acme.com", "role": "owner" }]
}'
Responses
{
"success": true,
"created": true,
"account": {
"id": "acc_abc123",
"externalId": "org_123",
"name": "Acme",
"domain": "acme.com",
"attributes": { "plan": "pro", "seats": 5, "trialEndsAt": "2026-09-20" },
"memberCount": 1,
"lastEventAt": null,
"createdAt": "2026-09-04T09:00:00.000Z",
"updatedAt": "2026-09-04T09:00:00.000Z"
},
"members": [
{ "subscriberId": "sub_1", "email": "jane@acme.com", "externalId": null, "role": "owner", "created": true }
]
}
{
"success": true,
"created": false,
"account": {
"id": "acc_abc123",
"externalId": "org_123",
"attributes": { "plan": "pro" }
}
}
{
"success": false,
"error": "Account `domain` must be a hostname such as `acme.com`."
}
{ "success": false, "error": "Unauthorized" }
{
"success": false,
"error": "Contacts in this workspace already use the custom attribute `account.plan`. Accounts reserve the `account` attribute name for organization data, so turning Accounts on would stop those contact attributes from updating in segments. Rename them (for example to `company.plan`), then try again."
}
⌘I
Create or Update Account
curl --request POST \
--url https://api.sequenzy.com/api/v1/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"externalId": "<string>",
"name": "<string>",
"domain": "<string>",
"attributes": {},
"replaceAttributes": true,
"members": [
{}
]
}
'import requests
url = "https://api.sequenzy.com/api/v1/accounts"
payload = {
"externalId": "<string>",
"name": "<string>",
"domain": "<string>",
"attributes": {},
"replaceAttributes": True,
"members": [{}]
}
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({
externalId: '<string>',
name: '<string>',
domain: '<string>',
attributes: {},
replaceAttributes: true,
members: [{}]
})
};
fetch('https://api.sequenzy.com/api/v1/accounts', 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",
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([
'externalId' => '<string>',
'name' => '<string>',
'domain' => '<string>',
'attributes' => [
],
'replaceAttributes' => true,
'members' => [
[
]
]
]),
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"
payload := strings.NewReader("{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"domain\": \"<string>\",\n \"attributes\": {},\n \"replaceAttributes\": true,\n \"members\": [\n {}\n ]\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"domain\": \"<string>\",\n \"attributes\": {},\n \"replaceAttributes\": true,\n \"members\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/accounts")
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 \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"domain\": \"<string>\",\n \"attributes\": {},\n \"replaceAttributes\": true,\n \"members\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"created": true,
"account": {
"id": "acc_abc123",
"externalId": "org_123",
"name": "Acme",
"domain": "acme.com",
"attributes": { "plan": "pro", "seats": 5, "trialEndsAt": "2026-09-20" },
"memberCount": 1,
"lastEventAt": null,
"createdAt": "2026-09-04T09:00:00.000Z",
"updatedAt": "2026-09-04T09:00:00.000Z"
},
"members": [
{ "subscriberId": "sub_1", "email": "jane@acme.com", "externalId": null, "role": "owner", "created": true }
]
}
{
"success": true,
"created": false,
"account": {
"id": "acc_abc123",
"externalId": "org_123",
"attributes": { "plan": "pro" }
}
}
{
"success": false,
"error": "Account `domain` must be a hostname such as `acme.com`."
}
{ "success": false, "error": "Unauthorized" }
{
"success": false,
"error": "Contacts in this workspace already use the custom attribute `account.plan`. Accounts reserve the `account` attribute name for organization data, so turning Accounts on would stop those contact attributes from updating in segments. Rename them (for example to `company.plan`), then try again."
}