xPlantAPI
API referenceContaminations

Get a contamination

One contamination log, with the plants and explants it is linked to.

GET/api/v1/contaminations/{id}
Scope read:contaminations

Path parameters

NameTypeRequiredDescription
idstring (uuid)YesThe record's id.

Example

curl https://app.xplantpro.com/api/v1/contaminations/6a8c0e2b-4d6f-4a8c-9e0b-2d4f6a8c0e2b \
  -H "Authorization: Bearer $XPLANT_API_KEY"

Response

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

FieldTypeRequiredDescription
idstring (uuid)Yes—
workspace_idstring | nullYesThe workspace the log belongs to.
typestring | nullYesWhat was seen: mold, bacteria, hyperhydricity, phenolic, algae, yeast, endophytic, viral, fungal, physiological, contaminated_media, damage, insect, other.
type_otherstring | nullYesThe contamination in the logger's own words, when type is other.
issuestringYesA short summary of what was seen.
descriptionstring | nullYes—
notesstring | nullYes—
severitystringYesHow serious it is: very low, low, medium, high, critical.
statusstringYesWhere it stands: active, resolved, quarantined, archived, under investigation.
observed_atstring | nullYesWhen it was seen. ISO 8601.
resolved_atstring | nullYesWhen it was marked resolved. ISO 8601.
vessels_affectedinteger | nullYesHow many vessels it reached. Null when nobody counted, which is not the same as none.
plants_affectedinteger | nullYesHow many plants it reached. Null when nobody counted, which is not the same as none.
affected_vessel_markingsstring | nullYesWhich vessels, as written on them.
custom_fieldsobjectYesYour lab's own fields on this contamination, keyed by field key. Always an object: {} when none were filled in.
plant_idsstring (uuid)[]YesThe plants the log is linked to.
explant_idsstring (uuid)[]YesThe explants the log is linked to.
logged_bystring (uuid)YesUser id of the workspace member who logged it.
created_atstring | nullYesWhen it was logged. ISO 8601.
updated_atstring | nullYesWhen it last changed. ISO 8601.
Response
{
  "ok": true,
  "data": {
    "id": "8a3c1e57-4b2d-4f60-9c81-2d7e5b9a0f14",
    "workspace_id": "3f9d2b61-7c4e-4a85-b0d3-6e1f8a2c5b97",
    "type": "bacteria",
    "type_other": null,
    "issue": "Cloudy halo around the base of the Phalaenopsis explant",
    "description": null,
    "notes": "Noticed at the weekly check on shelf 3.",
    "severity": "medium",
    "status": "active",
    "observed_at": "2026-09-24T08:30:00.000Z",
    "resolved_at": null,
    "vessels_affected": 2,
    "plants_affected": null,
    "affected_vessel_markings": "P-07 / P-09",
    "custom_fields": {
      "hood": "Hood 2"
    },
    "plant_ids": [],
    "explant_ids": [
      "6d2f9a14-8b3e-4c71-a5d0-1f7e3b8c2a96"
    ],
    "logged_by": "0d7e4b9a-6f21-4c3e-8a5b-2e9f1c7d4a60",
    "created_at": "2026-09-24T08:41:12.000Z",
    "updated_at": "2026-09-24T08:41:12.000Z"
  }
}
Response headerMeaning
X-Request-IdIdentifies this request. Include it when you contact support.

Errors

StatusCodeWhen
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.
404NOT_FOUNDNo record with this id exists in the key's workspace.
429RATE_LIMIT_EXCEEDEDToo many requests for this key, device token or workspace. Wait Retry-After seconds.
500CONTAMINATION_QUERY_FAILEDThe log could not be read. Retry later.

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

On this page