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

POST https://{tenant_name}.benchling.com/api/v3/gateway:update-gateways
Content-Type: application/json

Update, archive, or unarchive up to 25 gateways.

The gateways are written all-or-nothing: if any gateway fails, the request fails with the errors of the failed gateways, and none of the gateways are written.

Omitted fields are left unchanged, and `fields` sets only the configuration fields it includes. An archived gateway can be updated only by an update that also unarchives it.

To archive a gateway, set `archived` to `true` and provide an `archiveReason`. Archiving a gateway also archives its unarchived connections, with the same archive reason. If a connection can't be archived, the request fails with an error for its gateway, but the gateway stays archived; archive it again to archive its remaining connections. To unarchive a gateway, set `archived` to `false` and omit `archiveReason`. Unarchiving a gateway doesn't unarchive its connections.

Reference: https://docs.benchling.com/docs/api/benchling-api/gateway/updategateways

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

- `gateways` (list of UpdateGatewayInput, required) — The gateway updates. Maximum 25.

## Response

### 200

OK

- `gateways` (list of GatewayRef, optional) — The updated Gateways, in the order they were requested.

## Errors

### 400 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 Forbidden Error

Forbidden

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

### 404 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 Conflict Error

Conflict

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

### 429 Too Many Requests Error

Too Many Requests

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

### 500 Internal Server Error

Internal Server Error

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

## Types

### UpdateGatewayInput

- `id` (string, required)
- `archiveReason` (string, optional) — Why it is being archived. Required when `archived` is `true`, and not allowed when unarchiving.
- `archived` (boolean, optional) — Set to `true` to archive or `false` to unarchive it. Archiving requires `archiveReason`.
- `fields` (map from string to string, optional) — Values for the gateway type's configuration fields, keyed by field ID. Field values aren't returned. Fields that aren't included are left unchanged.
- `name` (string, optional) — The name of the gateway. Leading and trailing whitespace is removed. Maximum 63 characters.

### GatewayRef

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

### GeneralErrorDetail

- string
- map from string to any

### TooManyRequestsErrorDetail

- string
- map from string to any

### InternalServerErrorDetail

- string
- map from string to any

## Examples

**Request**

```json
{
  "gateways": [
    {
      "id": "gtw_8MSOq4Gf",
      "name": "Lab PC 2"
    },
    {
      "id": "gtw_Q7vNt3Ld",
      "fields": {
        "customer_bucket": "acme-instrument-exports-2"
      }
    }
  ]
}
```

**Response**

```json
{
  "gateways": [
    {
      "__typename": "string",
      "id": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v3/gateway:update-gateways"

payload = { "gateways": [
        {
            "id": "gtw_8MSOq4Gf",
            "name": "Lab PC 2"
        },
        {
            "id": "gtw_Q7vNt3Ld",
            "fields": { "customer_bucket": "acme-instrument-exports-2" }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://{tenant_name}.benchling.com/api/v3/gateway:update-gateways';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"gateways":[{"id":"gtw_8MSOq4Gf","name":"Lab PC 2"},{"id":"gtw_Q7vNt3Ld","fields":{"customer_bucket":"acme-instrument-exports-2"}}]}'
};

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