Example API requests
- ai
- ai_feedbacks
- alerts
- corpus
- curves
- demo_account
- device
- export_data
- farm_events
- farmware_envs
- fbos_config
- featured_sequences
- feedback
- firmware_config
- folders
- global_bulletins
- global_config
- images
- logs
- password_resets
- peripherals
- pin_bindings
- plant_templates
- point_groups
- points
- public_key
- regimens
- releases
- saved_gardens
- sensor_readings
- sensors
- sequence_versions
- sequences
- storage_auth
- telemetries
- tokens
- tools
- users
- web_app_config
- webcam_feeds
- wizard_step_results
The document that follows is a list of example API requests. It serves as a guide for developers who wish to see the schema and existence of particular API endpoints quickly. For a list of resources, see the quick reference table.
Authorization required
To get the authorization token required in these examples (TOKEN), see Authorization.
Making requests
Making requests other than GET to the API will permanently alter the data in your account. Be especially careful making DELETE requests and POST requests to singular resources, like the /device endpoint, as the API will destroy data that cannot be recovered. Altering data through the API may cause account instability.
Tip
If you are unsure about how data should look, create a resource in the Web App and then perform a GET request to inspect the data.
ai
Used for sequence name and description generation and Lua code generation.
| Method | Description |
|---|---|
POST /api/ai |
Submit an auto-generation request. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
promptInstructions for model to follow. |
string | Β | Β | π | Β | Β |
context_keyType of generation request. |
βtitleβ | βcolorβ | βdescriptionβ | βluaβ | Β | Β | π | Β | Β |
sequence_idFor sequence βtitleβ, βcolorβ, and βdescriptionβ auto-generation requests, the ID of the sequence to summarize. |
integer | null | Β | Β | π | Β | Β |
POST /api/ai
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/ai'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
payload = {
'prompt': 'write code',
'context_key': 'lua',
'sequence_id': None,
}
response = requests.post(url, headers=headers, json=payload, stream=True)
for line in response.iter_lines():
print(line.decode('utf-8'))
output:
```lua
-- Move FarmBot to the home position for all axes
go_to_home("all")
```
ai_feedbacks
Used for Lua code generation.
| Method | Description |
|---|---|
POST /api/ai_feedbacks |
Submit auto-generation feedback. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | Β | Β | Β | Β | Β |
created_atDate and time of creation set by the database. |
timestamp | Β | Β | Β | Β | Β |
updated_atDate and time of most recent update set by the database. |
timestamp | Β | Β | Β | Β | Β |
promptA copy of the instructions for the auto-generation request. |
string | Β | Β | π | Β | Β |
reactionThe feedback for the outcome of the prompt. |
βgoodβ | βbadβ | Β | Β | π | Β | Β |
POST /api/ai_feedbacks
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/ai_feedbacks'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
payload = {
'prompt': 'write code',
'reaction': 'good',
}
response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_post('ai_feedbacks', {'prompt': 'write code', 'reaction': 'good'})
output:
{
"id": 1,
"created_at": "2024-04-10T17:53:37.120Z",
"updated_at": "2024-04-10T17:53:37.120Z",
"prompt": "write code",
"reaction": "good"
}
alerts
Used by the message center.
| Method | Description |
|---|---|
GET /api/alerts |
Get an array of all alerts. |
DELETE /api/alerts/:id |
Delete a single alert by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
problem_tagType of alert. |
βapi.seed_data.missingβ | βapi.documentation.unreadβ | βapi.tour.not_takenβ | βapi.user.not_welcomedβ | βapi.bulletin.unreadβ | βapi.demo_account.in_useβ | π | Β | Β | Β | π |
slugDefaults to random UUID. |
string | π | Β | Β | Β | π |
priorityImportance for sorting. |
integer | π | Β | Β | Β | π |
GET /api/alerts
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/alerts'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('alerts')
output:
[
{
"id": 1,
"created_at": 1643843681,
"updated_at": "2022-02-02T23:14:41.694Z",
"priority": 100,
"problem_tag": "api.seed_data.missing",
"slug": "fc07c4d5-aba0-4782-8c71-e443f88430e9"
}
]
DELETE /api/alerts/1
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/alerts/1'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.delete(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_delete('alerts', 1)
output:
{
"id": 1,
"created_at": 1643843681,
"updated_at": "2022-02-02T23:14:41.694Z",
"priority": 100,
"problem_tag": "api.seed_data.missing",
"slug": "fc07c4d5-aba0-4782-8c71-e443f88430e9"
}
corpus
| Method | Description |
|---|---|
GET /api/corpus |
Get the corpus object. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
| corpus Celery Script corpus. |
object | π | Β | Β | Β | Β |
GET /api/corpus
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/corpus'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('corpus')
output:
{
"version": 20180209,
"enums": [
{
...
curves
See curves.
| Method | Description |
|---|---|
GET /api/curves |
Get an array of all curves. |
GET /api/curves/:id |
Get a single curve by id. |
POST /api/curves |
Create a new curve. |
PATCH /api/curves/:id |
Edit a single curve by id. |
DELETE /api/curves/:id |
Delete a single curve by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
nameCurve name. |
string | π | π | π (required) |
π | π |
typeCurve type. |
βwaterβ | βspreadβ | βheightβ | π | π | π (required) |
π | π |
dataCurve data. |
{[day: string]: value: integer} | π | π | π (required) |
π | π |
POST /api/curves
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/curves'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
payload = {
'name': 'Curve 1',
'type': 'water',
'data': {
'1': 1,
'100': 100
}
}
response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_post('curves', {
'name': 'Curve 1',
'type': 'water',
'data': {
'1': 1,
'100': 100
}
})
output:
{
"id": 1,
"created_at": "2024-04-10T18:10:42.429Z",
"updated_at": "2024-04-10T18:10:42.429Z",
"name": "Curve 1",
"type": "water",
"data": {
"1": 1,
"100": 100
}
}
demo_account
Used for demo.farm.bot.
| Method | Description |
|---|---|
POST /api/demo_account |
Create a new demo account. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
secretPassword. |
string | Β | Β | π | Β | Β |
product_lineFarmBot model. |
βexpress_1.0β | βexpress_1.1β | βexpress_1.2β | βexpress_xl_1.0β | βexpress_xl_1.1β | βexpress_xl_1.2β | βgenesis_1.2β | βgenesis_1.3β | βgenesis_1.4β | βgenesis_1.5β | βgenesis_1.6β | βgenesis_1.7β | βgenesis_xl_1.4β | βgenesis_xl_1.5β | βgenesis_xl_1.6β | βgenesis_xl_1.7β | βnoneβ | Β | Β | π | Β | Β |
POST /api/demo_account
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/demo_account'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
payload = {
'secret': 'password',
'product_line': 'genesis_1.7',
}
response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_post('demo_account', {
'secret': 'password',
'product_line': 'genesis_1.7',
})
output:
{}
device
See FarmBot settings.
| Method | Description |
|---|---|
GET /api/device |
Get the device object. |
PATCH /api/device |
Edit the device object. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | Β |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | Β |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | Β |
fb_order_numberOrder number. |
string | null | π | Β | Β | π | Β |
fbos_versionFarmBot OS version. |
string | π | Β | Β | Β | Β |
indoorIs your FarmBot indoors? |
boolean | π | Β | Β | π | Β |
last_saw_apiDatetime of last API visit. |
timestamp | π | Β | Β | Β | Β |
latLatitude. |
float | π | Β | Β | π | Β |
lngLongitude. |
float | π | Β | Β | π | Β |
mounted_tool_idThe ID of the tool currently attached to the UTM. |
integer | π | Β | Β | π | Β |
nameFarmBot name. |
string | π | Β | Β | π | Β |
ota_hourOver-the-air update local time. |
0-23 | null | π | Β | Β | π | Β |
ota_hour_utcOver-the-air update UTC time. |
0-23 | null | π | Β | Β | Β | Β |
rpiFarmBot computer model. |
β3β | β4β | β01β | β02β | π | Β | Β | π | Β |
serial_numberFarmBot serial number. |
string | π | Β | Β | Β | Β |
setup_completed_atDatetime device setup completed. |
timestamp | π | Β | Β | π | Β |
throttled_atDatetime device throttle begin. |
timestamp | π | Β | Β | Β | Β |
throttled_untilDatetime device throttle end. |
timestamp | π | Β | Β | Β | Β |
timezoneTimezone. |
string | π | Β | Β | π | Β |
max_log_age_in_daysLogs deleted after __ days. |
integer | π | Β | Β | Β | Β |
max_sequence_countMaximum number of allowed sequences. |
integer | π | Β | Β | Β | Β |
max_sequence_lengthMaximum allowed sequence length. |
integer | π | Β | Β | Β | Β |
tz_offset_hrsHours offset from UTC. |
integer | π | Β | Β | Β | Β |
GET /api/device
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/device'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('device')
output:
{
"id": 29,
"created_at": "2022-02-02T23:14:15.261Z",
"updated_at": "2022-02-02T23:14:15.261Z",
"fb_order_number": null,
"fbos_version": "17.0.0",
"indoor": false,
"last_saw_api": null,
"lat": null,
"lng": null,
"mounted_tool_id": null,
"name": "Okra",
"ota_hour_utc": 6,
"ota_hour": 3,
"rpi": null,
"serial_number": "0827898855f3f79e81037a4f3a119b00",
"setup_completed_at": null,
"throttled_at": null,
"throttled_until": null,
"timezone": "W-SU",
"max_log_age_in_days": 0,
"max_sequence_count": 0,
"max_sequence_length": 0,
"tz_offset_hrs": 3
}
device/reset
| Method | Description |
|---|---|
POST /api/device/reset |
Reset the device. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
passwordAccount password. |
string | Β | Β | π (required) |
Β | Β |
device/seed
| Method | Description |
|---|---|
POST /api/device/seed |
Seed the device with standard resources. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
product_lineFarmBot model. |
βexpress_1.0β | βexpress_1.1β | βexpress_1.2β | βexpress_xl_1.0β | βexpress_xl_1.1β | βexpress_xl_1.2β | βgenesis_1.2β | βgenesis_1.3β | βgenesis_1.4β | βgenesis_1.5β | βgenesis_1.6β | βgenesis_1.7β | βgenesis_xl_1.4β | βgenesis_xl_1.5β | βgenesis_xl_1.6β | βgenesis_xl_1.7β | βnoneβ | Β | Β | π (required) |
Β | Β |
demoSeed a demo account. |
boolean | Β | Β | π | Β | Β |
device/sync
| Method | Description |
|---|---|
GET /api/device/sync |
Get the sync object. |
export_data
| Method | Description |
|---|---|
POST /api/export_data |
Request account data export. |
POST /api/export_data
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/export_data'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.post(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_post('export_data')
output:
{
"export_created_at": "2022-02-02T23:14:25.688+00:00",
"server_url": "//192.168.1.112:3000",
"database_schema": 20211206165259,
"tools": [
],
"device": {
"id": 95,
"created_at": "2022-02-02T23:14:25.664Z",
"updated_at": "2022-02-02T23:14:25.664Z",
"fb_order_number": null,
...
farm_events
See events.
| Method | Description |
|---|---|
GET /api/farm_events |
Get an array of all farm events. |
GET /api/farm_events/:id |
Get a single farm event by id. |
POST /api/farm_events |
Create a new farm event. |
PATCH /api/farm_events/:id |
Edit a single farm event by id. |
DELETE /api/farm_events/:id |
Delete a single farm event by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
start_timeDate and time to begin the farm event. |
timestamp | π | π | π | π | π |
end_timeDate and time to end the farm event. |
timestamp | π | π | π | π | π |
repeatNumber of times to repeat the farm event. |
integer | π | π | π (required) |
π | π |
time_unitTime period for repeat. |
βneverβ | βminutelyβ | βhourlyβ | βdailyβ | βweeklyβ | βmonthlyβ | βyearlyβ | π | π | π (required) |
π | π |
executable_idThe ID of the sequence or regimen to execute. |
integer | π | π | π | π | π |
executable_typeThe type of resource to execute. |
βSequenceβ | βRegimenβ | π | π | π | π | π |
bodyVariable data. |
Array | π | π | π | π | π |
GET /api/farm_events
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/farm_events'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('farm_events')
output:
[
{
"id": 24,
"created_at": "2022-02-02T23:14:47.297Z",
"updated_at": "2022-02-02T23:14:47.300Z",
"start_time": "2022-02-03T00:14:12.982Z",
"end_time": "2022-02-03T00:15:12.982Z",
"repeat": 1,
"time_unit": "never",
"executable_id": 13,
"executable_type": "Regimen",
"body": [
{
"kind": "parameter_application",
"args": {
"label": "variable",
"data_value": {
"kind": "tool",
"args": {
"tool_id": 235
}
}
}
}
]
}
]
farmware_envs
See custom settings.
| Method | Description |
|---|---|
GET /api/farmware_envs |
Get an array of all envs. |
GET /api/farmware_envs/:id |
Get a single env by id. |
POST /api/farmware_envs |
Create a new env. |
PATCH /api/farmware_envs/:id |
Edit a single env by id. |
DELETE /api/farmware_envs/:id |
Delete a single env by id. |
DELETE /api/farmware_envs/all |
Delete all envs. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
device_idUnique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
keyEnvironment variable label. |
string | π | π | π (required) |
π | π |
valueEnvironment variable value. |
string | π | π | π (required) |
π | π |
GET /api/farmware_envs
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/farmware_envs'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('farmware_envs')
output:
[
{
"id": 11,
"device_id": 295,
"key": "camera",
"value": "USB",
"created_at": "2022-02-02T23:14:50.641Z",
"updated_at": "2022-02-02T23:14:50.641Z"
}
]
fbos_config
See FarmBot settings.
| Method | Description |
|---|---|
GET /api/fbos_config |
Get the FarmBot OS configuration object. |
PATCH /api/fbos_config |
Edit the FarmBot OS configuration object. |
DELETE /api/fbos_config |
Delete the FarmBot OS configuration object. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
device_idUnique device identifier set by the database. |
integer | π | Β | Β | Β | π |
disable_factory_resetUnused. |
boolean | π | Β | Β | π | π |
firmware_input_logUnused. |
boolean | π | Β | Β | π | π |
firmware_output_logUnused. |
boolean | π | Β | Β | π | π |
sequence_body_logSend a log message for each sequence step executed. |
boolean | π | Β | Β | π | π |
sequence_complete_logSend a log message upon the end of sequence execution. |
boolean | π | Β | Β | π | π |
sequence_init_logSend a log message upon the start of sequence execution. |
boolean | π | Β | Β | π | π |
network_not_found_timerUnused. |
integer | π | Β | Β | π | π |
firmware_hardwareFirmware installed on the Farmduino or microcontroller. |
βarduinoβ | βfarmduinoβ | βfarmduino_k14β | βfarmduino_k15β | βfarmduino_k16β | βfarmduino_k17β | βexpress_k10β | βexpress_k11β | βexpress_k12β | π | Β | Β | π | π |
os_auto_updateAutomatically download and install FarmBot OS over-the-air (OTA) updates. |
boolean | π | Β | Β | π | π |
arduino_debug_messagesUnused. |
boolean | π | Β | Β | π | π |
firmware_pathFarmBot OS system path to the microcontroller. |
βttyUSB0β | βttyACM0β | βttyAMA0β | string | π | Β | Β | π | π |
firmware_debug_logUnused. |
boolean | π | Β | Β | π | π |
update_channelFarmBot OS OTA update channel. |
βstableβ | βbetaβ | βalphaβ | π | Β | Β | π | π |
boot_sequence_idID of sequence to run upon boot-up. |
integer | π | Β | Β | π | π |
safe_heightZ axis coordinate (millimeters) to which the z axis should be retracted during Safe Z moves. |
integer | π | Β | Β | π | π |
soil_heightZ axis coordinate (millimeters) of soil level. This value will only be used if there are no soil height measurements available. |
integer | π | Β | Β | π | π |
gantry_heightThe distance in millimeters between the bottom of FarmBotβs tool head and the bottom of the gantry main beam when the Z-axis is fully raised. |
integer | π | Β | Β | π | π |
GET /api/fbos_config
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/fbos_config'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('fbos_config')
output:
{
"id": 43,
"created_at": "2022-02-02T23:15:36.629Z",
"updated_at": "2022-02-02T23:15:36.629Z",
"device_id": 447,
"disable_factory_reset": true,
"firmware_input_log": false,
"firmware_output_log": false,
"sequence_body_log": false,
"sequence_complete_log": false,
"sequence_init_log": false,
"network_not_found_timer": null,
"firmware_hardware": null,
"os_auto_update": true,
"arduino_debug_messages": false,
"firmware_path": null,
"firmware_debug_log": false,
"update_channel": "stable",
"boot_sequence_id": null,
"safe_height": 0,
"soil_height": 0,
"gantry_height": 0
}
featured_sequences
See featured sequences list and docs.
| Method | Description |
|---|---|
GET /api/featured_sequences |
Get an array of all featured sequences. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | Β |
pathRelative link to shared sequence page in the app. |
string | π | Β | Β | Β | Β |
nameSequence name. |
string | π | Β | Β | Β | Β |
descriptionSequence description. |
string | π | Β | Β | Β | Β |
colorSequence color. |
string | π | Β | Β | Β | Β |
GET /api/featured_sequences
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/featured_sequences'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('featured_sequences')
output:
[
{
"id": 15,
"path": "/app/shared/sequence/15",
"name": "Down-sized intangible moratorium",
"description": "foo,bar,baz",
"color": "red"
}
]
feedback
Used by help and the setup wizard.
| Method | Description |
|---|---|
POST /api/feedback |
Submit feedback. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
messageFeedback content. |
string | Β | Β | π | Β | Β |
slugSource of feedback. |
string | Β | Β | π | Β | Β |
POST /api/feedback
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/feedback'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
payload = {
'message': 'feedback',
'slug': 'intro',
}
response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_post('feedback', {
'message': 'feedback',
'slug': 'intro',
})
output:
{}
firmware_config
Used by settings.
| Method | Description |
|---|---|
GET /api/firmware_config |
Get the firmware config object. |
PATCH /api/firmware_config |
Edit the firmware configuration object. |
DELETE /api/firmware_config |
Delete the firmware configuration object. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | π |
device_idUnique device identifier set by the database. |
integer | π | Β | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
encoder_enabled_xEnable encoders or stall detection for the x axis. |
0 | 1 | π | Β | Β | π | π |
encoder_enabled_yEnable encoders or stall detection for the y axis. |
0 | 1 | π | Β | Β | π | π |
encoder_enabled_zEnable encoders or stall detection for the z axis. |
0 | 1 | π | Β | Β | π | π |
encoder_invert_xInvert the encoders on the x axis. |
0 | 1 | π | Β | Β | π | π |
encoder_invert_yInvert the encoders on the y axis. |
0 | 1 | π | Β | Β | π | π |
encoder_invert_zInvert the encoders on the z axis. |
0 | 1 | π | Β | Β | π | π |
encoder_missed_steps_decay_xReduction to missed step total for every good step for the x axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_decay_yReduction to missed step total for every good step for the y axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_decay_zReduction to missed step total for every good step for the z axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_max_xNumber of steps before the motor is considered to have stalled for the x axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_max_yNumber of steps before the motor is considered to have stalled for the y axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_max_zNumber of steps before the motor is considered to have stalled for the z axis. |
integer | π | Β | Β | π | π |
encoder_scaling_x10000 * (motor resolution) / (encoder resolution). |
integer | π | Β | Β | π | π |
encoder_scaling_y10000 * (motor resolution) / (encoder resolution). |
integer | π | Β | Β | π | π |
encoder_scaling_z10000 * (motor resolution) / (encoder resolution). |
integer | π | Β | Β | π | π |
encoder_type_x.Unused |
0 | 1 | π | Β | Β | π | π |
encoder_type_y.Unused |
0 | 1 | π | Β | Β | π | π |
encoder_type_z.Unused |
0 | 1 | π | Β | Β | π | π |
encoder_use_for_pos_x.Use the encoders for calculating movements on the x axis. |
0 | 1 | π | Β | Β | π | π |
encoder_use_for_pos_y.Use the encoders for calculating movements on the y axis. |
0 | 1 | π | Β | Β | π | π |
encoder_use_for_pos_z.Use the encoders for calculating movements on the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_axis_nr_steps_xX axis length in steps. |
integer | π | Β | Β | π | π |
movement_axis_nr_steps_yY axis length in steps. |
integer | π | Β | Β | π | π |
movement_axis_nr_steps_zZ axis length in steps. |
integer | π | Β | Β | π | π |
movement_enable_endpoints_xEnable endstops for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_enable_endpoints_yEnable endstops for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_enable_endpoints_zEnable endstops for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_at_boot_xFind home upon startup for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_at_boot_yFind home upon startup for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_at_boot_zFind home upon startup for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_spd_xX axis homing speed in steps per second. |
integer | π | Β | Β | π | π |
movement_home_spd_yY axis homing speed in steps per second. |
integer | π | Β | Β | π | π |
movement_home_spd_zZ axis homing speed in steps per second. |
integer | π | Β | Β | π | π |
movement_home_up_xRestrict travel to negative coordinate locations for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_up_yRestrict travel to negative coordinate locations for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_up_zRestrict travel to negative coordinate locations for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_endpoints_xSwap the min and max limit switches for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_endpoints_ySwap the min and max limit switches for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_endpoints_zSwap the min and max limit switches for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_motor_xInvert motor direction for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_motor_yInvert motor direction for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_motor_zInvert motor direction for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_keep_active_xAlways power motors on the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_keep_active_yAlways power motors on the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_keep_active_zAlways power motors on the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_max_spd_xMax speed in steps per second for the x axis. |
integer | π | Β | Β | π | π |
movement_max_spd_yMax speed in steps per second for the y axis. |
integer | π | Β | Β | π | π |
movement_max_spd_zMax speed in steps per second for the z axis. |
integer | π | Β | Β | π | π |
movement_min_spd_xMinimum speed in steps per second for the x axis. |
integer | π | Β | Β | π | π |
movement_min_spd_yMinimum speed in steps per second for the y axis. |
integer | π | Β | Β | π | π |
movement_min_spd_zMinimum speed in steps per second for the z axis. |
integer | π | Β | Β | π | π |
movement_secondary_motor_invert_xInvert the direction of the 2nd x axis motor. |
0 | 1 | π | Β | Β | π | π |
movement_secondary_motor_xEnable the 2nd x axis motor. |
0 | 1 | π | Β | Β | π | π |
movement_step_per_mm_xNumber of steps per millimeter on the x axis. |
integer | π | Β | Β | π | π |
movement_step_per_mm_yNumber of steps per millimeter on the y axis. |
integer | π | Β | Β | π | π |
movement_step_per_mm_zNumber of steps per millimeter on the z axis. |
integer | π | Β | Β | π | π |
movement_steps_acc_dec_xNumber of steps used to accelerate for the x axis. |
integer | π | Β | Β | π | π |
movement_steps_acc_dec_yNumber of steps used to accelerate for the y axis. |
integer | π | Β | Β | π | π |
movement_steps_acc_dec_zNumber of steps used to accelerate for the z axis. |
integer | π | Β | Β | π | π |
movement_stop_at_home_xEnable stop at home for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_home_yEnable stop at home for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_home_zEnable stop at home for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_max_xEnable stop at max for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_max_yEnable stop at max for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_max_zEnable stop at max for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_timeout_xAmount of time to wait for a command to execute before stopping in seconds for the x axis. |
integer | π | Β | Β | π | π |
movement_timeout_yAmount of time to wait for a command to execute before stopping in seconds for the y axis. |
integer | π | Β | Β | π | π |
movement_timeout_zAmount of time to wait for a command to execute before stopping in seconds for the z axis. |
integer | π | Β | Β | π | π |
param_config_okUnused. |
integer | π | Β | Β | π | π |
param_e_stop_on_mov_errE-Stop upon movement error. |
0 | 1 | π | Β | Β | π | π |
param_mov_nr_retryNumber of times to retry a movement. |
integer | π | Β | Β | π | π |
param_testUnused. |
integer | π | Β | Β | π | π |
param_use_eepromUnused. |
0 | 1 | π | Β | Β | π | π |
param_versionUnused. |
integer | π | Β | Β | π | π |
pin_guard_1_active_statePin guard 1 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_1_pin_nrPin guard 1 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_1_time_outPin guard 1 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
pin_guard_2_active_statePin guard 2 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_2_pin_nrPin guard 2 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_2_time_outPin guard 2 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
pin_guard_3_active_statePin guard 3 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_3_pin_nrPin guard 3 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_3_time_outPin guard 3 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
pin_guard_4_active_statePin guard 4 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_4_pin_nrPin guard 4 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_4_time_outPin guard 4 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
pin_guard_5_active_statePin guard 5 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_5_pin_nrPin guard 5 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_5_time_outPin guard 5 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
movement_invert_2_endpoints_xEnable for normally closed (NC), disable for normally open (NO). |
0 | 1 | π | Β | Β | π | π |
movement_invert_2_endpoints_yEnable for normally closed (NC), disable for normally open (NO). |
0 | 1 | π | Β | Β | π | π |
movement_invert_2_endpoints_zEnable for normally closed (NC), disable for normally open (NO). |
0 | 1 | π | Β | Β | π | π |
movement_microsteps_xNumber of microsteps per step on the x axis. |
integer | π | Β | Β | π | π |
movement_microsteps_yNumber of microsteps per step on the y axis. |
integer | π | Β | Β | π | π |
movement_microsteps_zNumber of microsteps per step on the z axis. |
integer | π | Β | Β | π | π |
movement_motor_current_xMotor current on the x axis. |
0-1823 | π | Β | Β | π | π |
movement_motor_current_yMotor current on the y axis. |
0-1823 | π | Β | Β | π | π |
movement_motor_current_zMotor current on the z axis. |
0-1823 | π | Β | Β | π | π |
movement_stall_sensitivity_xStall sensitivity on the x axis. Lower is more sensitive. |
-63-63 | π | Β | Β | π | π |
movement_stall_sensitivity_yStall sensitivity on the y axis. Lower is more sensitive. |
-63-63 | π | Β | Β | π | π |
movement_stall_sensitivity_zStall sensitivity on the z axis. Lower is more sensitive. |
-63-63 | π | Β | Β | π | π |
movement_min_spd_z2Min speed in steps per second for z axis movements towards home. |
integer | π | Β | Β | π | π |
movement_max_spd_z2Maximum speed in steps per second for z axis movements towards home. |
integer | π | Β | Β | π | π |
movement_steps_acc_dec_z2Number of steps used for acceleration for z axis movements towards home. |
integer | π | Β | Β | π | π |
movement_calibration_retry_xNumber of times to retry calibration for the x axis. |
integer | π | Β | Β | π | π |
movement_calibration_retry_yNumber of times to retry calibration for the y axis. |
integer | π | Β | Β | π | π |
movement_calibration_retry_zNumber of times to retry calibration for the z axis. |
integer | π | Β | Β | π | π |
movement_calibration_deadzone_xDistance in steps to group calibration retries for the x axis. |
integer | π | Β | Β | π | π |
movement_calibration_deadzone_yDistance in steps to group calibration retries for the y axis. |
integer | π | Β | Β | π | π |
movement_calibration_deadzone_zDistance in steps to group calibration retries for the z axis. |
integer | π | Β | Β | π | π |
movement_axis_stealth_xEnable quiet mode for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_axis_stealth_yEnable quiet mode for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_axis_stealth_zEnable quiet mode for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_calibration_retry_total_xTotal number of times to retry calibration for the x axis. |
integer | π | Β | Β | π | π |
movement_calibration_retry_total_yTotal number of times to retry calibration for the y axis. |
integer | π | Β | Β | π | π |
movement_calibration_retry_total_zTotal number of times to retry calibration for the z axis. |
integer | π | Β | Β | π | π |
pin_report_1_pin_nrReport values of the pin periodically. |
0-69 | π | Β | Β | π | π |
pin_report_2_pin_nrReport values of the pin periodically. |
0-69 | π | Β | Β | π | π |
GET /api/firmware_config
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/firmware_config'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('firmware_config')
output:
{
"id": 7,
"created_at": "2022-02-02T23:14:50.199Z",
"updated_at": "2022-02-02T23:14:50.199Z",
"device_id": 287,
"encoder_enabled_x": 1,
"encoder_enabled_y": 1,
"encoder_enabled_z": 1,
"encoder_invert_x": 0,
"encoder_invert_y": 0,
"encoder_invert_z": 0,
"encoder_missed_steps_decay_x": 5,
"encoder_missed_steps_decay_y": 5,
"encoder_missed_steps_decay_z": 5,
"encoder_missed_steps_max_x": 5,
"encoder_missed_steps_max_y": 5,
"encoder_missed_steps_max_z": 5,
"encoder_scaling_x": 5556,
"encoder_scaling_y": 5556,
"encoder_scaling_z": 5556,
"encoder_type_x": 0,
"encoder_type_y": 0,
"encoder_type_z": 0,
"encoder_use_for_pos_x": 0,
"encoder_use_for_pos_y": 0,
"encoder_use_for_pos_z": 0,
"movement_axis_nr_steps_x": 0,
"movement_axis_nr_steps_y": 0,
"movement_axis_nr_steps_z": 0,
"movement_enable_endpoints_x": 0,
"movement_enable_endpoints_y": 0,
"movement_enable_endpoints_z": 0,
"movement_home_at_boot_x": 0,
"movement_home_at_boot_y": 0,
"movement_home_at_boot_z": 0,
"movement_home_spd_x": 400,
"movement_home_spd_y": 400,
"movement_home_spd_z": 400,
"movement_home_up_x": 0,
"movement_home_up_y": 0,
"movement_home_up_z": 1,
"movement_invert_endpoints_x": 0,
"movement_invert_endpoints_y": 0,
"movement_invert_endpoints_z": 0,
"movement_invert_motor_x": 0,
"movement_invert_motor_y": 0,
"movement_invert_motor_z": 0,
"movement_keep_active_x": 0,
"movement_keep_active_y": 0,
"movement_keep_active_z": 1,
"movement_max_spd_x": 400,
"movement_max_spd_y": 400,
"movement_max_spd_z": 400,
"movement_min_spd_x": 50,
"movement_min_spd_y": 50,
"movement_min_spd_z": 50,
"movement_secondary_motor_invert_x": 1,
"movement_secondary_motor_x": 1,
"movement_step_per_mm_x": 5.0,
"movement_step_per_mm_y": 5.0,
"movement_step_per_mm_z": 25.0,
"movement_steps_acc_dec_x": 300,
"movement_steps_acc_dec_y": 300,
"movement_steps_acc_dec_z": 300,
"movement_stop_at_home_x": 1,
"movement_stop_at_home_y": 1,
"movement_stop_at_home_z": 1,
"movement_stop_at_max_x": 1,
"movement_stop_at_max_y": 1,
"movement_stop_at_max_z": 1,
"movement_timeout_x": 180,
"movement_timeout_y": 180,
"movement_timeout_z": 180,
"param_config_ok": 0,
"param_e_stop_on_mov_err": 0,
"param_mov_nr_retry": 3,
"param_test": 0,
"param_use_eeprom": 1,
"param_version": 1,
"pin_guard_1_active_state": 1,
"pin_guard_1_pin_nr": 0,
"pin_guard_1_time_out": 60,
"pin_guard_2_active_state": 1,
"pin_guard_2_pin_nr": 0,
"pin_guard_2_time_out": 60,
"pin_guard_3_active_state": 1,
"pin_guard_3_pin_nr": 0,
"pin_guard_3_time_out": 60,
"pin_guard_4_active_state": 1,
"pin_guard_4_pin_nr": 0,
"pin_guard_4_time_out": 60,
"pin_guard_5_active_state": 1,
"pin_guard_5_pin_nr": 0,
"pin_guard_5_time_out": 60,
"movement_invert_2_endpoints_x": 0,
"movement_invert_2_endpoints_y": 0,
"movement_invert_2_endpoints_z": 0,
"movement_microsteps_x": 1,
"movement_microsteps_y": 1,
"movement_microsteps_z": 1,
"movement_motor_current_x": 1823,
"movement_motor_current_y": 1823,
"movement_motor_current_z": 1823,
"movement_stall_sensitivity_x": 63,
"movement_stall_sensitivity_y": 63,
"movement_stall_sensitivity_z": 63,
"movement_min_spd_z2": 50,
"movement_max_spd_z2": 400,
"movement_steps_acc_dec_z2": 300,
"movement_calibration_retry_x": 1,
"movement_calibration_retry_y": 1,
"movement_calibration_retry_z": 1,
"movement_calibration_deadzone_x": 50,
"movement_calibration_deadzone_y": 50,
"movement_calibration_deadzone_z": 250,
"movement_axis_stealth_x": 1,
"movement_axis_stealth_y": 1,
"movement_axis_stealth_z": 1,
"movement_calibration_retry_total_x": 10,
"movement_calibration_retry_total_y": 10,
"movement_calibration_retry_total_z": 10,
"pin_report_1_pin_nr": 0,
"pin_report_2_pin_nr": 0
}
folders
Used by sequences.
| Method | Description |
|---|---|
GET /api/folders |
Get an array of all folders. |
GET /api/folders/:id |
Get a single folder by id. |
POST /api/folders |
Create a new folder. |
PATCH /api/folders/:id |
Edit a single folder by id. |
DELETE /api/folders/:id |
Delete a single folder by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
parent_idID of the parent folder, if any. |
integer | null | π | π | π | π (required) |
π |
nameFolder name. |
string | π | π | π (required) |
π | π |
colorFolder color. |
string | π | π | π (required) |
π | π |
GET /api/folders
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/folders'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('folders')
output:
[
{
"id": 18,
"created_at": "2022-02-02T23:15:35.665Z",
"updated_at": "2022-02-02T23:15:35.665Z",
"parent_id": null,
"color": "red",
"name": "parent"
}
]
global_bulletins
Used by the message center. To create a bulletin, see posting to the message center.
| Method | Description |
|---|---|
GET /api/global_bulletins/:slug |
Get a single bulletin by slug. |
| Field | Type | GET |
GET/:slug |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | Β | π | Β | Β | Β |
created_atDate and time of creation set by the database. |
timestamp | Β | π | Β | Β | Β |
updated_atDate and time of most recent update set by the database. |
timestamp | Β | π | Β | Β | Β |
hrefLink. |
string | Β | π | Β | Β | Β |
href_labelLabel for link button. |
string | Β | π | Β | Β | Β |
slugUUID. |
string | Β | π | Β | Β | Β |
titleBulletin title. |
string | Β | π | Β | Β | Β |
typeBulletin type. |
βinfoβ | βsuccessβ | βwarnβ | Β | π | Β | Β | Β |
contentBulletin content. |
string | Β | π | Β | Β | Β |
GET /api/global_bulletins/:slug
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/global_bulletins/Okra'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('global_bulletins/Okra')
output:
{
"id": 1,
"created_at": "2022-02-02T23:15:35.750Z",
"updated_at": "2022-02-02T23:15:35.750Z",
"href": "https://farm.bot/blogs/news/pre-order-farmbot-genesis-xl-v1-5",
"href_label": "Click here!",
"slug": "Okra",
"title": null,
"type": "info",
"content": "we're now accepting pre-orders for Genesis XL v1.5!"
}
global_config
| Method | Description |
|---|---|
GET /api/global_config |
Get the global config object. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
FBOS_END_OF_LIFE_VERSIONFarmBot OS version to give end-of-life warning. |
string | π | Β | Β | Β | Β |
MINIMUM_FBOS_VERSIONOldest FarmBot OS version allowed to connect. |
string | π | Β | Β | Β | Β |
TOS_URLTerms of service URL. |
string | π | Β | Β | Β | Β |
PRIV_URLPrivacy policy URL. |
string | π | Β | Β | Β | Β |
NODE_ENVNode environment. |
βdevelopmentβ | βproductionβ | βtestβ | π | Β | Β | Β | Β |
LONG_REVISIONHash of the current Web App GitHub commit. |
string | π | Β | Β | Β | Β |
SHORT_REVISIONFirst 8 characters of the current Web App GitHub commit hash. |
string | π | Β | Β | Β | Β |
MQTT_WSMQTT websocket URL. |
string | π | Β | Β | Β | Β |
| any Any config set by the server. |
string | π | Β | Β | Β | Β |
GET /api/global_config
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/global_config'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('global_config')
output:
{
"FBOS_END_OF_LIFE_VERSION": "14.6.0",
"MINIMUM_FBOS_VERSION": "14.6.0",
"TOS_URL": "",
"PRIV_URL": "",
"NODE_ENV": "production",
"LONG_REVISION": "c4d419354435be1938a45294666ff8eb5bc61b27",
"SHORT_REVISION": "c4d41935",
"MQTT_WS": "wss://abc-def.rmq.cloudamqp.com:443/ws/mqtt",
"SOME_OTHER_CONFIG": "value"
}
images
Used for photos.
| Method | Description |
|---|---|
GET /api/images |
Get an array of all images. |
GET /api/images/:id |
Get a single image by id. |
POST /api/images |
Create a new image. |
DELETE /api/images/:id |
Delete a single image by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
device_idUnique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
attachment_processed_atDate and time when image was processed. |
timestamp | π | π | π | Β | π |
attachment_urlImage URL. |
string | π | π | π (required) |
Β | π |
metaImage info. |
{name: string, x: float, y: float, z: float} | π | π | π | Β | π |
GET /api/images
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/images'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('images')
output:
[
{
"id": 10,
"created_at": "2022-02-02T23:15:48.541Z",
"updated_at": "2022-02-02T23:15:48.541Z",
"device_id": 570,
"attachment_processed_at": null,
"attachment_url": "http://192.168.1.112:3000/placeholder_farmbot.jpg?text=Processing...",
"meta": {
"x": 1,
"y": 2,
"z": 3
}
}
]
logs
Used for logs.
| Method | Description |
|---|---|
GET /api/logs |
Get an array of all logs. |
POST /api/logs |
Create a new log. |
DELETE /api/logs/:id |
Delete a single log by id. |
DELETE /api/logs/all |
Delete all logs. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
channelsArray of transmission channels. |
(βtickerβ | βtoastβ | βemailβ | βespeakβ)[] | π | Β | π | Β | π |
messageLog message. |
string | π | Β | π (required) |
Β | π |
metaUnused. |
null | π | Β | π | Β | π |
major_versionFarmBot OS major version. |
string | π | Β | π | Β | π |
minor_versionFarmBot OS minor version. |
string | π | Β | π | Β | π |
patch_versionFarmBot OS patch version. |
string | π | Β | π | Β | π |
typeLog type. |
βassertionβ | βbusyβ | βdebugβ | βerrorβ | βfunβ | βinfoβ | βsuccessβ | βwarnβ | π | Β | π | Β | π |
verbosityLog level. |
0-3 | π | Β | π | Β | π |
xx coordinate at time of log. |
float | π | Β | π | Β | π |
yy coordinate at time of log. |
float | π | Β | π | Β | π |
zz coordinate at time of log. |
float | π | Β | π | Β | π |
GET /api/logs
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/logs'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('logs')
output:
[
{
"id": 13,
"created_at": 1643843034,
"updated_at": "2022-02-02T23:14:54.423Z",
"channels": [
"toast"
],
"message": "extend global convergence",
"meta": null,
"major_version": null,
"minor_version": null,
"patch_version": null,
"type": "success",
"verbosity": 1,
"x": -458.0,
"y": -12.0,
"z": 765.0
}
]
POST /api/logs
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/logs'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
payload = {
'message': 'Hello World!',
'type': 'success',
'channels': ['toast'],
}
response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_post('logs', {
'message': 'Hello World!',
'type': 'success',
'channels': ['toast'],
})
output:
{
"id": 1234567,
"created_at": 1643843034,
"updated_at": "2022-02-02T23:14:54.423Z",
"channels": [
"toast"
],
"message": "Hello World!",
"meta": null,
"major_version": null,
"minor_version": null,
"patch_version": null,
"type": "success",
"verbosity": 1,
"x": null,
"y": null,
"z": null
}
logs/search
| Method | Description |
|---|---|
GET /api/logs/search |
Get a list of filtered logs. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
messageLog message. |
string | π | Β | Β | Β | Β |
typeLog type. |
βassertionβ | βbusyβ | βdebugβ | βerrorβ | βfunβ | βinfoβ | βsuccessβ | βwarnβ | π | Β | Β | Β | Β |
verbosityLog level. |
0-3 | π | Β | Β | Β | Β |
xx coordinate at time of log. |
float | π | Β | Β | Β | Β |
yy coordinate at time of log. |
float | π | Β | Β | Β | Β |
zz coordinate at time of log. |
float | π | Β | Β | Β | Β |
password_resets
request
| Method | Description |
|---|---|
POST /api/password_resets |
Request a password reset. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
emailAccount email address. |
string | Β | Β | π (required) |
Β | Β |
change
| Method | Description |
|---|---|
PATCH /api/password_resets |
Change the account password. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
passwordNew account password. |
string | Β | Β | Β | π (required) |
Β |
password_confirmationNew account password. |
string | Β | Β | Β | π (required) |
Β |
idToken. |
string | Β | Β | Β | π (required) |
Β |
peripherals
Used by peripherals.
| Method | Description |
|---|---|
GET /api/peripherals |
Get an array of all peripherals. |
GET /api/peripherals/:id |
Get a single peripheral by id. |
POST /api/peripherals |
Create a new peripheral. |
PATCH /api/peripherals/:id |
Edit a single peripheral by id. |
DELETE /api/peripherals/:id |
Delete a single peripheral by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
pinPin number. |
integer | π | π | π (required) |
π | π |
labelPeripheral name. |
string | π | π | π (required) |
π | π |
modePin mode. |
0-1 | π | π | Β | π | π |
GET /api/peripherals
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/peripherals'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('peripherals')
output:
[
{
"id": 1,
"created_at": "2022-02-02T23:14:14.106Z",
"updated_at": "2022-02-02T23:14:14.106Z",
"pin": 1,
"label": "MyString",
"mode": 0
},
{
"id": 2,
"created_at": "2022-02-02T23:14:14.118Z",
"updated_at": "2022-02-02T23:14:14.118Z",
"pin": 2,
"label": "MyString",
"mode": 0
}
]
pin_bindings
Used by push buttons.
| Method | Description |
|---|---|
GET /api/pin_bindings |
Get an array of all pin bindings. |
GET /api/pin_bindings/:id |
Get a single pin binding by id. |
POST /api/pin_bindings |
Create a new pin binding. |
PATCH /api/pin_bindings/:id |
Edit a single pin binding by id. |
DELETE /api/pin_bindings/:id |
Delete a single pin binding by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
device_idUnique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
sequence_idID of sequence to execute. |
integer | null | π | π | π | π | π |
special_actionAction to perform. |
βemergency_lockβ | βemergency_unlockβ | βpower_offβ | βread_statusβ | βrebootβ | βsyncβ | βtake_photoβ | null | π | π | π | π | π |
pin_numButton pin number. |
integer | π | π | π (required) |
π | π |
binding_typeβstandardβ: execute a sequence, βspecialβ: perform an action. |
βstandardβ | βspecialβ | π | π | Β | Β | Β |
GET /api/pin_bindings
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/pin_bindings'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('pin_bindings')
output:
[
{
"id": 46,
"created_at": "2022-02-02T23:15:50.154Z",
"updated_at": "2022-02-02T23:15:50.154Z",
"device_id": 589,
"sequence_id": 1,
"special_action": null,
"pin_num": 16,
"binding_type": "standard"
},
{
"id": 47,
"created_at": "2022-02-02T23:15:50.169Z",
"updated_at": "2022-02-02T23:15:50.169Z",
"device_id": 589,
"sequence_id": null,
"special_action": "sync",
"pin_num": 1,
"binding_type": "special"
}
]
plant_templates
Used by gardens.
| Method | Description |
|---|---|
GET /api/plant_templates |
Get an array of all plant templates. |
POST /api/plant_templates |
Create a new plant template. |
PATCH /api/plant_templates/:id |
Edit a single plant template by id. |
DELETE /api/plant_templates/:id |
Delete a single plant template by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
device_idUnique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
saved_garden_idID of the saved garden to which the plant belongs. |
integer | π | Β | π (required) |
π | π |
radiusSize of the plant. |
float | π | Β | π | π | π |
xx coordinate. |
float | π | Β | π (required) |
π | π |
yy coordinate. |
float | π | Β | π (required) |
π | π |
zz coordinate. |
float | π | Β | π | π | π |
namePlant name. |
string | π | Β | π | π | π |
openfarm_slugPlant type (from OpenFarm). |
string | π | Β | π | π | π |
GET /api/plant_templates
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/plant_templates'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('plant_templates')
output:
[
{
"id": 7,
"saved_garden_id": 7,
"device_id": 160,
"radius": 1.5,
"x": 206.0,
"y": 426.0,
"z": 23.0,
"name": "untitled",
"openfarm_slug": "lettuce",
"created_at": "2022-02-02T23:14:34.382Z",
"updated_at": "2022-02-02T23:14:34.382Z"
}
]
point_groups
Used by groups.
| Method | Description |
|---|---|
GET /api/point_groups |
Get an array of all point groups. |
GET /api/point_groups/:id |
Get a single point group by id. |
POST /api/point_groups |
Create a new point group. |
PATCH /api/point_groups/:id |
Edit a single point group by id. |
DELETE /api/point_groups/:id |
Delete a single point group by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
nameGroup name. |
string | π | π | π (required) |
π | π |
point_idsArray of manually included point IDs. |
integer[] | π | π | π (required) |
π | π |
sort_typeSort type. See point group sorting. |
βxy_ascendingβ | βxy_descendingβ | βyx_ascendingβ | βyx_descendingβ | βxy_alternatingβ | βyx_alternatingβ | βnnβ | βrandomβ | π | π | π | π | π |
criteriaPoint group criteria for automatic point inclusion. |
See below and groups. | π | π | π | π | π |
GET /api/point_groups
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/point_groups'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('point_groups')
output:
[
{
"id": 15,
"created_at": "2022-02-02T23:14:32.520Z",
"updated_at": "2022-02-02T23:14:32.520Z",
"name": "PG test 0",
"point_ids": [
76,
77,
78
],
"sort_type": "xy_ascending",
"criteria": {
"day": {
"op": "<",
"days_ago": 0
},
"string_eq": {
"openfarm_slug": [
"carrot"
]
},
"number_eq": {
"z": [
24,
25,
26
]
},
"number_lt": {
"x": 4,
"y": 4
},
"number_gt": {
"x": 1,
"y": 1
}
}
}
]
points
Used by plants, points, weeds, and tool slots, where the field pointer_type determines the resource.
Notes:
- Soft deleted points will be destroyed without warning when the device hits 800 points.
- New points cannot be created once the device hits 1000 points.
| Method | Description |
|---|---|
GET /api/points |
Get an array of all points. |
GET /api/points/:id |
Get a single point by id. |
POST /api/points |
Create a new point. |
PATCH /api/points/:id |
Edit a single point by id. |
DELETE /api/points/:id |
Delete a single point by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
plant | point | weed | tool slot |
|---|---|---|---|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π | β | β | β | β |
device_idUnique device identifier set by the database. |
integer | π | π | Β | Β | π | β | β | β | β |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π | β | β | β | β |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π | β | β | β | β |
namePoint name. |
string | π | π | π | π | π | β | β | β | β |
pointer_typePoint type. |
βGenericPointerβ | βPlantβ | βToolSlotβ | βWeedβ | π | π | π (required) |
π | π | β | β | β | β |
metaAdditional properties. |
object | π | π | π | π | π | β | β | β | β |
xx coordinate. |
float | π | π | π (required) |
π | π | β | β | β | β |
yy coordinate. |
float | π | π | π (required) |
π | π | β | β | β | β |
zz coordinate. |
float | π | π | π (required) |
π | π | β | β | β | β |
openfarm_slugPlant type (from OpenFarm). |
string | π | π | π | π | π | β | Β | Β | Β |
plant_stagePoint status. |
βplannedβ | βplantedβ | βharvestedβ | βsproutedβ | βactiveβ | βremovedβ | βpendingβ | π | π | π | π | π | β | Β | β | Β |
planted_atDate and time planted in garden. |
timestamp | π | π | π | π | π | β | Β | Β | Β |
discarded_atDate and time deleted. |
timestamp | π | π | Β | Β | π | Β | β | β | Β |
radiusPoint radius. |
float | π | π | π | π | π | β | β | β | Β |
depthPlant depth. |
integer | π | π | π | π | π | β | Β | Β | Β |
water_curve_idID of the water curve for the plant. |
integer | π | π | π | π | π | β | Β | Β | Β |
spread_curve_idID of the spread curve for the plant. |
integer | π | π | π | π | π | β | Β | Β | Β |
height_curve_idID of the height curve for the plant. |
integer | π | π | π | π | π | β | Β | Β | Β |
pullout_directionTool slot direction. |
0-4 | π | π | π | π | π | Β | Β | Β | β |
tool_idID of the tool in the tool slot. |
integer | π | π | π | π | π | Β | Β | Β | β |
gantry_mountedIs the tool slot mounted on the gantry? |
boolean | π | π | π | π | π | Β | Β | Β | β |
filterFilter points. |
βallβ | βoldβ | βkeptβ | π | Β | Β | Β | Β | Β | Β | Β | Β |
GET /api/points
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/points'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('points')
output:
[
{
"id": 50,
"created_at": "2022-02-02T23:14:25.964Z",
"updated_at": "2022-02-02T23:14:25.964Z",
"device_id": 99,
"name": "Cabbage 0",
"pointer_type": "Plant",
"meta": {
},
"x": 0,
"y": 0,
"z": 0,
"openfarm_slug": "cabbage",
"plant_stage": "planned",
"planted_at": "2022-02-02T23:14:25.964Z",
"radius": 50.0,
"depth": 0,
"water_curve_id": null,
"spread_curve_id": null,
"height_curve_id": null
},
{
"id": 51,
"created_at": "2022-02-02T23:14:25.964Z",
"updated_at": "2022-02-02T23:14:25.964Z",
"device_id": 99,
"name": "Point 0",
"pointer_type": "GenericPointer",
"meta": {
"created_by": "plant-detection"
},
"x": 1.0,
"y": 2.0,
"z": 3.0,
"radius": 3.0,
"discarded_at": null
},
{
"id": 52,
"created_at": "2022-02-02T23:14:25.964Z",
"updated_at": "2022-02-02T23:14:25.964Z",
"device_id": 99,
"name": "test weed",
"pointer_type": "Weed",
"meta": {
},
"x": 1.0,
"y": 2.0,
"z": 3.0,
"radius": 3.0,
"discarded_at": null,
"plant_stage": "active"
},
{
"id": 53,
"created_at": "2022-02-02T23:14:25.964Z",
"updated_at": "2022-02-02T23:14:25.964Z",
"device_id": 99,
"name": "Slot 0",
"pointer_type": "ToolSlot",
"meta": {
},
"x": 4.0,
"y": 5.0,
"z": 6.0,
"tool_id": null,
"pullout_direction": 0,
"gantry_mounted": false
}
]
POST /api/points
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/points'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
payload = {
'pointer_type': 'Plant',
'name': 'Strawberry',
'openfarm_slug': 'strawberry',
'x': 1,
'y': 2,
'z': 3,
}
response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_post('points', {
'pointer_type': 'Plant',
'name': 'Strawberry',
'openfarm_slug': 'strawberry',
'x': 1,
'y': 2,
'z': 3,
})
output:
{
"id": 123,
"created_at": "2022-02-02T23:14:25.964Z",
"updated_at": "2022-02-02T23:14:25.964Z",
"device_id": 99,
"name": "Strawberry",
"pointer_type": "Plant",
"meta": {},
"x": 1,
"y": 2,
"z": 3,
"openfarm_slug": "strawberry",
"plant_stage": "planned",
"planted_at": null,
"radius": 25.0,
"depth": 0,
"water_curve_id": null,
"spread_curve_id": null,
"height_curve_id": null
}
points/search
| Method | Description |
|---|---|
GET /api/points/search |
Get a list of filtered points. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
radiusPoint size. |
float | π | Β | Β | Β | Β |
depthPlant depth. |
integer | π | Β | Β | Β | Β |
namePoint name. |
string | π | Β | Β | Β | Β |
pointer_typePoint type. |
βGenericPointerβ | βPlantβ | βToolSlotβ | βWeedβ | π | Β | Β | Β | Β |
metaAdditional properties. |
object | π | Β | Β | Β | Β |
xx coordinate. |
float | π | Β | Β | Β | Β |
yy coordinate. |
float | π | Β | Β | Β | Β |
zz coordinate. |
float | π | Β | Β | Β | Β |
openfarm_slugPlant type (from OpenFarm). |
string | π | Β | Β | Β | Β |
plant_stagePoint status. |
βplannedβ | βplantedβ | βharvestedβ | βsproutedβ | βactiveβ | βremovedβ | βpendingβ | π | Β | Β | Β | Β |
public_key
| Method | Description |
|---|---|
GET /api/public_key |
Get the public key. |
GET /api/public_key
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/public_key'
response = requests.get(url)
print(response.text)
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('public_key')
output:
-----BEGIN PUBLIC KEY-----
2pVjj0NP5GNGzSqz8OVZUDJceDlsYpY24tUzJEtEzBJdN32zKM7PEkjiSZKqE3Uq
lWKTxcArHrk/VPVp53dRhP0dza8dluHHlbsC19FmOWjcBRk2d1QUmhfVQMxc+EVE
Hv5RSjtY40tB5NXRpXmbTOz7yejh2DsagCMTTyR8tQ/HYESXWama4s/MpRcVGHPY
6rZbv3a67/yqsrxNsqnmG+JrAvKsQd86p7upbo4jEQQ2SatXSuzYCCl8wOL6wkz2
E+qJNUTbyfTjyegBkUw6PEFnMhSUvzmBsWmy6X12vK9Too8qBhOYzYIPtN4oB9eY
v4oT7LUFYK5agv2lVG6Z1UvoB16T+moOfba/l1xkgG3xGqI/LYzxIM74h5ppjtkw
DmhdoWLZ
-----END PUBLIC KEY-----
regimens
See regimens.
| Method | Description |
|---|---|
GET /api/regimens |
Get an array of all regimens. |
GET /api/regimens/:id |
Get a single regimen by id. |
POST /api/regimens |
Create a new regimen. |
PATCH /api/regimens/:id |
Edit a single regimen by id. |
DELETE /api/regimens/:id |
Delete a single regimen by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
device_idUnique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
nameRegimen name. |
string | π | π | π (required) |
π | π |
colorRegimen color. |
βblueβ | βgreenβ | βyellowβ | βorangeβ | βpurpleβ | βpinkβ | βgrayβ | βredβ | π | π | π (required) |
π | π |
bodyVariable data. |
Array | π | π | π | π | π |
regimen_itemsSequence executions scheduled in the regimen. |
Array (time_offset is in milliseconds) |
π | π | π (required) |
π | π |
GET /api/regimens
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/regimens'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('regimens')
output:
[
{
"id": 15,
"created_at": "2022-02-02T23:15:50.695Z",
"updated_at": "2022-02-02T23:15:50.766Z",
"name": "specs",
"color": "red",
"device_id": 234,
"body": [
{
"kind": "parameter_application",
"args": {
"label": "parent",
"data_value": {
"kind": "coordinate",
"args": {
"x": 0,
"y": 0,
"z": 0
}
}
}
}
],
"regimen_items": [
{
"id": 6,
"created_at": "2022-02-02T23:15:50.695Z",
"updated_at": "2022-02-02T23:15:50.766Z",
"regimen_id": 15,
"sequence_id": 70,
"time_offset": 100
}
]
}
]
releases
Used by the FarmBot OS download page and FarmBot OS OTA updates.
| Method | Description |
|---|---|
GET /api/releases |
Get a release. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | Β |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | Β |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | Β |
image_urlURL of FarmBot OS release .fw file. |
string | π | Β | Β | Β | Β |
versionFarmBot OS release version. |
string | π | Β | Β | Β | Β |
platformFarmBot OS computer model. |
βrpiβ | βrpi3β | βrpi4β | π | Β | Β | Β | Β |
channelRelease channel. |
βstableβ | βbetaβ | βalphaβ | π | Β | Β | Β | Β |
dot_img_urlURL of FarmBot OS release .img file. |
string | π | Β | Β | Β | Β |
GET /api/releases
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/releases'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
payload = {
'channel': 'stable',
'platform': 'rpi3',
}
response = requests.get(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('releases', payload={
'channel': 'stable',
'platform': 'rpi3',
})
output:
{
"id": 2,
"created_at": "2022-02-02T23:14:27.277Z",
"updated_at": "2022-02-02T23:14:27.277Z",
"image_url": "gopher://localhost:3000/b",
"version": "1.2.3-rc7",
"platform": "rpi3",
"channel": "stable",
"dot_img_url": null
}
saved_gardens
Used by gardens.
| Method | Description |
|---|---|
GET /api/saved_gardens |
Get an array of all saved gardens. |
POST /api/saved_gardens |
Create a new saved garden. |
PATCH /api/saved_gardens/:id |
Edit a single saved garden by id. |
DELETE /api/saved_gardens/:id |
Delete a single saved garden by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | π |
device_idUnique device identifier set by the database. |
integer | π | Β | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
nameSaved garden name. |
string | π | Β | π (required) |
π | π |
notesNotes. |
string | π | Β | π | π | π |
GET /api/saved_gardens
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/saved_gardens'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('saved_gardens')
output:
[
{
"id": 32,
"name": "Garden 0",
"device_id": 384,
"created_at": "2022-02-02T23:15:33.978Z",
"updated_at": "2022-02-02T23:15:33.978Z",
"notes": "notes"
}
]
saved_gardens/:id/apply
| Method | Description |
|---|---|
POST /api/saved_gardens/:id/apply |
Apply a saved garden, destroying existing plants. |
PATCH /api/saved_gardens/:id/apply |
Apply a saved garden. Errors if plants exist. |
saved_gardens/snapshot
| Method | Description |
|---|---|
POST /api/saved_gardens/snapshot |
Copy the current garden to a new saved garden. |
sensor_readings
| Method | Description |
|---|---|
GET /api/sensor_readings |
Get an array of all sensor readings. |
GET /api/sensor_readings/:id |
Get a single sensor reading by id. |
POST /api/sensor_readings |
Create a new sensor reading. |
DELETE /api/sensor_readings/:id |
Delete a single sensor reading by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
modeSensor pin read mode, 0 for digital, 1 for analog. |
0 | 1 | π | π | π | Β | π |
pinSensor pin number. |
0-69 | π | π | π (required) |
Β | π |
valueSensor value. |
0-1023 | π | π | π (required) |
Β | π |
xx coordinate. |
float | π | π | π (required) |
Β | π |
yy coordinate. |
float | π | π | π (required) |
Β | π |
zz coordinate. |
float | π | π | π (required) |
Β | π |
read_atDate and time of sensor reading. |
timestamp | π | π | π | Β | π |
GET /api/sensor_readings
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/sensor_readings'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('sensor_readings')
output:
[
{
"id": 1,
"created_at": "2022-02-02T23:14:15.819Z",
"updated_at": "2022-02-02T23:14:15.819Z",
"mode": 1,
"pin": 66,
"value": 80,
"x": 281.0,
"y": 205.0,
"z": 76.0,
"read_at": "2022-02-02T23:14:15.819Z"
}
]
sensors
See sensors.
| Method | Description |
|---|---|
GET /api/sensors |
Get an array of all sensors. |
GET /api/sensors/:id |
Get a single sensor by id. |
POST /api/sensors |
Create a new sensor. |
PATCH /api/sensors/:id |
Edit a single sensor by id. |
DELETE /api/sensors/:id |
Delete a single sensor by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
modeSensor pin read mode, 0 for digital, 1 for analog. |
0 | 1 | π | π | π (required) |
π | π |
pinSensor pin number. |
0-69 | π | π | π (required) |
π | π |
labelSensor name. |
string | π | π | π (required) |
π | π |
GET /api/sensors
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/sensors'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('sensors')
output:
[
{
"id": 4,
"created_at": "2022-02-02T23:14:40.839Z",
"updated_at": "2022-02-02T23:14:40.839Z",
"pin": 3,
"label": "My Sensor",
"mode": 1
}
]
sequence_versions
Sequence versions are created when a sequence is published for sharing. Also see featured sequences.
| Method | Description |
|---|---|
GET /api/sequence_versions/:id |
Get a sequence version. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | Β | π | Β | Β | Β |
created_atDate and time of creation set by the database. |
timestamp | Β | π | Β | Β | Β |
descriptionSequence description. |
string | Β | π | Β | Β | Β |
copyrightCopyright holder. |
string | Β | π | Β | Β | Β |
nameSequence name. |
string | Β | π | Β | Β | Β |
colorSequence color. |
βblueβ | βgreenβ | βyellowβ | βorangeβ | βpurpleβ | βpinkβ | βgrayβ | βredβ | Β | π | Β | Β | Β |
kindβsequenceβ. |
βsequenceβ | Β | π | Β | Β | Β |
argsScope declaration. |
Object | Β | π | Β | Β | Β |
bodySequence steps. |
Array | Β | π | Β | Β | Β |
GET /api/sequence_versions/8
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/sequence_versions/8'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('sequence_versions', 8)
output:
{
"id": 8,
"created_at": "2022-02-02T23:14:33.054Z",
"description": "An SV with comments",
"copyright": "FarmBot, Inc. 2021",
"name": "Operative multimedia success",
"kind": "sequence",
"args": {
"version": 20180209,
"locals": {
"kind": "scope_declaration",
"args": {
}
}
},
"body": [
{
"comment": "This is a comment",
"kind": "send_message",
"args": {
"message": "Hello, world!",
"message_type": "warn"
}
}
]
}
sequences
See sequences.
| Method | Description |
|---|---|
GET /api/sequences |
Get an array of all sequences. |
GET /api/sequences/:id |
Get a single sequence by id. |
POST /api/sequences |
Create a new sequence. |
PATCH /api/sequences/:id |
Edit a single sequence by id. |
DELETE /api/sequences/:id |
Delete a single sequence by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
argsScope declaration. |
Object | π | π | π | π (required) |
π |
colorSequence color. |
βblueβ | βgreenβ | βyellowβ | βorangeβ | βpurpleβ | βpinkβ | βgrayβ | βredβ | π | π | π | π | π |
folder_idID of the parent folder. |
integer | π | π | π | π | π |
forkedLocal changes to a shared sequence. |
boolean | π | π | π | π | π |
nameSequence name. |
string | π | π | π (required) |
π (required) |
π |
pinnedAdd the sequence to the pinned sequence list. |
boolean | π | π | π | π | π |
copyrightCopyright holder. |
string | π | π | π | π | π |
descriptionSequence description (markdown). |
string | π | π | π | π | π |
sequence_versionsA list of published versions of the sequence. |
integer[] | π | π | π | π | π |
sequence_version_idID of the sequence version the sequence was imported from. |
integer | π | π | π | π | π |
kindβsequenceβ |
βsequenceβ | π | π | π | π | π |
bodySequence steps. |
Array | π | π | π (required) |
π (required) |
π |
GET /api/sequences
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/sequences'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('sequences')
output:
[
{
"id": 36,
"created_at": "2022-02-02T23:14:31.607Z",
"updated_at": "2022-02-02T23:14:31.645Z",
"args": {
"version": 20180209,
"locals": {
"kind": "scope_declaration",
"args": {
},
"body": [
{
"kind": "parameter_declaration",
"args": {
"label": "parent",
"default_value": {
"kind": "coordinate",
"args": {
"x": 9,
"y": 9,
"z": 9
}
}
}
}
]
}
},
"color": "green",
"folder_id": null,
"forked": false,
"name": "My Sequence",
"pinned": false,
"copyright": null,
"description": null,
"sequence_versions": [
],
"sequence_version_id": null,
"kind": "sequence",
"body": [
{
"kind": "execute",
"args": {
"sequence_id": 23
}
}
]
}
]
sequences/:id/upgrade/:sequence_version_id
| Method | Description |
|---|---|
POST /api/sequences/:id/upgrade/:sequence_version_id |
Upgrade a sequence that already uses a sequence version. |
sequences/:sequence_version_id/install
| Method | Description |
|---|---|
POST /api/sequences/:sequence_version_id/install |
Install someone elseβs sequence. |
sequences/:id/publish
| Method | Description |
|---|---|
POST /api/sequences/:id/publish |
Share your sequence with other people. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
copyrightCopyright holder. |
string | Β | Β | π (required) |
Β | Β |
sequences/:id/unpublish
| Method | Description |
|---|---|
POST /api/sequences/:id/unpublish |
Unlist your sequence. |
storage_auth
Used for photos.
| Method | Description |
|---|---|
GET /api/storage_auth |
Get the image storage policy object. |
GET /api/storage_auth
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/storage_auth'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('storage_auth')
output:
{
"verb": "POST",
"url": "//storage.googleapis.com/YOU_MUST_CONFIG_GOOGLE_CLOUD_STORAGE/",
"form_data": {
"key": "temp1/517227e6-4d91-43c1-a0f2-69dd4dbf612c.jpg",
"acl": "public-read",
"Content-Type": "image/jpeg",
"policy": "GCS NOT SETUP!",
"signature": "GCS NOT SETUP!",
"GoogleAccessId": "GCS NOT SETUP!",
"file": "REPLACE_THIS_WITH_A_BINARY_JPEG_FILE"
},
"instructions": "Send a 'form-data' request to the URL provided. Then POST the resulting URL as an 'attachment_url' (json) to api/images/."
}
telemetries
Used by the history tab of the connectivity pop-up.
| Method | Description |
|---|---|
GET /api/telemetries |
Get an array of all telemetries. |
POST /api/telemetries |
Create a new telemetry. |
DELETE /api/telemetries/:id |
Delete a single telemetry by id. |
DELETE /api/telemetries/all |
Delete all telemetries. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
targetFarmBot OS computer model. |
βrpiβ | βrpi3β | βrpi4β | π | Β | π (required) |
Β | π |
soc_tempCPU temperature. |
integer | π | Β | π | Β | π |
throttledRPi throttle state. |
β0x#####β | π | Β | π | Β | π |
wifi_level_percentWiFi signal strength percent. |
0-100 | π | Β | π | Β | π |
uptimeTime in seconds since boot. |
integer | π | Β | π | Β | π |
memory_usageMemory usage in MB. |
integer | π | Β | π | Β | π |
disk_usageDisk usage in percent. |
0-100 | π | Β | π | Β | π |
cpu_usageCPU usage in percent. |
0-100 | π | Β | π | Β | π |
fbos_versionFarmBot OS semver version string. |
string | π | Β | π | Β | π |
firmware_hardwareFirmware installed on the Farmduino or microcontroller. |
βarduinoβ | βfarmduinoβ | βfarmduino_k14β | βfarmduino_k15β | βfarmduino_k16β | βfarmduino_k17β | βexpress_k10β | βexpress_k11β | βexpress_k12β | π | Β | π | Β | π |
GET /api/telemetries
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/telemetries'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('telemetries')
output:
[
{
"id": 9,
"created_at": 1712360174,
"updated_at": "2024-04-05T23:36:14.413Z",
"soc_temp": 62,
"throttled": "0x0",
"wifi_level_percent": 54,
"uptime": 832,
"memory_usage": 22,
"disk_usage": 4,
"cpu_usage": 61,
"target": "rpi",
"fbos_version": "17.0.0",
"firmware_hardware": null
}
]
tokens
Used for user authentication. Also see authorization.
| Method | Description |
|---|---|
GET /api/tokens |
Use your token to refresh your token, except for the expiration. |
POST /api/tokens |
Provide your account login to request a new token. |
DELETE /api/tokens |
Delete your token. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
tokenToken. |
Object. (see below) | π | Β | π | Β | π |
userUser. |
Object. (see users) | Β | Β | π | Β | π |
Token
| Field | Type |
|---|---|
unencodedUnencoded token information. |
Object. (see below) |
encodedEncoded token to use in request header. |
string |
Unencoded Token
| Field | Type |
|---|---|
audAudience. |
string |
subUser ID. |
integer |
iatCreated at timestamp. |
integer |
jtiJTI. |
string |
issAPI address. |
string |
expExpiration. |
integer |
mqttMQTT URL. |
string |
botDevice ID string (username). |
string |
vhostvhost. |
string |
mqtt_wsMQTT WS URL. |
string |
GET /api/tokens
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/tokens'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('tokens')
output:
{
"token": {
"unencoded": {
"aud": "unknown",
"sub": 134,
"iat": 1643843680,
"jti": "22deacf3-cb7c-4b42-9727-24d4d964a9d2",
"iss": "//192.168.1.112:3000",
"exp": 1649027679,
"mqtt": "blooper.io",
"bot": "device_214",
"vhost": "/",
"mqtt_ws": "ws://blooper.io:3002/ws"
},
"encoded": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJ1bmtub3duIiwic3ViIjoxMzQsImlhdCI6MTY0Mzg0MzY4MCwianRpIjoiMjJkZWFjZjMtY2I3Yy00YjQyLTk3MjctMjRkNG"
}
}
tools
Used for tools.
| Method | Description |
|---|---|
GET /api/tools |
Get an array of all tools. |
GET /api/tools/:id |
Get a single tool by id. |
POST /api/tools |
Create a new tool. |
PATCH /api/tools/:id |
Edit a single tool by id. |
DELETE /api/tools/:id |
Delete a single tool by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
nameTool name. |
string | π | π | π (required) |
π | π |
statusWhether a tool is assigned to a slot or not. Does not indicate if a tool is currently mounted by the UTM. Use device.mounted_tool_id to check if the tool is mounted or not. |
βactiveβ | βinactiveβ | π | π | Β | Β | π |
flow_rate_ml_per_sWatering nozzle flow rate in mL per second. Field only shown in the frontend if tool name includes βWatering Nozzleβ. |
integer | π | π | π | π | π |
GET /api/tools
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/tools'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('tools')
output:
{
"id": 42,
"created_at": "2022-02-02T23:14:39.322Z",
"updated_at": "2022-02-02T23:14:39.322Z",
"name": "Watering Nozzle",
"status": "active",
"flow_rate_ml_per_s": 0
}
users
Account user information.
| Method | Description |
|---|---|
GET /api/users |
Get an array including the user object. |
POST /api/users |
Create a new user. |
PATCH /api/users |
Edit the user object. |
DELETE /api/users |
Delete the user object. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
nameUser name. |
string | π | Β | π (required) |
π | Β |
emailEmail address. |
string | π | Β | π (required) |
π | Β |
passwordPassword. |
string | Β | Β | π (required) |
Β | Β |
password_confirmationPassword. |
string | Β | Β | π (required) |
Β | Β |
new_passwordPassword. |
string | Β | Β | Β | Β | π |
new_password_confirmationPassword. |
string | Β | Β | Β | Β | π |
agree_to_termsAgreed to terms?. |
boolean | Β | Β | π | Β | Β |
languageUser language (used for auto-generation). |
string | π | Β | π | π | π |
GET /api/users
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/users'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('users')
output:
[
{
"id": 234,
"created_at": "2022-02-02T23:14:56.988Z",
"updated_at": "2022-02-02T23:14:56.988Z",
"name": "Susana Bogan",
"email": "suzy@hirthe.name",
"language": "English"
}
]
users/control_certificate
| Method | Description |
|---|---|
POST /api/users/control_certificate |
Generate a control certificate. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
emailEmail address. |
string | Β | Β | π (required) |
Β | Β |
passwordPassword. |
string | Β | Β | π (required) |
Β | Β |
users/resend_verification
| Method | Description |
|---|---|
POST /api/users/resend_verification |
Resend the account verification email. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
emailEmail address. |
string | Β | Β | π (required) |
Β | Β |
web_app_config
See settings.
| Method | Description |
|---|---|
GET /api/web_app_config |
Get the web app config object. |
PATCH /api/web_app_config |
Edit the web app configuration object. |
DELETE /api/web_app_config |
Delete the web app configuration object. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | π |
device_idUnique device identifier set by the database. |
integer | π | Β | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
confirm_step_deletionShow a confirmation dialog when deleting a sequence step. |
boolean | π | Β | Β | π | π |
disable_animationsDisable plant animations in the garden map. |
boolean | π | Β | Β | π | π |
disable_i18nSet the Web App to English. |
boolean | π | Β | Β | π | π |
display_trailDisplay a virtual trail for FarmBot in the garden map to show movement and watering history while the map is open. Toggling this setting will clear data for the current trail. |
boolean | π | Β | Β | π | π |
dynamic_mapChange the garden map size based on axis length. A value must be input in AXIS LENGTH and STOP AT MAX must be enabled in firmware_config. Overrides MAP SIZE values. |
boolean | π | Β | Β | π | π |
encoder_figureShow a virtual farmbot in the garden map at the encoder position as well as motor position. |
boolean | π | Β | Β | π | π |
hide_webcam_widgetUnused. |
boolean | π | Β | Β | π | π |
legend_menu_openShow the garden map legend. |
boolean | π | Β | Β | π | π |
raw_encodersShow raw encoder values. |
boolean | π | Β | Β | π | π |
scaled_encodersShow scaled encoder values. |
boolean | π | Β | Β | π | π |
show_spreadShow plant spread in the garden map. |
boolean | π | Β | Β | π | π |
show_farmbotShow FarmBot in the garden map. |
boolean | π | Β | Β | π | π |
show_plantsShow plants in the garden map. |
boolean | π | Β | Β | π | π |
show_pointsShow map points in the garden ma. |
boolean | π | Β | Β | π | π |
x_axis_invertedInvert x axis jog buttons. |
boolean | π | Β | Β | π | π |
y_axis_invertedInvert y axis jog buttons. |
boolean | π | Β | Β | π | π |
z_axis_invertedInvert z axis jog buttons. |
boolean | π | Β | Β | π | π |
bot_origin_quadrantSelect a map origin by clicking on one of the four quadrants to adjust the garden map to your viewing angle. |
1-4 | π | Β | Β | π | π |
zoom_levelGarden map zoom level. |
-9-3 | π | Β | Β | π | π |
success_logSuccess log verbosity setting. |
0-3 | π | Β | Β | π | π |
busy_logBusy log verbosity setting. |
0-3 | π | Β | Β | π | π |
warn_logWarning log verbosity setting. |
0-3 | π | Β | Β | π | π |
error_logError log verbosity setting. |
0-3 | π | Β | Β | π | π |
info_logInfo log verbosity setting. |
0-3 | π | Β | Β | π | π |
fun_logFun log verbosity setting. |
0-3 | π | Β | Β | π | π |
debug_logDebug log verbosity setting. |
0-3 | π | Β | Β | π | π |
stub_configSub config. |
boolean | π | Β | Β | π | π |
show_first_party_farmwareUnused. |
boolean | π | Β | Β | π | π |
enable_browser_speakHave the browser also read aloud log messages on the βSpeakβ channel that are spoken by FarmBot. |
boolean | π | Β | Β | π | π |
show_imagesShow photos in the garden map. |
boolean | π | Β | Β | π | π |
photo_filter_beginShow photos after this date and time. |
timestamp | null | π | Β | Β | π | π |
photo_filter_endShow photos before this date and time. |
timestamp | null | π | Β | Β | π | π |
discard_unsavedDonβt ask about saving work before closing browser tab. Warning: may cause loss of data. |
boolean | π | Β | Β | π | π |
xy_swapSwap map X and Y axes, making the Y axis horizontal and X axis vertical. This setting will also swap the X and Y jog control buttons in the Move widget. |
boolean | π | Β | Β | π | π |
home_button_homingConfigure the home button to find home instead of moving to home. |
boolean | π | Β | Β | π | π |
show_motor_plotShow motor position graph. |
boolean | π | Β | Β | π | π |
show_historic_pointsShow removed weeds in the garden map. |
boolean | π | Β | Β | π | π |
show_sensor_readingsShow sensor readings in the garden map. |
boolean | π | Β | Β | π | π |
show_dev_menuUnused. |
boolean | π | Β | Β | π | π |
internal_useDeveloper setting storage. |
string | π | Β | Β | π | π |
time_format_24_hourDisplay times using the 24-hour format. |
boolean | π | Β | Β | π | π |
show_pinsShow raw pin lists in Read Sensor, Control Peripheral, and If Statement steps. |
boolean | π | Β | Β | π | π |
disable_emergency_unlock_confirmationDonβt confirm when unlocking FarmBot after an emergency stop. |
boolean | π | Β | Β | π | π |
map_size_xCustom x map dimension (in millimeters). These values set the size of the garden map unless dynamic_map is enabled. |
integer | π | Β | Β | π | π |
map_size_yCustom y map dimension (in millimeters). These values set the size of the garden map unless dynamic_map is enabled. |
integer | π | Β | Β | π | π |
expand_step_optionsChoose whether advanced step options are open or closed by default. |
boolean | π | Β | Β | π | π |
hide_sensorsHide the sensors panel. |
boolean | π | Β | Β | π | π |
confirm_plant_deletionShow a confirmation dialog when deleting a plant. |
boolean | π | Β | Β | π | π |
confirm_sequence_deletionShow a confirmation dialog when deleting a sequence. |
boolean | π | Β | Β | π | π |
discard_unsaved_sequencesDonβt ask about saving sequence work before closing browser tab. Warning: may cause loss of data. |
boolean | π | Β | Β | π | π |
user_interface_read_only_modeDisallow account data changes. This does not prevent Lua or FarmBot OS from changing settings. |
boolean | π | Β | Β | π | π |
assertion_logAssertion log verbosity setting. |
0-3 | π | Β | Β | π | π |
show_zonesShow point group location areas in the garden map. |
boolean | π | Β | Β | π | π |
show_weedsShow weeds in the garden map. |
boolean | π | Β | Β | π | π |
display_map_missed_stepsDisplay high motor load warning indicators in map. Requires display_trail and stall detection to be enabled. |
boolean | π | Β | Β | π | π |
time_format_secondsAdd seconds to time displays. |
boolean | π | Β | Β | π | π |
crop_imagesCrop images displayed in the garden map to remove black borders from image rotation. Crop amount determined by CAMERA ROTATION value. |
boolean | π | Β | Β | π | π |
show_camera_view_areaShow the cameraβs field of view in the garden map. |
boolean | π | Β | Β | π | π |
view_celery_scriptView raw data representation of sequence steps. |
boolean | π | Β | Β | π | π |
highlight_modified_settingsHighlight settings that have been changed from their default values. |
boolean | π | Β | Β | π | π |
show_advanced_settingsShow advanced settings. |
boolean | π | Β | Β | π | π |
show_soil_interpolation_mapShow soil height interpolation map in the garden map. |
boolean | π | Β | Β | π | π |
show_moisture_interpolation_mapShow soil moisture interpolation map in the garden map. |
boolean | π | Β | Β | π | π |
clip_image_layerRemove portions of images that extend beyond the garden map boundaries. |
boolean | π | Β | Β | π | π |
beep_verbosityBeep upon log message verbosity level. |
0-3 | π | Β | Β | π | π |
landing_pagePanel to show upon loading the app. |
string | π | Β | Β | π | π |
go_button_axesDefault axes to move when a GO TO LOCATION button is pressed. |
βXβ | βYβ | βZβ | βXYβ | βXYZβ | π | Β | Β | π | π |
show_uncropped_camera_view_areaShow the cameraβs uncropped and unrotated field of view in the garden map when clip_image_layer is enabled. |
boolean | π | Β | Β | π | π |
default_plant_depthWhen adding plants to the map from the web app, set each new plantβs depth to this value (in millimeters). |
integer | π | Β | Β | π | π |
show_missed_step_plotShow motor load graph. |
boolean | π | Β | Β | π | π |
enable_3d_electronics_box_topShow the push buttons in 3D instead of 2D. |
boolean | π | Β | Β | π | π |
GET /api/web_app_config
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/web_app_config'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('web_app_config')
output:
{
"id": 2,
"created_at": "2022-02-02T23:14:24.408Z",
"updated_at": "2022-02-02T23:14:24.426Z",
"device_id": 86,
"confirm_step_deletion": false,
"disable_animations": false,
"disable_i18n": false,
"display_trail": true,
"dynamic_map": false,
"encoder_figure": false,
"hide_webcam_widget": false,
"legend_menu_open": true,
"raw_encoders": false,
"scaled_encoders": false,
"show_spread": true,
"show_farmbot": true,
"show_plants": true,
"show_points": true,
"x_axis_inverted": false,
"y_axis_inverted": false,
"z_axis_inverted": false,
"bot_origin_quadrant": 2,
"zoom_level": -2,
"success_log": 1,
"busy_log": 1,
"warn_log": 1,
"error_log": 1,
"info_log": 1,
"fun_log": 1,
"debug_log": 1,
"stub_config": false,
"show_first_party_farmware": false,
"enable_browser_speak": false,
"show_images": true,
"photo_filter_begin": null,
"photo_filter_end": null,
"discard_unsaved": false,
"xy_swap": false,
"home_button_homing": true,
"show_motor_plot": false,
"show_historic_points": false,
"show_sensor_readings": false,
"show_dev_menu": false,
"internal_use": null,
"time_format_24_hour": false,
"show_pins": false,
"disable_emergency_unlock_confirmation": true,
"map_size_x": 2900,
"map_size_y": 1400,
"expand_step_options": false,
"hide_sensors": false,
"confirm_plant_deletion": true,
"confirm_sequence_deletion": true,
"discard_unsaved_sequences": false,
"user_interface_read_only_mode": false,
"assertion_log": 1,
"show_zones": false,
"show_weeds": true,
"display_map_missed_steps": false,
"time_format_seconds": false,
"crop_images": true,
"show_camera_view_area": true,
"view_celery_script": false,
"highlight_modified_settings": true,
"show_advanced_settings": false,
"show_soil_interpolation_map": false,
"show_moisture_interpolation_map": false,
"clip_image_layer": true,
"beep_verbosity": 0,
"landing_page": "plants",
"go_button_axes": "XY",
"show_uncropped_camera_view_area": false,
"default_plant_depth": 5,
"show_missed_step_plot": false,
"enable_3d_electronics_box_top": true
}
webcam_feeds
See webcam feeds.
| Method | Description |
|---|---|
GET /api/webcam_feeds |
Get an array of all webcam feeds. |
GET /api/webcam_feeds/:id |
Get a single webcam feed by id. |
POST /api/webcam_feeds |
Create a new webcam feed. |
PATCH /api/webcam_feeds/:id |
Edit a single webcam feed by id. |
DELETE /api/webcam_feeds/:id |
Delete a single webcam feed by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | π | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
nameWebcam feed label. |
string | π | π | π (required) |
π | π |
urlWebcam feed URL. |
string | π | π | π (required) |
π | π |
GET /api/webcam_feeds
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/webcam_feeds'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('webcam_feeds')
output:
[
{
"id": 14,
"created_at": "2022-02-02T23:14:53.317Z",
"updated_at": "2022-02-02T23:14:53.317Z",
"url": "0",
"name": "feed 0"
}
]
wizard_step_results
Used by setup wizard.
| Method | Description |
|---|---|
GET /api/wizard_step_results |
Get an array of all wizard step results. |
POST /api/wizard_step_results |
Create a new wizard step result. |
PATCH /api/wizard_step_results/:id |
Edit a single wizard step result by id. |
DELETE /api/wizard_step_results/:id |
Delete a single wizard step result by id. |
| Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
|---|---|---|---|---|---|---|
idUnique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_atDate and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_atDate and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
answerWizard step success? |
boolean | π | Β | π | π | π |
outcomeError message. |
string | π | Β | π | π | π |
slugWizard step UUID. |
string | π | Β | π | π | π |
GET /api/wizard_step_results
via Python
import json
import requests
# TOKEN = ...
url = f'https:{TOKEN['token']['unencoded']['iss']}/api/wizard_step_results'
headers = {'Authorization': 'Bearer ' + TOKEN['token']['encoded'],
'content-type': 'application/json'}
response = requests.get(url, headers=headers)
print(json.dumps(response.json(), indent=2))
via FarmBot Python library
from farmbot import Farmbot
# TOKEN = ...
fb = Farmbot()
fb.set_token(TOKEN)
fb.api_get('wizard_step_results')
output:
[
{
"id": 5,
"created_at": "2022-02-02T23:15:34.279Z",
"updated_at": "2022-02-02T23:15:34.279Z",
"answer": false,
"outcome": "error",
"slug": "intro"
}
]