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

# Create results in a transaction

POST https://{tenant_name}.benchling.com/api/v2/result-transactions/{transaction_id}/results
Content-Type: application/json

Create results in a transaction

Reference: https://docs.benchling.com/docs/api/v2/benchling-api/assay-results/create-assay-results-in-transaction

## Authentication

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

## Request

### Path parameters

- `transaction_id` (string, required)

### Body (application/json)

This endpoint expects an AssayResultsBulkCreateRequest.

- `assayResults` (list of AssayResultCreate, required)

## Response

### 200

OK

- `assayResults` (list of string, optional)
- `errors` (AssayResultsCreateResponseErrors, optional, nullable)

## Errors

### 400 Bad Request Error

Bad Request

- `assayResults` (list of AssayResultsCreateErrorResponseAssayResultsItems, optional, nullable)
- `errors` (list of AssayResultsCreateErrorResponseErrorsItems, optional)

## Types

### AssayResultCreate

- `fields` (AssayResultCreateFields, required) — Dictionary of result fields. Please note the field keys must be the field's system name, not display name.
- `schemaId` (string, required) — ID of result schema under which to upload this result
- `fieldValidation` (map from string to UserValidation, optional) — Dictionary mapping field names to UserValidation Resources.
- `id` (string, optional) — UUID
- `projectId` (string, optional, nullable) — The project that the assay result should be uploaded to. Only users with read access to the project will be able to read the assay result. Leaving this empty will result in only the creator having read access.

### AssayResultsCreateResponseErrors

### AssayResultsCreateErrorResponseAssayResultsItems

### AssayResultsCreateErrorResponseErrorsItems

- `fields` (AssayResultsCreateErrorResponseErrorsItemsFields, optional)
- `global` (list of string, optional)

### AssayResultCreateFields

Dictionary of result fields. Please note the field keys must be the field's system name, not display name.

### UserValidation

- `validationComment` (string, optional) — A string explaining the reason for the provided validation status.
- `validationStatus` (enum, optional) — Valid values for this enum depend on whether it is used to set a value (e.g., in a POST request), or is a return value for an existing result. Acceptable values for setting a status are 'VALID' or 'INVALID'. Possible return values are 'VALID', 'INVALID', or 'PARTIALLY_VALID' (a result will be partially valid if it has some valid fields and some invalid fields).
  - Allowed values: `VALID`, `INVALID`, `PARTIALLY_VALID`

### AssayResultsCreateErrorResponseErrorsItemsFields

## Examples

**Request**

```json
{
  "assayResults": [
    {
      "fields": {
        "my_entity_link": {
          "value": "bfi_a0B1cd23"
        },
        "my_text_field": {
          "value": "some text"
        }
      },
      "schemaId": "string"
    }
  ]
}
```

**Response**

```json
{
  "assayResults": [
    "string"
  ],
  "errors": {}
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v2/result-transactions/transaction_id/results"

payload = { "assayResults": [
        {
            "fields": {
                "my_entity_link": { "value": "bfi_a0B1cd23" },
                "my_text_field": { "value": "some text" }
            },
            "schemaId": "string"
        }
    ] }
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/result-transactions/transaction_id/results';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"assayResults":[{"fields":{"my_entity_link":{"value":"bfi_a0B1cd23"},"my_text_field":{"value":"some text"}},"schemaId":"string"}]}'
};

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