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

# Update membership settings

> Enable or disable domain auto-join for an account

`PATCH /api/v2/accounts/{customerId}/membership`

Updates the membership settings for an account. Requires `ADMIN` role and a registered `customerDomain` to enable domain auto-join. Top-level organizations default to enabled and child accounts default to disabled; this operation explicitly overrides that default.

## Request

```bash curl theme={null}
curl -X PATCH https://api.apostra.com/api/v2/accounts/200/membership \
  -H "Authorization: Bearer $SCOPE3_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "allowDomainAutoJoin": true
  }'
```

## Parameters

| Field | In | Type | Required | Notes |
| - | - | - | - | - |
| `customerId` | path | string | Yes | ID of the account to update |
| `allowDomainAutoJoin` | body | boolean | Yes | When `true`, users with a verified matching-domain email join immediately as members without admin approval |

## Response

```json theme={null}
{
  "customerId": 200,
  "allowDomainAutoJoin": true
}
```

| Field | Type | Notes |
| - | - | - |
| `customerId` | integer | Account ID |
| `allowDomainAutoJoin` | boolean | Effective auto-join setting after the update |

## Errors

* `400 VALIDATION_ERROR` — `allowDomainAutoJoin` is `true` but the account has no registered `customerDomain`.
* `401 UNAUTHORIZED` — missing or invalid bearer token.
* `403 FORBIDDEN` — caller is not an `ADMIN` on the target account.

See [Errors](/v2/reference/errors) for the full error contract.

## Related

<CardGroup cols={2}>
  <Card title="Account tasks" href="/v2/buyer/account/tasks" icon="list-check">
    All account operations
  </Card>

  <Card title="Get membership" href="/v2/buyer/account/tasks/get-membership" icon="users">
    Read access settings
  </Card>

  <Card title="Update account domain" href="/v2/buyer/account/tasks/update-customer-domain" icon="globe">
    Set the registered domain
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.