Overview
Plots are subdivisions within a garden. Each plot has a type (raised bed, container, etc.) and can contain multiple plants. Plots track dimensions, soil type, and sun exposure to help optimize growing conditions.
Endpoints
| Method | Path | Description | Auth Required |
|---|---|---|---|
GET | /gardens/:id/plots | List plots in a garden | Yes |
POST | /gardens/:id/plots | Create a plot in a garden | Yes |
GET | /plots/:id | Get plot details | Yes |
PUT | /plots/:id | Update a plot | Yes |
DELETE | /plots/:id | Delete a plot | Yes |
Plot Types
| Value | Description |
|---|---|
raised_bed | Above-ground bed with imported soil |
in_ground | Traditional in-ground planting |
container | Pots, grow bags, or other containers |
greenhouse | Enclosed greenhouse growing |
indoor | Indoor growing (windowsill, grow lights) |
hydroponic | Soilless hydroponic or aeroponic system |
List Plots
Retrieve all plots within a garden.
GET /gardens/:gardenId/plots
Path Parameters
| Parameter | Type | Description |
|---|---|---|
gardenId | string | The garden’s ID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
per_page | integer | 20 | Items per page (max 100) |
Response 200 OK
{
"data": [
{
"id": "plt_m3n4o5p6",
"garden_id": "gdn_a1b2c3d4",
"name": "Tomato Beds",
"plot_type": "raised_bed",
"width_cm": 120,
"length_cm": 240,
"soil_type": "loam",
"sun_exposure": "full_sun",
"plant_count": 6,
"created_at": "2026-01-20T09:00:00Z",
"updated_at": "2026-03-01T11:30:00Z"
},
{
"id": "plt_q7r8s9t0",
"garden_id": "gdn_a1b2c3d4",
"name": "Herb Containers",
"plot_type": "container",
"width_cm": null,
"length_cm": null,
"soil_type": "potting_mix",
"sun_exposure": "partial_sun",
"plant_count": 8,
"created_at": "2026-02-05T14:00:00Z",
"updated_at": "2026-02-05T14:00:00Z"
}
],
"total": 2,
"page": 1,
"per_page": 20
}
Examples
cURL
curl -X GET "https://garden.gg/api/v1/gardens/gdn_a1b2c3d4/plots" \
-H "Authorization: Bearer gg_live_your_api_key_here"
Python
import requests
headers = {"Authorization": "Bearer gg_live_your_api_key_here"}
response = requests.get(
"https://garden.gg/api/v1/gardens/gdn_a1b2c3d4/plots",
headers=headers,
)
plots = response.json()
for plot in plots["data"]:
print(f"{plot['name']} ({plot['plot_type']}) — {plot['plant_count']} plants")
Node.js
const response = await fetch(
"https://garden.gg/api/v1/gardens/gdn_a1b2c3d4/plots",
{ headers: { Authorization: "Bearer gg_live_your_api_key_here" } }
);
const { data: plots } = await response.json();
plots.forEach((p) =>
console.log(`${p.name} (${p.plot_type}) — ${p.plant_count} plants`)
);
Create Plot
Add a new plot to a garden.
POST /gardens/:gardenId/plots
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Plot name (1-100 characters) |
plot_type | string | Yes | One of the supported plot types (see above) |
width_cm | integer | No | Width in centimeters |
length_cm | integer | No | Length in centimeters |
soil_type | string | No | Soil type (e.g., loam, clay, sandy, potting_mix) |
sun_exposure | string | No | One of: full_sun, partial_sun, partial_shade, full_shade |
Request
{
"name": "Pepper Patch",
"plot_type": "raised_bed",
"width_cm": 100,
"length_cm": 200,
"soil_type": "loam",
"sun_exposure": "full_sun"
}
Response 201 Created
{
"id": "plt_u1v2w3x4",
"garden_id": "gdn_a1b2c3d4",
"name": "Pepper Patch",
"plot_type": "raised_bed",
"width_cm": 100,
"length_cm": 200,
"soil_type": "loam",
"sun_exposure": "full_sun",
"plant_count": 0,
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}
Examples
cURL
curl -X POST "https://garden.gg/api/v1/gardens/gdn_a1b2c3d4/plots" \
-H "Authorization: Bearer gg_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Pepper Patch",
"plot_type": "raised_bed",
"width_cm": 100,
"length_cm": 200,
"soil_type": "loam",
"sun_exposure": "full_sun"
}'
Python
import requests
response = requests.post(
"https://garden.gg/api/v1/gardens/gdn_a1b2c3d4/plots",
headers={
"Authorization": "Bearer gg_live_your_api_key_here",
"Content-Type": "application/json",
},
json={
"name": "Pepper Patch",
"plot_type": "raised_bed",
"width_cm": 100,
"length_cm": 200,
"soil_type": "loam",
"sun_exposure": "full_sun",
},
)
plot = response.json()
print(f"Created plot: {plot['id']}")
Node.js
const response = await fetch(
"https://garden.gg/api/v1/gardens/gdn_a1b2c3d4/plots",
{
method: "POST",
headers: {
Authorization: "Bearer gg_live_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Pepper Patch",
plot_type: "raised_bed",
width_cm: 100,
length_cm: 200,
soil_type: "loam",
sun_exposure: "full_sun",
}),
}
);
const plot = await response.json();
console.log(`Created plot: ${plot.id}`);
Get Plot
Retrieve a single plot with its details and plant summary.
GET /plots/:id
Response 200 OK
{
"id": "plt_m3n4o5p6",
"garden_id": "gdn_a1b2c3d4",
"name": "Tomato Beds",
"plot_type": "raised_bed",
"width_cm": 120,
"length_cm": 240,
"soil_type": "loam",
"sun_exposure": "full_sun",
"plant_count": 6,
"plants": [
{
"id": "plt_y5z6a7b8",
"plant_name": "Cherokee Purple Tomato",
"variety": "Cherokee Purple",
"planted_date": "2026-04-15T00:00:00Z",
"status": "growing"
}
],
"created_at": "2026-01-20T09:00:00Z",
"updated_at": "2026-03-01T11:30:00Z"
}
Update Plot
Update an existing plot. Only include the fields you want to change.
PUT /plots/:id
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Plot name |
plot_type | string | No | Plot type |
width_cm | integer | No | Width in centimeters |
length_cm | integer | No | Length in centimeters |
soil_type | string | No | Soil type |
sun_exposure | string | No | Sun exposure level |
Response 200 OK
Returns the full updated plot object.
Delete Plot
Delete a plot and all associated plants and events. This action is irreversible.
DELETE /plots/:id
Response 204 No Content
No response body.
Error Responses
| Scenario | HTTP Status | Error Code |
|---|---|---|
| Plot not found | 404 | NOT_FOUND |
| Garden not found | 404 | NOT_FOUND |
| Invalid plot type | 400 | VALIDATION_ERROR |
| Missing required fields | 400 | VALIDATION_ERROR |
| Not your plot | 403 | FORBIDDEN |
| Not authenticated | 401 | UNAUTHORIZED |