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 |
---|---|---|---|---|---|---|
prompt Instructions for model to follow. |
string | Β | Β | π | Β | Β |
context_key Type of generation request. |
βtitleβ | βcolorβ | βdescriptionβ | βluaβ | Β | Β | π | Β | Β |
sequence_id For 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | Β | Β | Β | Β | Β |
created_at Date and time of creation set by the database. |
timestamp | Β | Β | Β | Β | Β |
updated_at Date and time of most recent update set by the database. |
timestamp | Β | Β | Β | Β | Β |
prompt A copy of the instructions for the auto-generation request. |
string | Β | Β | π | Β | Β |
reaction The 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
problem_tag Type 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β | π | Β | Β | Β | π |
slug Defaults to random UUID. |
string | π | Β | Β | Β | π |
priority Importance 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
name Curve name. |
string | π | π | π (required) |
π | π |
type Curve type. |
βwaterβ | βspreadβ | βheightβ | π | π | π (required) |
π | π |
data Curve 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 |
---|---|---|---|---|---|---|
secret Password. |
string | Β | Β | π | Β | Β |
product_line FarmBot 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | Β |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | Β |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | Β |
fb_order_number Order number. |
string | null | π | Β | Β | π | Β |
fbos_version FarmBot OS version. |
string | π | Β | Β | Β | Β |
indoor Is your FarmBot indoors? |
boolean | π | Β | Β | π | Β |
last_saw_api Datetime of last API visit. |
timestamp | π | Β | Β | Β | Β |
lat Latitude. |
float | π | Β | Β | π | Β |
lng Longitude. |
float | π | Β | Β | π | Β |
mounted_tool_id The ID of the tool currently attached to the UTM. |
integer | π | Β | Β | π | Β |
name FarmBot name. |
string | π | Β | Β | π | Β |
ota_hour Over-the-air update local time. |
0-23 | null | π | Β | Β | π | Β |
ota_hour_utc Over-the-air update UTC time. |
0-23 | null | π | Β | Β | Β | Β |
rpi FarmBot computer model. |
β3β | β4β | β01β | β02β | π | Β | Β | π | Β |
serial_number FarmBot serial number. |
string | π | Β | Β | Β | Β |
setup_completed_at Datetime device setup completed. |
timestamp | π | Β | Β | π | Β |
throttled_at Datetime device throttle begin. |
timestamp | π | Β | Β | Β | Β |
throttled_until Datetime device throttle end. |
timestamp | π | Β | Β | Β | Β |
timezone Timezone. |
string | π | Β | Β | π | Β |
max_log_age_in_days Logs deleted after __ days. |
integer | π | Β | Β | Β | Β |
max_sequence_count Maximum number of allowed sequences. |
integer | π | Β | Β | Β | Β |
max_sequence_length Maximum allowed sequence length. |
integer | π | Β | Β | Β | Β |
tz_offset_hrs Hours 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 |
---|---|---|---|---|---|---|
password Account 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_line FarmBot 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) |
Β | Β |
demo Seed 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
start_time Date and time to begin the farm event. |
timestamp | π | π | π | π | π |
end_time Date and time to end the farm event. |
timestamp | π | π | π | π | π |
repeat Number of times to repeat the farm event. |
integer | π | π | π (required) |
π | π |
time_unit Time period for repeat. |
βneverβ | βminutelyβ | βhourlyβ | βdailyβ | βweeklyβ | βmonthlyβ | βyearlyβ | π | π | π (required) |
π | π |
executable_id The ID of the sequence or regimen to execute. |
integer | π | π | π | π | π |
executable_type The type of resource to execute. |
βSequenceβ | βRegimenβ | π | π | π | π | π |
body Variable 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
device_id Unique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
key Environment variable label. |
string | π | π | π (required) |
π | π |
value Environment 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
device_id Unique device identifier set by the database. |
integer | π | Β | Β | Β | π |
disable_factory_reset Unused. |
boolean | π | Β | Β | π | π |
firmware_input_log Unused. |
boolean | π | Β | Β | π | π |
firmware_output_log Unused. |
boolean | π | Β | Β | π | π |
sequence_body_log Send a log message for each sequence step executed. |
boolean | π | Β | Β | π | π |
sequence_complete_log Send a log message upon the end of sequence execution. |
boolean | π | Β | Β | π | π |
sequence_init_log Send a log message upon the start of sequence execution. |
boolean | π | Β | Β | π | π |
network_not_found_timer Unused. |
integer | π | Β | Β | π | π |
firmware_hardware Firmware installed on the Farmduino or microcontroller. |
βarduinoβ | βfarmduinoβ | βfarmduino_k14β | βfarmduino_k15β | βfarmduino_k16β | βfarmduino_k17β | βexpress_k10β | βexpress_k11β | βexpress_k12β | π | Β | Β | π | π |
os_auto_update Automatically download and install FarmBot OS over-the-air (OTA) updates. |
boolean | π | Β | Β | π | π |
arduino_debug_messages Unused. |
boolean | π | Β | Β | π | π |
firmware_path FarmBot OS system path to the microcontroller. |
βttyUSB0β | βttyACM0β | βttyAMA0β | string | π | Β | Β | π | π |
firmware_debug_log Unused. |
boolean | π | Β | Β | π | π |
update_channel FarmBot OS OTA update channel. |
βstableβ | βbetaβ | βalphaβ | π | Β | Β | π | π |
boot_sequence_id ID of sequence to run upon boot-up. |
integer | π | Β | Β | π | π |
safe_height Z axis coordinate (millimeters) to which the z axis should be retracted during Safe Z moves. |
integer | π | Β | Β | π | π |
soil_height Z axis coordinate (millimeters) of soil level. This value will only be used if there are no soil height measurements available. |
integer | π | Β | Β | π | π |
gantry_height The 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | Β |
path Relative link to shared sequence page in the app. |
string | π | Β | Β | Β | Β |
name Sequence name. |
string | π | Β | Β | Β | Β |
description Sequence description. |
string | π | Β | Β | Β | Β |
color Sequence 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 |
---|---|---|---|---|---|---|
message Feedback content. |
string | Β | Β | π | Β | Β |
slug Source 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | π |
device_id Unique device identifier set by the database. |
integer | π | Β | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
encoder_enabled_x Enable encoders or stall detection for the x axis. |
0 | 1 | π | Β | Β | π | π |
encoder_enabled_y Enable encoders or stall detection for the y axis. |
0 | 1 | π | Β | Β | π | π |
encoder_enabled_z Enable encoders or stall detection for the z axis. |
0 | 1 | π | Β | Β | π | π |
encoder_invert_x Invert the encoders on the x axis. |
0 | 1 | π | Β | Β | π | π |
encoder_invert_y Invert the encoders on the y axis. |
0 | 1 | π | Β | Β | π | π |
encoder_invert_z Invert the encoders on the z axis. |
0 | 1 | π | Β | Β | π | π |
encoder_missed_steps_decay_x Reduction to missed step total for every good step for the x axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_decay_y Reduction to missed step total for every good step for the y axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_decay_z Reduction to missed step total for every good step for the z axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_max_x Number of steps before the motor is considered to have stalled for the x axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_max_y Number of steps before the motor is considered to have stalled for the y axis. |
integer | π | Β | Β | π | π |
encoder_missed_steps_max_z Number of steps before the motor is considered to have stalled for the z axis. |
integer | π | Β | Β | π | π |
encoder_scaling_x 10000 * (motor resolution) / (encoder resolution). |
integer | π | Β | Β | π | π |
encoder_scaling_y 10000 * (motor resolution) / (encoder resolution). |
integer | π | Β | Β | π | π |
encoder_scaling_z 10000 * (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_x X axis length in steps. |
integer | π | Β | Β | π | π |
movement_axis_nr_steps_y Y axis length in steps. |
integer | π | Β | Β | π | π |
movement_axis_nr_steps_z Z axis length in steps. |
integer | π | Β | Β | π | π |
movement_enable_endpoints_x Enable endstops for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_enable_endpoints_y Enable endstops for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_enable_endpoints_z Enable endstops for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_at_boot_x Find home upon startup for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_at_boot_y Find home upon startup for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_at_boot_z Find home upon startup for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_spd_x X axis homing speed in steps per second. |
integer | π | Β | Β | π | π |
movement_home_spd_y Y axis homing speed in steps per second. |
integer | π | Β | Β | π | π |
movement_home_spd_z Z axis homing speed in steps per second. |
integer | π | Β | Β | π | π |
movement_home_up_x Restrict travel to negative coordinate locations for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_up_y Restrict travel to negative coordinate locations for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_home_up_z Restrict travel to negative coordinate locations for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_endpoints_x Swap the min and max limit switches for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_endpoints_y Swap the min and max limit switches for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_endpoints_z Swap the min and max limit switches for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_motor_x Invert motor direction for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_motor_y Invert motor direction for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_invert_motor_z Invert motor direction for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_keep_active_x Always power motors on the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_keep_active_y Always power motors on the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_keep_active_z Always power motors on the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_max_spd_x Max speed in steps per second for the x axis. |
integer | π | Β | Β | π | π |
movement_max_spd_y Max speed in steps per second for the y axis. |
integer | π | Β | Β | π | π |
movement_max_spd_z Max speed in steps per second for the z axis. |
integer | π | Β | Β | π | π |
movement_min_spd_x Minimum speed in steps per second for the x axis. |
integer | π | Β | Β | π | π |
movement_min_spd_y Minimum speed in steps per second for the y axis. |
integer | π | Β | Β | π | π |
movement_min_spd_z Minimum speed in steps per second for the z axis. |
integer | π | Β | Β | π | π |
movement_secondary_motor_invert_x Invert the direction of the 2nd x axis motor. |
0 | 1 | π | Β | Β | π | π |
movement_secondary_motor_x Enable the 2nd x axis motor. |
0 | 1 | π | Β | Β | π | π |
movement_step_per_mm_x Number of steps per millimeter on the x axis. |
integer | π | Β | Β | π | π |
movement_step_per_mm_y Number of steps per millimeter on the y axis. |
integer | π | Β | Β | π | π |
movement_step_per_mm_z Number of steps per millimeter on the z axis. |
integer | π | Β | Β | π | π |
movement_steps_acc_dec_x Number of steps used to accelerate for the x axis. |
integer | π | Β | Β | π | π |
movement_steps_acc_dec_y Number of steps used to accelerate for the y axis. |
integer | π | Β | Β | π | π |
movement_steps_acc_dec_z Number of steps used to accelerate for the z axis. |
integer | π | Β | Β | π | π |
movement_stop_at_home_x Enable stop at home for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_home_y Enable stop at home for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_home_z Enable stop at home for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_max_x Enable stop at max for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_max_y Enable stop at max for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_stop_at_max_z Enable stop at max for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_timeout_x Amount of time to wait for a command to execute before stopping in seconds for the x axis. |
integer | π | Β | Β | π | π |
movement_timeout_y Amount of time to wait for a command to execute before stopping in seconds for the y axis. |
integer | π | Β | Β | π | π |
movement_timeout_z Amount of time to wait for a command to execute before stopping in seconds for the z axis. |
integer | π | Β | Β | π | π |
param_config_ok Unused. |
integer | π | Β | Β | π | π |
param_e_stop_on_mov_err E-Stop upon movement error. |
0 | 1 | π | Β | Β | π | π |
param_mov_nr_retry Number of times to retry a movement. |
integer | π | Β | Β | π | π |
param_test Unused. |
integer | π | Β | Β | π | π |
param_use_eeprom Unused. |
0 | 1 | π | Β | Β | π | π |
param_version Unused. |
integer | π | Β | Β | π | π |
pin_guard_1_active_state Pin guard 1 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_1_pin_nr Pin guard 1 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_1_time_out Pin guard 1 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
pin_guard_2_active_state Pin guard 2 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_2_pin_nr Pin guard 2 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_2_time_out Pin guard 2 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
pin_guard_3_active_state Pin guard 3 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_3_pin_nr Pin guard 3 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_3_time_out Pin guard 3 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
pin_guard_4_active_state Pin guard 4 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_4_pin_nr Pin guard 4 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_4_time_out Pin guard 4 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
pin_guard_5_active_state Pin guard 5 active state. |
0 | 1 | π | Β | Β | π | π |
pin_guard_5_pin_nr Pin guard 5 pin number. |
0-69 | π | Β | Β | π | π |
pin_guard_5_time_out Pin guard 5 number of seconds before turning the pin to the inactive state. |
integer | π | Β | Β | π | π |
movement_invert_2_endpoints_x Enable for normally closed (NC), disable for normally open (NO). |
0 | 1 | π | Β | Β | π | π |
movement_invert_2_endpoints_y Enable for normally closed (NC), disable for normally open (NO). |
0 | 1 | π | Β | Β | π | π |
movement_invert_2_endpoints_z Enable for normally closed (NC), disable for normally open (NO). |
0 | 1 | π | Β | Β | π | π |
movement_microsteps_x Number of microsteps per step on the x axis. |
integer | π | Β | Β | π | π |
movement_microsteps_y Number of microsteps per step on the y axis. |
integer | π | Β | Β | π | π |
movement_microsteps_z Number of microsteps per step on the z axis. |
integer | π | Β | Β | π | π |
movement_motor_current_x Motor current on the x axis. |
0-1823 | π | Β | Β | π | π |
movement_motor_current_y Motor current on the y axis. |
0-1823 | π | Β | Β | π | π |
movement_motor_current_z Motor current on the z axis. |
0-1823 | π | Β | Β | π | π |
movement_stall_sensitivity_x Stall sensitivity on the x axis. Lower is more sensitive. |
-63-63 | π | Β | Β | π | π |
movement_stall_sensitivity_y Stall sensitivity on the y axis. Lower is more sensitive. |
-63-63 | π | Β | Β | π | π |
movement_stall_sensitivity_z Stall sensitivity on the z axis. Lower is more sensitive. |
-63-63 | π | Β | Β | π | π |
movement_min_spd_z2 Min speed in steps per second for z axis movements towards home. |
integer | π | Β | Β | π | π |
movement_max_spd_z2 Maximum speed in steps per second for z axis movements towards home. |
integer | π | Β | Β | π | π |
movement_steps_acc_dec_z2 Number of steps used for acceleration for z axis movements towards home. |
integer | π | Β | Β | π | π |
movement_calibration_retry_x Number of times to retry calibration for the x axis. |
integer | π | Β | Β | π | π |
movement_calibration_retry_y Number of times to retry calibration for the y axis. |
integer | π | Β | Β | π | π |
movement_calibration_retry_z Number of times to retry calibration for the z axis. |
integer | π | Β | Β | π | π |
movement_calibration_deadzone_x Distance in steps to group calibration retries for the x axis. |
integer | π | Β | Β | π | π |
movement_calibration_deadzone_y Distance in steps to group calibration retries for the y axis. |
integer | π | Β | Β | π | π |
movement_calibration_deadzone_z Distance in steps to group calibration retries for the z axis. |
integer | π | Β | Β | π | π |
movement_axis_stealth_x Enable quiet mode for the x axis. |
0 | 1 | π | Β | Β | π | π |
movement_axis_stealth_y Enable quiet mode for the y axis. |
0 | 1 | π | Β | Β | π | π |
movement_axis_stealth_z Enable quiet mode for the z axis. |
0 | 1 | π | Β | Β | π | π |
movement_calibration_retry_total_x Total number of times to retry calibration for the x axis. |
integer | π | Β | Β | π | π |
movement_calibration_retry_total_y Total number of times to retry calibration for the y axis. |
integer | π | Β | Β | π | π |
movement_calibration_retry_total_z Total number of times to retry calibration for the z axis. |
integer | π | Β | Β | π | π |
pin_report_1_pin_nr Report values of the pin periodically. |
0-69 | π | Β | Β | π | π |
pin_report_2_pin_nr Report 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
parent_id ID of the parent folder, if any. |
integer | null | π | π | π | π (required) |
π |
name Folder name. |
string | π | π | π (required) |
π | π |
color Folder 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | Β | π | Β | Β | Β |
created_at Date and time of creation set by the database. |
timestamp | Β | π | Β | Β | Β |
updated_at Date and time of most recent update set by the database. |
timestamp | Β | π | Β | Β | Β |
href Link. |
string | Β | π | Β | Β | Β |
href_label Label for link button. |
string | Β | π | Β | Β | Β |
slug UUID. |
string | Β | π | Β | Β | Β |
title Bulletin title. |
string | Β | π | Β | Β | Β |
type Bulletin type. |
βinfoβ | βsuccessβ | βwarnβ | Β | π | Β | Β | Β |
content Bulletin 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_VERSION FarmBot OS version to give end-of-life warning. |
string | π | Β | Β | Β | Β |
MINIMUM_FBOS_VERSION Oldest FarmBot OS version allowed to connect. |
string | π | Β | Β | Β | Β |
TOS_URL Terms of service URL. |
string | π | Β | Β | Β | Β |
PRIV_URL Privacy policy URL. |
string | π | Β | Β | Β | Β |
NODE_ENV Node environment. |
βdevelopmentβ | βproductionβ | βtestβ | π | Β | Β | Β | Β |
LONG_REVISION Hash of the current Web App GitHub commit. |
string | π | Β | Β | Β | Β |
SHORT_REVISION First 8 characters of the current Web App GitHub commit hash. |
string | π | Β | Β | Β | Β |
MQTT_WS MQTT 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
device_id Unique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
attachment_processed_at Date and time when image was processed. |
timestamp | π | π | π | Β | π |
attachment_url Image URL. |
string | π | π | π (required) |
Β | π |
meta Image 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
channels Array of transmission channels. |
(βtickerβ | βtoastβ | βemailβ | βespeakβ)[] | π | Β | π | Β | π |
message Log message. |
string | π | Β | π (required) |
Β | π |
meta Unused. |
null | π | Β | π | Β | π |
major_version FarmBot OS major version. |
string | π | Β | π | Β | π |
minor_version FarmBot OS minor version. |
string | π | Β | π | Β | π |
patch_version FarmBot OS patch version. |
string | π | Β | π | Β | π |
type Log type. |
βassertionβ | βbusyβ | βdebugβ | βerrorβ | βfunβ | βinfoβ | βsuccessβ | βwarnβ | π | Β | π | Β | π |
verbosity Log level. |
0-3 | π | Β | π | Β | π |
x x coordinate at time of log. |
float | π | Β | π | Β | π |
y y coordinate at time of log. |
float | π | Β | π | Β | π |
z z 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 |
---|---|---|---|---|---|---|
message Log message. |
string | π | Β | Β | Β | Β |
type Log type. |
βassertionβ | βbusyβ | βdebugβ | βerrorβ | βfunβ | βinfoβ | βsuccessβ | βwarnβ | π | Β | Β | Β | Β |
verbosity Log level. |
0-3 | π | Β | Β | Β | Β |
x x coordinate at time of log. |
float | π | Β | Β | Β | Β |
y y coordinate at time of log. |
float | π | Β | Β | Β | Β |
z z 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 |
---|---|---|---|---|---|---|
email Account email address. |
string | Β | Β | π (required) |
Β | Β |
change
Method | Description |
---|---|
PATCH /api/password_resets |
Change the account password. |
Field | Type | GET |
GET/:id |
POST |
PATCH |
DELETE |
---|---|---|---|---|---|---|
password New account password. |
string | Β | Β | Β | π (required) |
Β |
password_confirmation New account password. |
string | Β | Β | Β | π (required) |
Β |
id Token. |
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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
pin Pin number. |
integer | π | π | π (required) |
π | π |
label Peripheral name. |
string | π | π | π (required) |
π | π |
mode Pin 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
device_id Unique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
sequence_id ID of sequence to execute. |
integer | null | π | π | π | π | π |
special_action Action to perform. |
βemergency_lockβ | βemergency_unlockβ | βpower_offβ | βread_statusβ | βrebootβ | βsyncβ | βtake_photoβ | null | π | π | π | π | π |
pin_num Button 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
device_id Unique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
saved_garden_id ID of the saved garden to which the plant belongs. |
integer | π | Β | π (required) |
π | π |
radius Size of the plant. |
float | π | Β | π | π | π |
x x coordinate. |
float | π | Β | π (required) |
π | π |
y y coordinate. |
float | π | Β | π (required) |
π | π |
z z coordinate. |
float | π | Β | π | π | π |
name Plant name. |
string | π | Β | π | π | π |
openfarm_slug Plant 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
name Group name. |
string | π | π | π (required) |
π | π |
point_ids Array of manually included point IDs. |
integer[] | π | π | π (required) |
π | π |
sort_type Sort type. See point group sorting. |
βxy_ascendingβ | βxy_descendingβ | βyx_ascendingβ | βyx_descendingβ | βxy_alternatingβ | βyx_alternatingβ | βnnβ | βrandomβ | π | π | π | π | π |
criteria Point 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 |
---|---|---|---|---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π | β | β | β | β |
device_id Unique device identifier set by the database. |
integer | π | π | Β | Β | π | β | β | β | β |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π | β | β | β | β |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π | β | β | β | β |
name Point name. |
string | π | π | π | π | π | β | β | β | β |
pointer_type Point type. |
βGenericPointerβ | βPlantβ | βToolSlotβ | βWeedβ | π | π | π (required) |
π | π | β | β | β | β |
meta Additional properties. |
object | π | π | π | π | π | β | β | β | β |
x x coordinate. |
float | π | π | π (required) |
π | π | β | β | β | β |
y y coordinate. |
float | π | π | π (required) |
π | π | β | β | β | β |
z z coordinate. |
float | π | π | π (required) |
π | π | β | β | β | β |
openfarm_slug Plant type (from OpenFarm). |
string | π | π | π | π | π | β | Β | Β | Β |
plant_stage Point status. |
βplannedβ | βplantedβ | βharvestedβ | βsproutedβ | βactiveβ | βremovedβ | βpendingβ | π | π | π | π | π | β | Β | β | Β |
planted_at Date and time planted in garden. |
timestamp | π | π | π | π | π | β | Β | Β | Β |
discarded_at Date and time deleted. |
timestamp | π | π | Β | Β | π | Β | β | β | Β |
radius Point radius. |
float | π | π | π | π | π | β | β | β | Β |
depth Plant depth. |
integer | π | π | π | π | π | β | Β | Β | Β |
water_curve_id ID of the water curve for the plant. |
integer | π | π | π | π | π | β | Β | Β | Β |
spread_curve_id ID of the spread curve for the plant. |
integer | π | π | π | π | π | β | Β | Β | Β |
height_curve_id ID of the height curve for the plant. |
integer | π | π | π | π | π | β | Β | Β | Β |
pullout_direction Tool slot direction. |
0-4 | π | π | π | π | π | Β | Β | Β | β |
tool_id ID of the tool in the tool slot. |
integer | π | π | π | π | π | Β | Β | Β | β |
gantry_mounted Is the tool slot mounted on the gantry? |
boolean | π | π | π | π | π | Β | Β | Β | β |
filter Filter 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 |
---|---|---|---|---|---|---|
radius Point size. |
float | π | Β | Β | Β | Β |
depth Plant depth. |
integer | π | Β | Β | Β | Β |
name Point name. |
string | π | Β | Β | Β | Β |
pointer_type Point type. |
βGenericPointerβ | βPlantβ | βToolSlotβ | βWeedβ | π | Β | Β | Β | Β |
meta Additional properties. |
object | π | Β | Β | Β | Β |
x x coordinate. |
float | π | Β | Β | Β | Β |
y y coordinate. |
float | π | Β | Β | Β | Β |
z z coordinate. |
float | π | Β | Β | Β | Β |
openfarm_slug Plant type (from OpenFarm). |
string | π | Β | Β | Β | Β |
plant_stage Point 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
device_id Unique device identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
name Regimen name. |
string | π | π | π (required) |
π | π |
color Regimen color. |
βblueβ | βgreenβ | βyellowβ | βorangeβ | βpurpleβ | βpinkβ | βgrayβ | βredβ | π | π | π (required) |
π | π |
body Variable data. |
Array | π | π | π | π | π |
regimen_items Sequence 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | Β |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | Β |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | Β |
image_url URL of FarmBot OS release .fw file. |
string | π | Β | Β | Β | Β |
version FarmBot OS release version. |
string | π | Β | Β | Β | Β |
platform FarmBot OS computer model. |
βrpiβ | βrpi3β | βrpi4β | π | Β | Β | Β | Β |
channel Release channel. |
βstableβ | βbetaβ | βalphaβ | π | Β | Β | Β | Β |
dot_img_url URL 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | π |
device_id Unique device identifier set by the database. |
integer | π | Β | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
name Saved garden name. |
string | π | Β | π (required) |
π | π |
notes Notes. |
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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
mode Sensor pin read mode, 0 for digital, 1 for analog. |
0 | 1 | π | π | π | Β | π |
pin Sensor pin number. |
0-69 | π | π | π (required) |
Β | π |
value Sensor value. |
0-1023 | π | π | π (required) |
Β | π |
x x coordinate. |
float | π | π | π (required) |
Β | π |
y y coordinate. |
float | π | π | π (required) |
Β | π |
z z coordinate. |
float | π | π | π (required) |
Β | π |
read_at Date 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
mode Sensor pin read mode, 0 for digital, 1 for analog. |
0 | 1 | π | π | π (required) |
π | π |
pin Sensor pin number. |
0-69 | π | π | π (required) |
π | π |
label Sensor 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | Β | π | Β | Β | Β |
created_at Date and time of creation set by the database. |
timestamp | Β | π | Β | Β | Β |
description Sequence description. |
string | Β | π | Β | Β | Β |
copyright Copyright holder. |
string | Β | π | Β | Β | Β |
name Sequence name. |
string | Β | π | Β | Β | Β |
color Sequence color. |
βblueβ | βgreenβ | βyellowβ | βorangeβ | βpurpleβ | βpinkβ | βgrayβ | βredβ | Β | π | Β | Β | Β |
kind βsequenceβ. |
βsequenceβ | Β | π | Β | Β | Β |
args Scope declaration. |
Object | Β | π | Β | Β | Β |
body Sequence 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
args Scope declaration. |
Object | π | π | π | π (required) |
π |
color Sequence color. |
βblueβ | βgreenβ | βyellowβ | βorangeβ | βpurpleβ | βpinkβ | βgrayβ | βredβ | π | π | π | π | π |
folder_id ID of the parent folder. |
integer | π | π | π | π | π |
forked Local changes to a shared sequence. |
boolean | π | π | π | π | π |
name Sequence name. |
string | π | π | π (required) |
π (required) |
π |
pinned Add the sequence to the pinned sequence list. |
boolean | π | π | π | π | π |
copyright Copyright holder. |
string | π | π | π | π | π |
description Sequence description (markdown). |
string | π | π | π | π | π |
sequence_versions A list of published versions of the sequence. |
integer[] | π | π | π | π | π |
sequence_version_id ID of the sequence version the sequence was imported from. |
integer | π | π | π | π | π |
kind βsequenceβ |
βsequenceβ | π | π | π | π | π |
body Sequence 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 |
---|---|---|---|---|---|---|
copyright Copyright 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
target FarmBot OS computer model. |
βrpiβ | βrpi3β | βrpi4β | π | Β | π (required) |
Β | π |
soc_temp CPU temperature. |
integer | π | Β | π | Β | π |
throttled RPi throttle state. |
β0x#####β | π | Β | π | Β | π |
wifi_level_percent WiFi signal strength percent. |
0-100 | π | Β | π | Β | π |
uptime Time in seconds since boot. |
integer | π | Β | π | Β | π |
memory_usage Memory usage in MB. |
integer | π | Β | π | Β | π |
disk_usage Disk usage in percent. |
0-100 | π | Β | π | Β | π |
cpu_usage CPU usage in percent. |
0-100 | π | Β | π | Β | π |
fbos_version FarmBot OS semver version string. |
string | π | Β | π | Β | π |
firmware_hardware Firmware 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 |
---|---|---|---|---|---|---|
token Token. |
Object. (see below) | π | Β | π | Β | π |
user User. |
Object. (see users) | Β | Β | π | Β | π |
Token
Field | Type |
---|---|
unencoded Unencoded token information. |
Object. (see below) |
encoded Encoded token to use in request header. |
string |
Unencoded Token
Field | Type |
---|---|
aud Audience. |
string |
sub User ID. |
integer |
iat Created at timestamp. |
integer |
jti JTI. |
string |
iss API address. |
string |
exp Expiration. |
integer |
mqtt MQTT URL. |
string |
bot Device ID string (username). |
string |
vhost vhost. |
string |
mqtt_ws MQTT 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
name Tool name. |
string | π | π | π (required) |
π | π |
status Whether 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_s Watering 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
name User name. |
string | π | Β | π (required) |
π | Β |
email Email address. |
string | π | Β | π (required) |
π | Β |
password Password. |
string | Β | Β | π (required) |
Β | Β |
password_confirmation Password. |
string | Β | Β | π (required) |
Β | Β |
new_password Password. |
string | Β | Β | Β | Β | π |
new_password_confirmation Password. |
string | Β | Β | Β | Β | π |
agree_to_terms Agreed to terms?. |
boolean | Β | Β | π | Β | Β |
language User 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 |
---|---|---|---|---|---|---|
email Email address. |
string | Β | Β | π (required) |
Β | Β |
password Password. |
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 |
---|---|---|---|---|---|---|
email Email 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | π |
device_id Unique device identifier set by the database. |
integer | π | Β | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
confirm_step_deletion Show a confirmation dialog when deleting a sequence step. |
boolean | π | Β | Β | π | π |
disable_animations Disable plant animations in the garden map. |
boolean | π | Β | Β | π | π |
disable_i18n Set the Web App to English. |
boolean | π | Β | Β | π | π |
display_trail Display 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_map Change 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_figure Show a virtual farmbot in the garden map at the encoder position as well as motor position. |
boolean | π | Β | Β | π | π |
hide_webcam_widget Unused. |
boolean | π | Β | Β | π | π |
legend_menu_open Show the garden map legend. |
boolean | π | Β | Β | π | π |
raw_encoders Show raw encoder values. |
boolean | π | Β | Β | π | π |
scaled_encoders Show scaled encoder values. |
boolean | π | Β | Β | π | π |
show_spread Show plant spread in the garden map. |
boolean | π | Β | Β | π | π |
show_farmbot Show FarmBot in the garden map. |
boolean | π | Β | Β | π | π |
show_plants Show plants in the garden map. |
boolean | π | Β | Β | π | π |
show_points Show map points in the garden ma. |
boolean | π | Β | Β | π | π |
x_axis_inverted Invert x axis jog buttons. |
boolean | π | Β | Β | π | π |
y_axis_inverted Invert y axis jog buttons. |
boolean | π | Β | Β | π | π |
z_axis_inverted Invert z axis jog buttons. |
boolean | π | Β | Β | π | π |
bot_origin_quadrant Select a map origin by clicking on one of the four quadrants to adjust the garden map to your viewing angle. |
1-4 | π | Β | Β | π | π |
zoom_level Garden map zoom level. |
-9-3 | π | Β | Β | π | π |
success_log Success log verbosity setting. |
0-3 | π | Β | Β | π | π |
busy_log Busy log verbosity setting. |
0-3 | π | Β | Β | π | π |
warn_log Warning log verbosity setting. |
0-3 | π | Β | Β | π | π |
error_log Error log verbosity setting. |
0-3 | π | Β | Β | π | π |
info_log Info log verbosity setting. |
0-3 | π | Β | Β | π | π |
fun_log Fun log verbosity setting. |
0-3 | π | Β | Β | π | π |
debug_log Debug log verbosity setting. |
0-3 | π | Β | Β | π | π |
stub_config Sub config. |
boolean | π | Β | Β | π | π |
show_first_party_farmware Unused. |
boolean | π | Β | Β | π | π |
enable_browser_speak Have the browser also read aloud log messages on the βSpeakβ channel that are spoken by FarmBot. |
boolean | π | Β | Β | π | π |
show_images Show photos in the garden map. |
boolean | π | Β | Β | π | π |
photo_filter_begin Show photos after this date and time. |
timestamp | null | π | Β | Β | π | π |
photo_filter_end Show photos before this date and time. |
timestamp | null | π | Β | Β | π | π |
discard_unsaved Donβt ask about saving work before closing browser tab. Warning: may cause loss of data. |
boolean | π | Β | Β | π | π |
xy_swap Swap 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_homing Configure the home button to find home instead of moving to home. |
boolean | π | Β | Β | π | π |
show_motor_plot Show motor position graph. |
boolean | π | Β | Β | π | π |
show_historic_points Show removed weeds in the garden map. |
boolean | π | Β | Β | π | π |
show_sensor_readings Show sensor readings in the garden map. |
boolean | π | Β | Β | π | π |
show_dev_menu Unused. |
boolean | π | Β | Β | π | π |
internal_use Developer setting storage. |
string | π | Β | Β | π | π |
time_format_24_hour Display times using the 24-hour format. |
boolean | π | Β | Β | π | π |
show_pins Show raw pin lists in Read Sensor, Control Peripheral, and If Statement steps. |
boolean | π | Β | Β | π | π |
disable_emergency_unlock_confirmation Donβt confirm when unlocking FarmBot after an emergency stop. |
boolean | π | Β | Β | π | π |
map_size_x Custom x map dimension (in millimeters). These values set the size of the garden map unless dynamic_map is enabled. |
integer | π | Β | Β | π | π |
map_size_y Custom y map dimension (in millimeters). These values set the size of the garden map unless dynamic_map is enabled. |
integer | π | Β | Β | π | π |
expand_step_options Choose whether advanced step options are open or closed by default. |
boolean | π | Β | Β | π | π |
hide_sensors Hide the sensors panel. |
boolean | π | Β | Β | π | π |
confirm_plant_deletion Show a confirmation dialog when deleting a plant. |
boolean | π | Β | Β | π | π |
confirm_sequence_deletion Show a confirmation dialog when deleting a sequence. |
boolean | π | Β | Β | π | π |
discard_unsaved_sequences Donβt ask about saving sequence work before closing browser tab. Warning: may cause loss of data. |
boolean | π | Β | Β | π | π |
user_interface_read_only_mode Disallow account data changes. This does not prevent Lua or FarmBot OS from changing settings. |
boolean | π | Β | Β | π | π |
assertion_log Assertion log verbosity setting. |
0-3 | π | Β | Β | π | π |
show_zones Show point group location areas in the garden map. |
boolean | π | Β | Β | π | π |
show_weeds Show weeds in the garden map. |
boolean | π | Β | Β | π | π |
display_map_missed_steps Display high motor load warning indicators in map. Requires display_trail and stall detection to be enabled. |
boolean | π | Β | Β | π | π |
time_format_seconds Add seconds to time displays. |
boolean | π | Β | Β | π | π |
crop_images Crop images displayed in the garden map to remove black borders from image rotation. Crop amount determined by CAMERA ROTATION value. |
boolean | π | Β | Β | π | π |
show_camera_view_area Show the cameraβs field of view in the garden map. |
boolean | π | Β | Β | π | π |
view_celery_script View raw data representation of sequence steps. |
boolean | π | Β | Β | π | π |
highlight_modified_settings Highlight settings that have been changed from their default values. |
boolean | π | Β | Β | π | π |
show_advanced_settings Show advanced settings. |
boolean | π | Β | Β | π | π |
show_soil_interpolation_map Show soil height interpolation map in the garden map. |
boolean | π | Β | Β | π | π |
show_moisture_interpolation_map Show soil moisture interpolation map in the garden map. |
boolean | π | Β | Β | π | π |
clip_image_layer Remove portions of images that extend beyond the garden map boundaries. |
boolean | π | Β | Β | π | π |
beep_verbosity Beep upon log message verbosity level. |
0-3 | π | Β | Β | π | π |
landing_page Panel to show upon loading the app. |
string | π | Β | Β | π | π |
go_button_axes Default axes to move when a GO TO LOCATION button is pressed. |
βXβ | βYβ | βZβ | βXYβ | βXYZβ | π | Β | Β | π | π |
show_uncropped_camera_view_area Show the cameraβs uncropped and unrotated field of view in the garden map when clip_image_layer is enabled. |
boolean | π | Β | Β | π | π |
default_plant_depth When adding plants to the map from the web app, set each new plantβs depth to this value (in millimeters). |
integer | π | Β | Β | π | π |
show_missed_step_plot Show motor load graph. |
boolean | π | Β | Β | π | π |
enable_3d_electronics_box_top Show 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | π | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | π | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | π | Β | Β | π |
name Webcam feed label. |
string | π | π | π (required) |
π | π |
url Webcam 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 |
---|---|---|---|---|---|---|
id Unique identifier set by the database. |
integer | π | Β | Β | Β | π |
created_at Date and time of creation set by the database. |
timestamp | π | Β | Β | Β | π |
updated_at Date and time of most recent update set by the database. |
timestamp | π | Β | Β | Β | π |
answer Wizard step success? |
boolean | π | Β | π | π | π |
outcome Error message. |
string | π | Β | π | π | π |
slug Wizard 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"
}
]