> 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 the status of sample groups in a Legacy Request

POST https://{tenant_name}.benchling.com/api/v2/requests/{request_id}:execute-sample-groups
Content-Type: application/json

Update the status of sample groups in a Legacy Request

Reference: https://docs.benchling.com/docs/api/v2/benchling-api/legacy-requests/execute-requests-sample-groups

## Authentication

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

## Request

### Path parameters

- `request_id` (string, required)

### Body (application/json)

This endpoint expects a SampleGroupsStatusUpdate.

- `sampleGroups` (list of SampleGroupStatusUpdate, required)

## Response

### 200

OK

## Errors

### 400 Bad Request Error

Bad Request

- `error` (BadRequestErrorError, optional)

### 404 Not Found Error

Not Found

- `error` (NotFoundErrorError, optional)

## Types

### SampleGroupStatusUpdate

- `sampleGroupId` (string, required) — The string id of the sample group
- `status` (enum, required) — Status of a sample group
  - Allowed values: `IN_PROGRESS`, `COMPLETED`, `FAILED`

### BadRequestErrorError

- `message` (string, optional)
- `type` (enum, optional)
  - Allowed values: `invalid_request_error`
- `userMessage` (string, optional)

### NotFoundErrorError

- `message` (string, optional)
- `type` (enum, optional)
  - Allowed values: `invalid_request_error`
- `userMessage` (string, optional)
- `invalidId` (string, optional)

## Examples

**Request**

```json
{
  "sampleGroups": [
    {
      "sampleGroupId": "sgrp_2GPCXk6",
      "status": "IN_PROGRESS"
    }
  ]
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v2/requests/req_JekfeyVS:execute-sample-groups"

payload = { "sampleGroups": [
        {
            "sampleGroupId": "sgrp_2GPCXk6",
            "status": "IN_PROGRESS"
        }
    ] }
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/v2/requests/req_JekfeyVS:execute-sample-groups';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"sampleGroups":[{"sampleGroupId":"sgrp_2GPCXk6","status":"IN_PROGRESS"}]}'
};

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