Plantings store all the details about your plantings, including the plant type, the grow location, spacing, harvest details and more. You can access plantings directly by using the planting ID or you can access just the plantings for a grow location by treating the plantings as a nested resource for the grow location. For example, the following request fetches current plantings for a grow location > Example cURL request authenticating with a PAT ``` curl https://api.farmbrite.com/v1/grow_locations/:location_id/crops \ -H "Authorization: Bearer ACCESS_TOKEN" ``` Access
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
title: Farmbrite API Developers Documentation Crops & Plantings >…
description: '# Overview
Welcome to the Farmbrite API. You can find out more about Farmbrite at
www.farmbrite.com
If you need help, check out our help center at help.farmbrite.com or email us at dev@farmbrite.com. ## API Reference
The Farmbrite API allows authorized users programatic access to their account data in order to facilitate the integration of this data with other systems and service. The API is organized around REST standards. The API uses resource-oriented URLs and returns JSON-encoded responses. It uses standard HTTP response codes, authentication, and verbs. > Base URL
```
https://api.farmbrite.com/v1
```
# Authentication
Farmbrite offers 2 authentication options for accessing the API both utilizing Personal Access Tokens (PATs) for enabling access to the API. Access Tokens (API Keys) are associated with an individual user in your account and inherit that user''s role and permissions. You can find the Access Token on the user profile page under API Key. When building an integration we recommend setting up a separate API user for the integration and changing the API KEY on a regular basis. Remember to keep your Access Tokens secret; treat them just like passwords! They act on your behalf when interacting with the API, with the same permissions and access as the user has. _Don''t hardcode them into your programs_. Instead, choose to store them as environment variables. ### Bearer Token
To make a request to the API include the Authorization Bearer header with your request and include your Access Token (API KEY) as the value. Access Token and API KEY are used interchangeably through out the documentation. > Example cURL request authenticating with Bearer Token authentication
```
curl https://api.farmbrite.com/v1/tasks \
-H "Authorization: Bearer ACCESS_TOKEN"
```
### API Key
Alternatively to using the Bearer Token authorization method, you can provide an API KEY as a header with your request. Use the header `api_key` with a value of your Access Token (API KEY). > Example cURL request authenticating with API Key header authentication
```
curl https://api.farmbrite.com/v1/tasks \
-H "api_key: ACCESS_TOKEN"
```
# Errors
Sadly, sometimes requests to the API fail. Failures can occur for a wide range of reasons. In all cases, the API should return an HTTP Status Code indicating the nature of the failure. | Code | Meaning | Description |
| --- | --- | --- |
| 200 | Success | The request was successful. If applicable the data it will be available in the data field at the top level of the response body. |
| 400 | Bad Request | Typically caused by a missing or malformed parameter. Check the documentation and your request and try again. |
| 401 | Unauthorized | No access token or an invalid access token was provided with the request. The error can also occur if the user or account is invalid or does not have access to this resource. |
| 403 | Forbidden | The authentication and request syntax was valid but the server is refusing to complete the request. This can happen if you access resources that the user or account does not have access to. |
| 404 | Not Found | Either the method and path supplied do not specify a known action or the object related to the request does not exist. |
| 429 | Too Many Requests | You have exceeded one of the rate limits in the API. See the Rate Limits section for more information. |
| 500 | Internal Server Error | There was a problem on Farmbrite''s side which was logged and reported to our technical team. You can retry, but if the problem continues please contact support. |
Details about errors can sometimes also be found in the ''message'' property at the root level of the JSON response body. # Pagination
In order to optimize performance, all list methods in the API will limit the total response data to a certain number of records and return the data in chunks (pages). API responses will include information about the total records available, the current page and total pages.'
version: 1.0.0
x-logo:
url: https://static.farmbrite.com/assets/www/images/logo.png
backgroundColor: '#FFFFFF'
altText: Farmbrite
termsOfService: https://www.farmbrite.com/terms
contact:
name: Farmbrite
url: https://developers.farmbrite.com
email: dev@farmbrite.com
servers:
- url: https://api.farmbrite.com/v1
security:
- bearerAuth: []
tags:
- name: Crops & Plantings > Crop Plantings
description: 'Plantings store all the details about your plantings, including the plant type, the grow location, spacing, harvest details and more. You can access plantings directly by using the planting ID or you can access just the plantings for a grow location by treating the plantings as a nested resource for the grow location.
For example, the following request fetches current plantings for a grow location
> Example cURL request authenticating with a PAT
```
curl https://api.farmbrite.com/v1/grow_locations/:location_id/crops \
-H "Authorization: Bearer ACCESS_TOKEN"
```
Access'
paths:
/crops:
post:
tags:
- Crops & Plantings > Crop Plantings
summary: Create a Crop Planting
description: 'Create a planting
### Parameters
**plant_id** `REQUIRED`
The Farmbrite unique ID of the plant type
---
**plot_id** `REQUIRED`
The Farmbrite unique ID of the grow location
---
**bed_id** `OPTIONAL`
The Farmbrite unique ID of the bed. Required if planting in beds
---
**planting_method** `OPTIONAL`
Planting method. Supported options are:
> "Direct Sow", "Start in Trays, Transplant in Ground", "Transplant", "Container", "Root Stock", "Bulbs", "Grafting","Other"
---
**qty** `OPTIONAL`
The number of plants in this planting
---
**spacing** `OPTIONAL`
Inches/Centimeter (based on account setting) spacing between plants
---
**row_count** `OPTIONAL`
How many rows are planted
---
**row_spacing** `OPTIONAL`
Inches/Centimeter (based on account setting) spacing between rows
---
**planting_length** `OPTIONAL`
The length of the planting in feet or meters (depending on account setting)
---
**date_planted** `OPTIONAL`
Date planted
---
**cost** `OPTIONAL`
Estimated or actual cost of planting (depending on how you want to estimate ROI)
---
**date_planned_harvest** `OPTIONAL`
The date planned to harvest
---
**date_seed_started** `OPTIONAL`
The date seeds where / should be started
---
**expected_harvest** `OPTIONAL`
Numeric amount expected to be harvested in the harvest unit of the plant type.
---
**growth_stage** `OPTIONAL`
The current growth stage of the planting. Supported options are:
> "Seed Started", "Germination", "Seedling", "Vegetative", "Flowering" , "Ripening"
---
**instructions** `OPTIONAL`
Planting directions or instructions.
---
**lot_number** `OPTIONAL`
Lot number of seed packet
---
**number_of_trays** `OPTIONAL`
The number of trays used for the planting (if planting in trays)
---
**origin** `OPTIONAL`
Seed origin, typically found on the seed packet.
---
**seed_company** `OPTIONAL`
Seed company
---
**seed_type** `OPTIONAL`
Seed type. Available options are:
> "Conventional", "GMO", "Heirloom", "Hybrid", "Organic"
---
**starts_per_tray** `OPTIONAL`
How many starts per each tray.
---
**tray_ids** `OPTIONAL`
Comma delimited list of tray numbers or ID numbers for the trays containing this planting
---
rootstock_source `OPTIONAL`
For rootstock plantings, the source/origin of the roostock
---
rootstock_source `OPTIONAL`
For rootstock plantings, the source/origin of the roostock
---
rootstock_variety `OPTIONAL`
For rootstock plantings, the variety of the roostock. Available options are:
> "Very-dwarf", "Dwarf", "Semi-drawf", "Half-standard", "Semi-standard", "Standard", "Semi-vigorous", "Vigorous"
---
rootstock_age `OPTIONAL`
For rootstock plantings, a string value for the age of the rootstock.
---
**electronic_id** `OPTIONAL`
Electronic ID - useful to set if using an RFID or barcode scanner to search for for sync data with Farmbrite.'
requestBody:
content:
application/json:
schema:
type: object
example:
bed_id: Bed ID
date_planned_harvest: '2022-02-16'
date_planted: '2021-03-10'
date_seed_started: '2021-03-10'
expected_harvest: 45.42
growth_stage: Germination
instructions: null
lot_number: ''
number_of_trays: 3
origin: ''
plant_id: Plant Type ID
planting_length: 100
planting_method: Start in Trays, Transplant in Ground
plot_id: Grow Location ID
qty: 400
row_count: 1
row_spacing: 6
seed_company: ''
seed_type: ''
spacing: 2
starts_per_tray: 64
tray_ids: 123,456,789
parameters:
- name: Content-Type
in: header
schema:
type: string
example: application/json
responses:
'200':
description: Successful response
content:
application/json: {}
operationId: postCrops
x-operation-id-source: derived
get:
tags:
- Crops & Plantings > Crop Plantings
summary: List Crop Plantings
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
example:
data:
- id: GUID
bed_id: Bed ID
count_flowering: null
count_germination: 500
count_ripening: null
count_seed_started: 600
count_seedling: null
count_vegetative: null
created_at: '2021-05-10 14:49:59'
date_flowering: null
date_germination: '2022-01-11'
date_planned_harvest: '2022-02-16'
date_planted: '2021-03-10'
date_ripening: null
date_seed_started: '2021-03-10'
date_seedling: null
date_vegetative: null
expected_harvest: 45.42
growth_stage: Germination
instructions: null
lot_number: ''
number_of_trays: 3
origin: ''
parent_id: null
plant_id: Plant Type ID
planting_length: 100
planting_method: Start in Trays, Transplant in Ground
plot_id: Grow Location ID
qty: 400
row_count: 1
row_spacing: 6
row_spacing_unit: Inches
seed_company: ''
seed_type: ''
spacing: 2
spacing_unit: Inches
starts_per_tray: 64
tray_ids: 123,456,789
updated_at: '2022-01-12 23:15:12'
operationId: getCrops
x-operation-id-source: derived
/crops/{crop_id}:
get:
tags:
- Crops & Plantings > Crop Plantings
summary: Retrieve a Crop Planting
parameters:
- name: crop_id
in: path
schema:
type: string
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
example:
id: GUID
bed_id: Bed ID
count_flowering: null
count_germination: 500
count_ripening: null
count_seed_started: 600
count_seedling: null
count_vegetative: null
created_at: '2021-05-10 14:49:59'
date_flowering: null
date_germination: '2022-01-11'
date_planned_harvest: '2022-02-16'
date_planted: '2021-03-10'
date_ripening: null
date_seed_started: '2021-03-10'
date_seedling: null
date_vegetative: null
expected_harvest: 45.42
growth_stage: Germination
instructions: null
lot_number: ''
number_of_trays: 3
origin: ''
parent_id: null
plant_id: Plant Type ID
planting_length: 100
planting_method: Start in Trays, Transplant in Ground
plot_id: Grow Location ID
qty: 400
row_count: 1
row_spacing: 6
row_spacing_unit: Inches
seed_company: ''
seed_type: ''
spacing: 2
spacing_unit: Inches
starts_per_tray: 64
tray_ids: 123,456,789
updated_at: '2022-01-12 23:15:12'
operationId: getCropsByCropId
x-operation-id-source: derived
put:
tags:
- Crops & Plantings > Crop Plantings
summary: Update a Crop Planting
requestBody:
content:
application/json:
schema:
type: object
example:
date_planned_harvest: '2022-02-16'
date_planted: '2021-03-10'
qty: 400
spacing: 3
spacing_unit: Inches
parameters:
- name: Content-Type
in: header
schema:
type: string
example: application/json
- name: crop_id
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
operationId: putCropsByCropId
x-operation-id-source: derived
delete:
tags:
- Crops & Plantings > Crop Plantings
summary: Delete a Crop Planting
parameters:
- name: crop_id
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
operationId: deleteCropsByCropId
x-operation-id-source: derived
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer