> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Account Members

> List, add and remove the contacts that belong to an account

# 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}/members` lists members (owners first, then admins, then members)
* `POST /api/v1/accounts/{externalId}/members` adds or updates a member
* `DELETE /api/v1/accounts/{externalId}/members` removes a member

## Request

<ParamField path="externalId" type="string" required>
  Your organization ID.
</ParamField>

<ParamField query="limit" type="number" default="500">
  `GET` only. Maximum members to return (up to 5,000).
</ParamField>

<ParamField body="email" type="string">
  Contact email. On `POST`, a new email creates the contact.
</ParamField>

<ParamField body="externalId" type="string">
  Contact external ID, as an alternative to `email`.
</ParamField>

<ParamField body="role" type="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.
</ParamField>

<ParamField body="firstName" type="string">
  `POST` only. Set when creating the contact.
</ParamField>

<ParamField body="lastName" type="string">
  `POST` only. Set when creating the contact.
</ParamField>

```bash theme={null}
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

<ResponseExample>
  ```json 201 theme={null}
  {
    "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 }
  }
  ```

  ```json 200 theme={null}
  {
    "success": true,
    "account": { "id": "acc_abc123", "externalId": "org_123" },
    "members": [
      { "subscriberId": "sub_1", "email": "jane@acme.com", "role": "owner" }
    ]
  }
  ```

  ```json 200 theme={null}
  {
    "success": true,
    "account": { "id": "acc_abc123", "externalId": "org_123", "memberCount": 2 },
    "removed": true
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Provide `email` to create a contact that does not exist yet."
  }
  ```

  ```json 404 theme={null}
  { "success": false, "error": "Account not found" }
  ```
</ResponseExample>
