> 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.

# Batch update WarehouseCredential

PATCH https://{tenant_name}.benchling.com/api/v3/warehouse-credential:batch-update
Content-Type: application/json

Batch update WarehouseCredential synchronously in one transaction. Maximum 25 items per request.

Reference: https://docs.benchling.com/docs/api/benchling-api/warehouse-credential/batchupdate

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Headers

- `EARLY-ACCESS` (string, optional) — Set to true to access beta operations via /api/v3.

### Body (application/json)

This endpoint expects an object.

- `items` (list of UpdateWarehouseCredentialInputWithPathParams, required)

## Response

### 200

OK

- `items` (list of WarehouseCredential, required)

## Errors

### 400 Warehouse Credential Batch Update Request Bad Request Error

Bad Request

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 403 Warehouse Credential Batch Update Request Forbidden Error

Forbidden

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 404 Warehouse Credential Batch Update Request Not Found Error

Not Found

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 409 Warehouse Credential Batch Update Request Conflict Error

Conflict

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 429 Warehouse Credential Batch Update Request Too Many Requests Error

Too Many Requests

- `detail` (TooManyRequestsErrorBodyDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)
- `violated-policies` (list of enum, optional) — The budget policies that rejected the request, in canonical order: `user`, `integration`, then `tenant`.
  - Allowed values: `user`, `integration`, `tenant`

### 500 Warehouse Credential Batch Update Request Internal Server Error

Internal Server Error

- `detail` (InternalServerErrorBodyDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `errorId` (string, optional)

## Types

### UpdateWarehouseCredentialInputWithPathParams

- `id` (string, required)
- `revoked` (boolean, required) — Indicates whether or not the WarehouseCredential has been revoked. When a WarehouseCredential is revoked, the credentials are deleted in the warehouse and can not be reactivated. The only valid value for this field is `true`.

### WarehouseCredential

Represents credentials for connecting to Benchling's data warehouse, enabling users to query data using SQL tools like database clients or BI platforms. This includes all warehouse login types: user-generated Direct Access credentials, as well as temporary Insights and Agent credentials. Each WarehouseCredential is tied to a specific Benchling `user` whose permissions determine what data is accessible through those credentials. Credentials can have an optional `expiresAt` date for time-limited access and can be permanently disabled via the `revoked` flag. Once revoked, credentials cannot be reactivated. Users can create multiple credentials (up to a per-user limit) with different `label` values to distinguish between uses.

- `__typename` (string, optional)
- `createdAt` (string, optional, nullable)
- `expiresAt` (string, optional, nullable) — The time after which new connections using the username/password will not be permitted. Upon expiration, currently open connections are not terminated.
- `id` (string, optional)
- `label` (string, optional, nullable) — An optional label defined by the user who created the WarehouseCredential.
- `modifiedAt` (string, optional, nullable)
- `revoked` (boolean, optional) — Indicates whether or not the WarehouseCredential has been revoked. When a WarehouseCredential is revoked, the credentials are deleted in the warehouse and can not be reactivated.
- `user` (PrincipalRef, optional) — The Benchling user whose permissions are used when creating the WarehouseCredential
- `username` (string, optional) — The username to connect to the warehouse.

### GeneralErrorDetail

### TooManyRequestsErrorBodyDetail

### InternalServerErrorBodyDetail

### PrincipalRef

- `__typename` (string, optional)
- `id` (string, optional)

## Examples

**Request**

```json
{
  "items": [
    {
      "id": "id",
      "revoked": true
    }
  ]
}
```

**Response**

```json
{
  "items": [
    {
      "__typename": "__typename",
      "createdAt": "createdAt",
      "expiresAt": "expiresAt",
      "id": "id",
      "label": "label",
      "modifiedAt": "modifiedAt",
      "revoked": true,
      "username": "username"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v3/warehouse-credential:batch-update"

payload = { "items": [
        {
            "id": "id",
            "revoked": True
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{tenant_name}.benchling.com/api/v3/warehouse-credential:batch-update';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"items":[{"id":"id","revoked":true}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```