---
title: "Create TestDefinition"
method: POST
path: "/api/v3/test-definition"
tags: ["Test Definition"]
---

# Create TestDefinition

`POST /api/v3/test-definition`

## Request

- Base URL: `https://{tenant_name}.benchling.com`
- URL: `https://{tenant_name}.benchling.com/api/v3/test-definition`
- Auth: HTTP bearer

Create a Test Definition that can be referenced by Test Orders and assay workflows.

## Required fields

| Field | Description |
| --- | --- |
| `name` | Display name. Names are trimmed and must be unique within `organizationId`. |
| `organizationId` | Owning organization. Use `GET /benchling/organization/items` to find organization IDs. |
| `resultSchemaId` | Result schema that defines the measurements captured by this test. Use `GET /benchling/result-schema/items` to find result schema IDs. |
| `description` | Human-readable description. Empty strings are allowed. |

## Notes

- The creator is set automatically from the authenticated user or app.
- The caller must have admin access to the organization and read access to the result schema.
- `name` and `description` must each be at most 255 characters.

## Headers

- `EARLY-ACCESS` string

## Request body

- CreateTestDefinitionInput
  - `description` string, required: Human-readable description for the test definition. Empty strings are allowed; values must be at most 255 characters.
  - `name` string, required: Display name for the test definition. Must be non-empty after trimming whitespace and unique within the organization.
  - `organizationId` string, required: The API ID of the organization that owns the test definition.
  - `resultSchemaId` string, required: The API ID of the result schema that defines the shape of results captured for this test.

## Response `201`

Created

- TestDefinition: A Test Definition is a configuration object that specifies a type of test or assay that can be ordered against samples. Each Test Definition is associated with a `ResultSchema` that defines the structure of measurement data captured when the test is performed. Test Definitions serve as templates—when a test needs to be performed on a sample, a `TestOrder` is created referencing the appropriate Test Definition. Test Definitions are used within clinical and preclinical study workflows (see `StudySampleTestPlan`) and can be linked to `Procedure` assays for execution. Belongs to an `Organization` and can be archived when no longer needed.
  - `__typename` string
  - `archiveReason` string, nullable
  - `archived` boolean
  - `createdAt` string, datetime: Timestamp of when the test definition was created.
  - `creator` PrincipalRef
    - `__typename` string
    - `id` string, api_id
  - `description` string: The description of the test definition. Empty strings are allowed.
  - `id` string: The ID of the test definition.
  - `modifiedAt` string, datetime: Timestamp of when the test definition was last modified.
  - `name` string: The name of the test definition.
  - `organization` OrganizationRef
    - `__typename` string
    - `id` string, api_id
  - `resultSchema` ResultSchemaRef
    - `__typename` string
    - `id` string, api_id

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/benchling/apis/benchling-api.md) - [All operations](https://skmtc.dev/benchling/apis/benchling-api/llms.txt) - [OpenAPI document](https://skmtc.dev/benchling/apis/benchling-api/revisions/c9f087b98b8b?raw)
