API referenceExplants
Update an explant
Changes only the fields you send. Send null to clear an optional one.
PATCH
https://app.xplantpro.com/ api/ v1/ explants/ {id}Scope
write:explantscustom_fields changes only the keys you name: the explant's other values stay as they are, and null clears a field.
A key can change the explants its owner created. Changing a teammate's explant needs the key's owner to be a manager or owner of the lab.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | The record's id. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
label | string | No | 1–200 characters. |
batch_number | string | null | No | Up to 100 characters. |
notes | string | null | No | Up to 5000 characters. |
status | "active" | "establishing" | "growing" | "needs_subculture" | "quarantined" | "senescing" | "discarded" | "retired" | "lost" | No | Where the culture stands. New explants default to active. |
external_id | string | null | No | Your own identifier for this culture, such as a batch or line code from your own records. It must be unique in the workspace, ignoring case, and it is how GET /api/v1/explants?externalId= finds the explant again. Send null to clear it. 1–100 characters. |
custom_fields | object | No | Values for the lab's own fields, keyed by each field's key. Only the keys you send change; the explant's other values stay as they are. Send null as a value to clear that field. Each value must fit its field, a key the lab has not set up is refused, and the record's values together may total at most 10,000 bytes. |
Example
curl -X PATCH https://app.xplantpro.com/api/v1/explants/7c1d9e2a-3b4f-4a5c-8d6e-1f2a3b4c5d6e \
-H "Authorization: Bearer $XPLANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "growing",
"custom_fields": {
"cytokinin_added": false
}
}'Response
200 with { "ok": true, "data": … }. data holds the result.
| Field | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | — |
label | string | null | Yes | The culture's label — the name the lab knows it by. |
external_id | string | null | Yes | Your identifier for the culture: the external_id you gave it, otherwise its batch number, otherwise its label. Null when it has none of these. |
status | string | Yes | Where the culture stands, usually one of active, establishing, growing, needs_subculture, quarantined, senescing, discarded, retired, lost. |
plant_id | string | null | Yes | The plant the explant was taken from, when one is recorded. |
workspace_id | string | null | Yes | The workspace the explant belongs to. |
initial_count | integer | null | Yes | The count recorded when the culture was started. |
current_count | integer | null | Yes | The culture's count as last recorded. |
created_at | string | null | Yes | ISO 8601 timestamp. |
custom_fields | object | Yes | The lab's own fields for this record, keyed by each field's key as set up in the lab's settings. Values are text, numbers, true or false, or dates written as YYYY-MM-DD; a field left blank is absent or null. Empty when the lab has set up no fields. |
{
"ok": true,
"data": {
"id": "b7e4a2c9-1f3d-4e8b-8a6c-5d2f9e1b7c34",
"label": "Zebrina line A",
"external_id": "LINE-0412-A",
"status": "growing",
"plant_id": "8c3f2d1a-6b4e-4f7a-9d2c-1e5b7a9c3f60",
"workspace_id": "3a9e7c21-5d4b-4c8f-a1e6-9b2d0f4c7e13",
"initial_count": null,
"current_count": null,
"created_at": "2026-09-25T10:05:00.000Z",
"custom_fields": {
"medium_lot": "MS-2609-03",
"cytokinin_added": false
}
}
}| Response header | Meaning |
|---|---|
X-Request-Id | Identifies this request. Include it when you contact support. |
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION_ERROR | The request body is not valid JSON. |
401 | UNAUTHORIZED | The key is missing, malformed or revoked, or its owner is no longer a member of the workspace. |
402 | PAID_PLAN_REQUIRED | The workspace's plan does not include the API. The full API is included with xPlant+ Teams and Enterprise; on Hobby and Pro Lab, keys can connect devices only. |
403 | FORBIDDEN | The key lacks a scope this operation requires, or its owner's current role in the workspace cannot use it — a key never does more than its owner can in xPlant. error names the scope, and for a role, the role it needs. |
403 | DEVICE_TOKEN_NOT_ACCEPTED | A device token was sent; this operation needs a workspace API key. |
403 | EXPLANT_WRITE_FORBIDDEN | The explant was created by someone else, and the key's owner is not a manager or owner of the lab. |
404 | NOT_FOUND | No record with this id exists in the key's workspace. |
409 | DUPLICATE_ENTRY | Another explant in the workspace already uses this external_id, including one that has been deleted. |
422 | VALIDATION_ERROR | A field failed validation. error names the first one, for example title: title is required. |
422 | VALIDATION_ERROR | custom_fields names a field the lab has not set up, gives a field a value that does not fit it, or totals more than 10,000 bytes. error names the field. |
429 | RATE_LIMIT_EXCEEDED | Too many requests for this key, device token or workspace. Wait Retry-After seconds. |
500 | EXPLANT_UPDATE_FAILED | The change could not be saved. Retry later. |
Branch on code, never on the error text. See Errors.