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

PATCH https://{tenant_name}.benchling.com/api/v3/study-schema/{study_schema_id}
Content-Type: application/json

Update a study schema. Only the supplied fields are changed; `studyType` cannot be changed after creation.

## ID generation

- Changing `idGenerationMode` or `prefix` affects only studies created after this update; existing study IDs do not change.
- When changing to `AUTO_GENERATED_FROM_PREFIX`, provide a non-empty, unique `prefix`. Numbering continues from the highest existing study ID that uses the prefix.
- When changing to `MANUAL`, the prefix is cleared.

## Restrictions

- When provided, `entryTemplateIds` replaces all existing entry-template associations. It is supported only for `CUSTOM` study schemas. Provide at most 50 IDs.
- `isDesignApprovalRequired` is supported for `CUSTOM` schemas and, when design review is enabled for the tenant, for `CLINICAL` and `PRECLINICAL` schemas. It is not supported for `PROCESS_DEVELOPMENT` or `ASSAY_DEVELOPMENT` schemas.
- `systemName` is updated only when warehouse table-name changes are enabled for the caller; otherwise, a supplied value is ignored.

Reference: https://docs.benchling.com/docs/api/benchling-api/study-schema/update

## Authentication

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

## Request

### Path parameters

- `study_schema_id` (string, required) — ID of the StudySchema.

### Body (application/json)

This endpoint expects an object.

- `archiveReason` (string, optional)
- `archived` (boolean, optional)
- `description` (string, optional) — Updated description. When provided, must be at most 1000 characters.
- `entryTemplateIds` (list of string, optional) — Replacement entry template IDs for this schema.
- `idGenerationMode` (enum, optional) — Updated study ID generation mode. Changing this setting only affects studies created from now on; existing studies keep their IDs. When switching to AUTO_GENERATED_FROM_PREFIX, numbering continues from the highest existing ID that uses the prefix. When switching to MANUAL, the prefix is automatically cleared if no prefix value is provided.
  - Allowed values: `AUTO_GENERATED_FROM_PREFIX`, `MANUAL`
- `isDesignApprovalRequired` (boolean, optional) — Updated design approval requirement.
- `name` (string, optional) — Updated user-facing name. When provided, must be non-empty after stripping whitespace, at most 255 characters, and unique within the organization.
- `prefix` (string, optional) — Updated ID prefix for this schema.
- `systemName` (string, optional) — Updated SQL identifier for the warehouse table name. When provided, must match the pattern [a-z_][a-z0-9_$]*, cannot be a reserved table name, cannot start with 'bnch$', and must be unique within the organization.
- `displayName` (string, optional, deprecated) — Deprecated. Use name instead.

## Response

### 200

OK

- `__typename` (string, optional)
- `archiveReason` (string, optional, nullable)
- `archived` (boolean, optional)
- `createdAt` (string, optional, nullable)
- `creator` (PrincipalRef, optional)
- `description` (string, optional) — A description of this study schema for documentation purposes.
- `entryTemplates` (string, optional)
- `fieldDefinitions` (string, optional)
- `id` (string, optional)
- `idGenerationMode` (enum, optional) — How Study IDs are assigned for studies of this schema.
  - Allowed values: `AUTO_GENERATED_FROM_PREFIX`, `MANUAL`
- `isDesignApprovalRequired` (boolean, optional)
- `modifiedAt` (string, optional, nullable)
- `name` (string, optional)
- `organization` (OrganizationRef, optional)
- `prefix` (string, optional, nullable)
- `studyType` (enum, optional)
  - Allowed values: `CUSTOM`, `PROCESS_DEVELOPMENT`, `ASSAY_DEVELOPMENT`, `CLINICAL`, `PRECLINICAL`

## Errors

### 400 Study Schema 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 Study Schema 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 Study Schema 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 Study Schema 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 Study Schema 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 Study Schema 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)

### OrganizationRef

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

### GeneralErrorDetail

### TooManyRequestsErrorBodyDetail

### InternalServerErrorBodyDetail

## Examples

**Request**

```json
{
  "entryTemplateIds": [
    "tmpl_kT6BHBdZ",
    "tmpl_3wievUIJ"
  ],
  "isDesignApprovalRequired": false,
  "name": "Phase II Clinical Study (Updated)"
}
```

**Response**

```json
{
  "__typename": "__typename",
  "archiveReason": "archiveReason",
  "archived": true,
  "createdAt": "createdAt",
  "creator": {
    "__typename": "__typename",
    "id": "id"
  },
  "description": "description",
  "entryTemplates": "entryTemplates",
  "fieldDefinitions": "fieldDefinitions",
  "id": "id",
  "idGenerationMode": "AUTO_GENERATED_FROM_PREFIX",
  "isDesignApprovalRequired": true,
  "modifiedAt": "modifiedAt",
  "name": "name",
  "organization": {
    "__typename": "__typename",
    "id": "id"
  },
  "prefix": "prefix",
  "studyType": "CUSTOM"
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v3/study-schema/study_schema_id"

payload = {
    "entryTemplateIds": ["tmpl_kT6BHBdZ", "tmpl_3wievUIJ"],
    "isDesignApprovalRequired": False,
    "name": "Phase II Clinical Study (Updated)"
}
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/study-schema/study_schema_id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"entryTemplateIds":["tmpl_kT6BHBdZ","tmpl_3wievUIJ"],"isDesignApprovalRequired":false,"name":"Phase II Clinical Study (Updated)"}'
};

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