xPlantAPI
API reference

API overview

Every v1 endpoint, the scope it needs, and what it returns.

Base URL: https://app.xplantpro.com/api/v1. Send your key as Authorization: Bearer <key> on every request. Request and response bodies are JSON.

Every response uses the same envelope:

{ "ok": true, "data": { } }
{ "ok": false, "data": null, "error": "Missing scope: write:tasks", "code": "FORBIDDEN" }

Read data on success. On failure, branch on code, which is stable; error is for people and its wording can change. See Errors.

The machine-readable spec is openapi.json (OpenAPI 3).

Account

EndpointWhat it doesScope
GET /meGet the calling keynone
GET /workspacesGet the workspaceread:workspace

Plants

EndpointWhat it doesScope
GET /plantsList plantsread:plants
POST /plantsCreate a plantwrite:plants
GET /plants/{id}Get a plantread:plants
PATCH /plants/{id}Update a plantwrite:plants

Explants

EndpointWhat it doesScope
GET /explantsList explantsread:explants
POST /explantsCreate an explantwrite:explants
GET /explants/{id}Get an explantread:explants
PATCH /explants/{id}Update an explantwrite:explants

Transfers and stages

EndpointWhat it doesScope
GET /stagesList stagesread:transfers
POST /stagesAdvance a stagewrite:transfers
GET /transfersList transfersread:transfers
POST /transfersRecord a transferwrite:transfers

Change history

EndpointWhat it doesScope
GET /eventsList change historyread:events

Contaminations

EndpointWhat it doesScope
GET /contaminationsList contaminationsread:contaminations
POST /contaminationsRecord a contaminationwrite:contaminations
GET /contaminations/{id}Get a contaminationread:contaminations

Tasks and demand

EndpointWhat it doesScope
GET /tasksList tasksread:tasks
POST /tasksCreate a taskwrite:tasks
GET /tasks/{id}Get a taskread:tasks
PATCH /tasks/{id}Update a taskwrite:tasks
GET /tasks/demandList demand signalsread:tasks
POST /tasks/demandRecord a demand signalwrite:demand

Comments

EndpointWhat it doesScope
GET /commentsList commentsread:comments
POST /commentsAdd a commentwrite:comments

Media

EndpointWhat it doesScope
GET /assetsList media filesread:assets
POST /assetsAttach a media filewrite:assets
GET /assets/{id}Get a media fileread:assets
GET /media-recipesList media recipesread:media_recipes
POST /media-recipesCreate a media recipewrite:media_recipes
GET /media-recipes/{id}Get a media reciperead:media_recipes
PATCH /media-recipes/{id}Update a media recipewrite:media_recipes

SOPs and runs

EndpointWhat it doesScope
POST /sop-runsStart an SOP runwrite:sop_runs
GET /sop-runs/{id}Get an SOP runread:sop_runs
POST /sop-runs/{id}/steps/{stepId}/eventsRecord step evidencewrite:sop_steps
POST /sop-runs/{id}/steps/{stepId}/measurementsRecord a step measurementwrite:sop_steps
GET /sopsList SOPsread:sops
GET /sops/{id}Get an SOPread:sops

Labels

EndpointWhat it doesScope
POST /label-scansRecord a label scanwrite:label_scans
GET /labels/resolveResolve a labelread:labels

Devices

EndpointWhat it doesScope
POST /device-eventsRecord a device eventwrite:device_events
GET /devicesList devicesread:devices
POST /devicesRegister a devicewrite:devices
POST /devices/{deviceId}/heartbeatSend a heartbeatwrite:devices
GET /devices/{deviceId}/tokensList device tokensread:devices
POST /devices/{deviceId}/tokensCreate a device tokenwrite:devices
DELETE /devices/{deviceId}/tokens/{tokenId}Revoke a device tokenwrite:devices

Sensor readings

EndpointWhat it doesScope
GET /sensor-readingsList sensor readingsread:sensor_readings
POST /sensor-readingsSubmit sensor readingswrite:sensor_readings

Equipment

EndpointWhat it doesScope
GET /equipmentList equipmentread:equipment
GET /equipment/{id}Get a piece of equipmentread:equipment
GET /equipment/{id}/eventsList equipment eventsread:equipment
POST /equipment/{id}/eventsRecord an equipment eventwrite:equipment_events

Pricing and sell-through

EndpointWhat it doesScope
GET /commerce/order-linesList order linesread:commerce
GET /commerce/sell-throughGet sell-throughread:commerce
GET /pricing/culture-linesList culture line pricesread:pricing
GET /pricing/eventsList price changesread:pricing
Edit on GitHub

On this page