> This page is for Developer Documentation.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.benchling.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.benchling.com/_mcp/server.

# User Management via the API

The Users API allows integrations installed in Enterprise tenants to programmatically manage
Benchling users. This includes basic CRUD operations like reading and writing user data, batch and bulk
create/update of users, and checking when a user was last seen.

This page uses the [V3 API](/docs/v3-api-overview) and the [V3 Python SDK](/docs/getting-started-with-the-v3-sdk). If you're new to the Benchling API, be sure to check out the [Tutorial](/docs/getting-started-1#tutorial) in our Overview page before proceeding.

> **Info**
>
> The V3 user endpoints are beta. Set `early_access="true"` on the client, as in the examples below, or send the `EARLY-ACCESS: true` header on raw HTTP requests. See the [V3 Stability Guidelines](/docs/stability-guidelines).

Every example below uses this client. Pass your tenant's root URL; the SDK adds `/api/v3` itself.

```python
from benchling_v3_sdk import Benchling

benchling = Benchling(
    base_url="https://yourcompany.benchling.com",
    api_key="<your-api-key>",
    early_access="true",
)
```

## Users API Overview

The Users API includes a number of endpoints for managing Benchling users:

| Endpoint                                                             | SDK method                             | Description                                                                                                                    |
| -------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `GET /api/v3/user/items`                                             | `user.list`                            | Returns a paginated list of Benchling users. Can filter on `id.anyOf` and `name.anyOf`.                                        |
| `POST /api/v3/user`                                                  | `user.create`                          | Creates a single Benchling user. Requires `email`, `username`, and `name`; accepts an optional `organizationId`.               |
| `GET /api/v3/user/{user_id}`                                         | `user.get`                             | Returns a single user by Benchling API ID.                                                                                     |
| `PATCH /api/v3/user/{user_id}`                                       | `user.update`                          | Updates a single Benchling user's `email`, `username`, `name`, or `status`. Setting `status` to `SUSPENDED` suspends the user. |
| `POST /api/v3/user:batch-create`                                     | `user.batch_create`                    | Creates up to 25 users synchronously in one transaction.                                                                       |
| `PATCH /api/v3/user:batch-update`                                    | `user.batch_update`                    | Updates up to 25 users synchronously in one transaction.                                                                       |
| `POST /api/v3/user:bulk-create` and `PATCH /api/v3/user:bulk-update` | `user.bulk_create`, `user.bulk_update` | Create or update larger sets of users asynchronously from a JSONL file. See [Bulk Import](/docs/bulk-import).                  |

If you are coming from V2, a few fields changed:

| V2                                                  | V3                                   |
| --------------------------------------------------- | ------------------------------------ |
| `handle`                                            | `username`                           |
| `isSuspended: true` / `false`                       | `status: "SUSPENDED"` / `"ACTIVE"`   |
| `GET /api/v2/users/{user_id}/activity` → `lastSeen` | `lastSeen` on the user object itself |

V3 does not put group filters on the user listing. To find a user's teams and organizations, or a group's members, use `GET /api/v3/group-membership/items` with `memberId.eq` or `groupId.eq` instead of V2's `?memberOf=` and `?adminOf=`. See [Getting Information on Project Collaborators](/docs/getting-information-on-project-collaborators) for that pattern.

As in V2, one batch or bulk update can't swap the emails of two users. Change them in separate requests.

## Creating and reading users

```python
user = benchling.user.create(
    email="ada@example.com",
    username="ada",
    name="Ada Lovelace",
)
print(user.id, user.status)

for user in benchling.user.list(name_any_of="Ada Lovelace"):
    print(user.id, user.username, user.last_seen)
```

To create several users in one all-or-nothing request, pass up to 25 `CreateUserInput` items to `user.batch_create`:

```python
from benchling_v3_sdk import CreateUserInput

response = benchling.user.batch_create(
    items=[
        CreateUserInput(email="ada@example.com", username="ada", name="Ada Lovelace"),
        CreateUserInput(email="alan@example.com", username="alan", name="Alan Turing"),
    ]
)
print([created.id for created in response.items])
```

Set `organization_id` on a `CreateUserInput` to add the new user to that organization as a `MEMBER`. It's optional, even on tenants with more than one organization, unless your tenant is configured to require every user to belong to an organization.

## Permissions

User management is a highly privileged activity; for this reason, creating and updating Benchling users requires **tenant admin** or **User admin** privileges. Apps cannot be made tenant admins, so the confirmed way to create and update Benchling users is with an API key generated by a tenant admin or User admin.

Reading Benchling user data (e.g. using `GET /api/v3/user/items`) doesn't require any specific privileges, but the users returned depends on their organization membership. An app can only read a user's information if they are both members of the same organization. The same principle applies when using an API key, based on the user who created the key.

![Two organizations with overlapping membership, where an app in Alpha Lab can only see the five users who share that organization](/_fern-files/_img/ec17417048dcc29573201f75e16ddfb5ba1114394faec1a886556e51117832f4.webp)

## Suspension

Suspending users can be accomplished using either the single or batch and bulk update endpoints. In the body of the user update object, setting the `status` property to `SUSPENDED` will suspend a user. Suspended users still exist on a tenant, but are logged out of Benchling and cannot re-authenticate. Set `status` back to `ACTIVE` to reinstate them. For example:

```python
benchling.user.update("ent_a8asdp", status="SUSPENDED")
```

The SDK sends `{"status": "SUSPENDED"}` to `PATCH /api/v3/user/ent_a8asdp`. With raw HTTP:

```bash
curl -X PATCH "https://$YOUR_DOMAIN/api/v3/user/$USERID" \
  -H "Content-Type: application/json" \
  -H "EARLY-ACCESS: true" \
  -u $YOUR_API_KEY: \
  -d '{"status": "SUSPENDED"}'
```

To suspend several users in one transaction:

```python
from benchling_v3_sdk import UpdateUserInputWithPathParams

benchling.user.batch_update(
    items=[
        UpdateUserInputWithPathParams(id=user_id, status="SUSPENDED")
        for user_id in ["ent_a8asdp", "ent_rCgpcKrj"]
    ]
)
```