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

MethodPathDescriptionAuth Required
GET/gardens/:id/plotsList plots in a gardenYes
POST/gardens/:id/plotsCreate a plot in a gardenYes
GET/plots/:idGet plot detailsYes
PUT/plots/:idUpdate a plotYes
DELETE/plots/:idDelete a plotYes

Plot Types

ValueDescription
raised_bedAbove-ground bed with imported soil
in_groundTraditional in-ground planting
containerPots, grow bags, or other containers
greenhouseEnclosed greenhouse growing
indoorIndoor growing (windowsill, grow lights)
hydroponicSoilless hydroponic or aeroponic system

List Plots

Retrieve all plots within a garden.

GET /gardens/:gardenId/plots

Path Parameters

ParameterTypeDescription
gardenIdstringThe garden’s ID

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger20Items 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

FieldTypeRequiredDescription
namestringYesPlot name (1-100 characters)
plot_typestringYesOne of the supported plot types (see above)
width_cmintegerNoWidth in centimeters
length_cmintegerNoLength in centimeters
soil_typestringNoSoil type (e.g., loam, clay, sandy, potting_mix)
sun_exposurestringNoOne 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

FieldTypeRequiredDescription
namestringNoPlot name
plot_typestringNoPlot type
width_cmintegerNoWidth in centimeters
length_cmintegerNoLength in centimeters
soil_typestringNoSoil type
sun_exposurestringNoSun 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

ScenarioHTTP StatusError Code
Plot not found404NOT_FOUND
Garden not found404NOT_FOUND
Invalid plot type400VALIDATION_ERROR
Missing required fields400VALIDATION_ERROR
Not your plot403FORBIDDEN
Not authenticated401UNAUTHORIZED