xPlantAPI
API referencePlants

Update a plant

Changes only the fields you send. Send null to clear an optional one.

PATCH/api/v1/plants/{id}
Scope write:plants

custom_fields changes only the keys you name: the plant's other values stay as they are, and null clears a field.

A key can change the plants its owner created. Changing a teammate's plant needs the key's owner to be a manager or owner of the lab.

Path parameters

NameTypeRequiredDescription
idstring (uuid)YesThe record's id.

Request body

FieldTypeRequiredDescription
speciesstringNo1–200 characters.
common_namestring | nullNoUp to 200 characters.
genusstring | nullNoUp to 100 characters.
familystring | nullNoUp to 100 characters.
cultivarstring | nullNoUp to 200 characters.
sourcestring | nullNoUp to 200 characters.
notesstring | nullNoUp to 5000 characters.
status"active" | "dormant" | "harvested" | "contaminated" | "failed" | "in_culture" | "ready_for_transfer" | "quarantined" | "archived"NoWhere the plant stands in the lab. New plants default to active.
external_idstring | nullNoYour own identifier for the plant, such as a line or accession code from your own records. It must be unique in the workspace, ignoring case, and it is how GET /api/v1/plants?externalId= finds the plant again. Send null to clear it. 1–100 characters.
custom_fieldsobjectNoValues for the lab's own fields, keyed by each field's key. Only the keys you send change; the plant'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/plants/0b8e2f4c-6a1d-4c3e-9f7a-2d5b8c1e4a90 \
  -H "Authorization: Bearer $XPLANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "ready_for_transfer",
    "custom_fields": {
      "weeks_in_culture": 13
    }
  }'

Response

200 with { "ok": true, "data": … }. data holds the result.

FieldTypeRequiredDescription
idstring (uuid)Yes—
namestringYesWhat the lab calls the plant: its common name, or its species when it has none.
speciesstringYes—
statusstringYesWhere the plant stands in the lab, usually one of active, dormant, harvested, contaminated, failed, in_culture, ready_for_transfer, quarantined, archived.
workspace_idstring | nullYesThe workspace the plant belongs to.
created_atstring | nullYesISO 8601 timestamp.
external_idstring | nullYesYour own identifier for the plant, exactly as it was given, or null when it has none.
custom_fieldsobjectYesThe 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.
Response
{
  "ok": true,
  "data": {
    "id": "8c3f2d1a-6b4e-4f7a-9d2c-1e5b7a9c3f60",
    "name": "Zebra Alocasia",
    "species": "Alocasia zebrina",
    "status": "ready_for_transfer",
    "workspace_id": "3a9e7c21-5d4b-4c8f-a1e6-9b2d0f4c7e13",
    "created_at": "2026-09-25T09:30:00.000Z",
    "external_id": "LINE-0412",
    "custom_fields": {
      "mother_stock_tray": "B4",
      "weeks_in_culture": 13
    }
  }
}
Response headerMeaning
X-Request-IdIdentifies this request. Include it when you contact support.

Errors

StatusCodeWhen
400VALIDATION_ERRORThe request body is not valid JSON.
401UNAUTHORIZEDThe key is missing, malformed or revoked, or its owner is no longer a member of the workspace.
402PAID_PLAN_REQUIREDThe 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.
403FORBIDDENThe 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.
403DEVICE_TOKEN_NOT_ACCEPTEDA device token was sent; this operation needs a workspace API key.
403PLANT_WRITE_FORBIDDENThe plant was created by someone else, and the key's owner is not a manager or owner of the lab.
404NOT_FOUNDNo record with this id exists in the key's workspace.
409DUPLICATE_ENTRYAnother plant in the workspace already uses this external_id, including one that has been deleted.
422VALIDATION_ERRORA field failed validation. error names the first one, for example title: title is required.
422VALIDATION_ERRORcustom_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.
429RATE_LIMIT_EXCEEDEDToo many requests for this key, device token or workspace. Wait Retry-After seconds.
500PLANT_UPDATE_FAILEDThe change could not be saved. Retry later.

Branch on code, never on the error text. See Errors.

On this page