---
title: "Create or update account"
method: POST
path: "/accounts"
tags: ["Accounts"]
---

# Create or update account

`POST /accounts`

## Request

- Base URL: `https://api.sequenzy.com/api/v1`
- URL: `https://api.sequenzy.com/api/v1/accounts`
- Auth: HTTP bearer

Upserts an account by its customer-owned externalId. Attributes merge into the stored attributes (null deletes a key; replaceAttributes replaces them all). Optional members are added in the same call. Account attributes fan out to every member for segments and `{{account.*}}` merge tags.

## Request body

- AccountUpsertInput
  - `externalId` string, required
  - `name` string, nullable
  - `domain` string, nullable: Normalized to a hostname such as acme.com.
  - `attributes` object: Up to 100 attributes. Null values delete keys when merging.
  - `replaceAttributes` boolean
  - `members` object[]
    - `email` string, email
    - `externalId` string
    - `role` 'owner' | 'admin' | 'member'
    - `firstName` string
    - `lastName` string

## Response `200`

Account updated

- AccountUpsertResponse
  - `success` boolean
  - `created` boolean
  - `account` Account: A B2B account (organization, workspace or team) that contacts belong to.
    - `id` string
    - `externalId` string: Customer-owned organization ID, unique per workspace.
    - `name` string, nullable
    - `domain` string, nullable
    - `attributes` object: Account attributes, fanned out to members as `account.<name>`.
    - `memberCount` integer
    - `lastEventAt` string, date-time, nullable
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
  - `members` object[]
    - `subscriberId` string
    - `email` string, nullable
    - `externalId` string, nullable
    - `role` string
    - `created` boolean

## Other responses

- `201`: Account created
- `400`: The request body or parameters are invalid
- `401`: Missing or invalid API key
- `409`: The first account would turn Accounts on, but contacts already use a custom attribute named `account` or `account.*`. Rename those contact attributes, then retry. Workspaces that already have Accounts on never receive this error.

## Changes

- **2026-10-16** `db3873ca3d4d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sequenzy/apis/sequenzy-api/changes/accounts/post.md)

---

[API](https://skmtc.dev/sequenzy/apis/sequenzy-api.md) - [All operations](https://skmtc.dev/sequenzy/apis/sequenzy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sequenzy/apis/sequenzy-api/revisions/8156dc12d8b4?raw)
