# Delete users by email

`DELETE https://api.airtable.com/v0/meta/enterpriseAccounts/{enterpriseAccountId}/users`

Delete multiple users by email.

## Requirements

- **Authentication:** [Personal access token](https://airtable.com/developers/web/api/authentication.md#types-of-token), [OAuth integration](https://airtable.com/developers/web/api/authentication.md#types-of-token)
- **Scope:** [`enterprise.user:write`](https://airtable.com/developers/web/api/scopes.md#enterprise-user-write)
- **User role:** Enterprise admin
- **Billing plans:** Enterprise (pre-2023.08 legacy plan), Enterprise Scale

## Path parameters

- `enterpriseAccountId: string`

## Query parameters

- `email: array<string>` — optional

## Response format

- `deletedUsers: array<object>` — required

  - `id: string` — required

    A user ID

  - `email: string` — required

- `errors: array<object>` — required

  - `type: string` — required

  - `email: string` — required

  - `message: string` — optional

### Example — Success Response

```sh
curl -X DELETE "https://api.airtable.com/v0/meta/enterpriseAccounts/{enterpriseAccountId}/users\
?email[]=foo%40bar.com&email[]=bar%40bam.com" \
-H "Authorization: Bearer YOUR_TOKEN"
```

```json
{
  "deletedUsers": [
    {
      "email": "foo@bar.com",
      "id": "usrL2PNC5o3H4lBEi"
    }
  ],
  "errors": [
    {
      "email": "bar@bam.com",
      "message": "Invalid permissions",
      "type": "INVALID_PERMISSIONS"
    }
  ]
}
```

## Error responses

### 403

**Action on self failure** — Don't deactivate yourself or you might lose access. If action must be performed, add another admin.

```json
{
  "error": {
    "message": "Cannot perform action on self",
    "type": "INVALID_PERMISSIONS"
  }
}
```

**Cannot delete sole owner** — If a workspace has more than one collaborator, it must have at least one owner. So the sole owner cannot be deleted.

```json
{
  "error": {
    "message": "Cannot delete sole owner of a workspace with other collaborators",
    "type": "INVALID_PERMISSIONS"
  }
}
```

**External user account** — Cannot modify external user state since they are not considered part of the enterprise account.

```json
{
  "error": {
    "message": "User does not belong to the enterprise email domain",
    "type": "INVALID_PERMISSIONS"
  }
}
```

**FLA account error** — The provisioned and deactivated states apply only to ELA and "claiming" enterprise accounts. FLA users are always provisioned.

```json
{
  "error": {
    "message": "State modification is not enabled for FLA enterprise accounts",
    "type": "INVALID_PERMISSIONS"
  }
}
```

**Non-managed user account** — Can only manage information of managed users.

```json
{
  "error": {
    "message": "User is not managed by the enterprise account",
    "type": "INVALID_PERMISSIONS"
  }
}
```
