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

# Update WarehouseCredential

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

Update WarehouseCredential.

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

## Authentication

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

## Request

### Path parameters

- `warehouse_credential_id` (string, required) — ID of the WarehouseCredential.

### Headers

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

### Body (application/json)

This endpoint expects an object.

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

## Response

### 200

OK

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

## Errors

### 400 Warehouse Credential 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 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 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 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 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)

### 500 Warehouse Credential 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

### PrincipalRef

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

### GeneralErrorDetail

### TooManyRequestsErrorBodyDetail

### InternalServerErrorBodyDetail

## Examples

**Request**

```json
{
  "revoked": true
}
```

**Response**

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

**SDK Code**

```python
import requests

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

payload = { "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/warehouse_credential_id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"revoked":true}'
};

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