{"openapi":"3.1.0","info":{"title":"Microgreen Manager API","version":"1.0.0","description":"Read and write your farm's data. Create an API key in Account > Integrations (Pro plan) and send it as `Authorization: Bearer mm_live_...`. Each key is limited to its scopes and to what the person who created it can do in the app, and can make 60 requests per minute. Send an `Idempotency-Key` header with creates so retrying them is safe. Dates are calendar days in the farm's timezone (YYYY-MM-DD). The descriptions are shared with the MCP server, so they name other operations by their operationId. The guides they mention (like get_order_guide) are written for AI clients and only available through the MCP server."},"servers":[{"url":"https://microgreenmanager.com/api/v1"}],"security":[{"apiKey":[]}],"paths":{"/me":{"get":{"operationId":"get_account_info","summary":"Get your account and farm","description":"Get the authenticated user's account info: farm name, trial status, settings, and order/planting usage for the current and previous calendar-month periods. Subscription status/tier are included only for farm admins. Does not return email or personal name.","tags":["me"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers":{"get":{"operationId":"list_customers","summary":"List customers","description":"List customers for the authenticated user's organization, including each customer's touchpoints. No pagination — typically a small list.","tags":["customers"],"x-required-scope":"customers:read","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_customer","summary":"Create a customer","description":"Create a customer in the authenticated user's organization. Requires the same edit-orders permission as creating a customer in the app.","tags":["customers"],"x-required-scope":"customers:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Customer name."},"phone_number":{"description":"Phone number. Pass null to clear.","type":["string","null"]},"email":{"description":"Email address. Pass null to clear.","type":["string","null"]},"website":{"description":"Website. Pass null to clear.","type":["string","null"]},"address_line_1":{"description":"Address line 1. Pass null to clear.","type":["string","null"]},"address_line_2":{"description":"Address line 2. Pass null to clear.","type":["string","null"]},"city":{"description":"City. Pass null to clear.","type":["string","null"]},"postal_code":{"description":"Postal code. Pass null to clear.","type":["string","null"]},"country":{"description":"Country. Pass null to clear.","type":["string","null"]},"state_province_region":{"description":"State, province, or region. Pass null to clear.","type":["string","null"]},"notes":{"description":"Notes. Pass null to clear.","type":["string","null"]},"customer_status":{"description":"Customer status. Pass null to clear.","anyOf":[{"type":"string","enum":["cold","prospect","active"],"description":"Customer status: cold, prospect, or active."},{"type":"null"}]},"representative_name":{"description":"Representative name. Pass null to clear.","type":["string","null"]}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers/{id}":{"get":{"operationId":"get_customer","summary":"Get a customer","description":"Fetch a single customer by id, including touchpoints. Scoped to the authenticated user's organization.","tags":["customers"],"x-required-scope":"customers:read","parameters":[{"name":"id","in":"path","required":true,"description":"Customer id.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Customer id."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"edit_customer","summary":"Edit a customer","description":"Update fields on an existing customer. Only provided fields are changed. Pass null to clear an optional field. Requires the same edit-orders permission as editing a customer in the app.","tags":["customers"],"x-required-scope":"customers:write","parameters":[{"name":"id","in":"path","required":true,"description":"Customer id to update.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Customer id to update."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Customer name.","type":"string","minLength":1},"phone_number":{"description":"Phone number. Pass null to clear.","type":["string","null"]},"email":{"description":"Email address. Pass null to clear.","type":["string","null"]},"website":{"description":"Website. Pass null to clear.","type":["string","null"]},"address_line_1":{"description":"Address line 1. Pass null to clear.","type":["string","null"]},"address_line_2":{"description":"Address line 2. Pass null to clear.","type":["string","null"]},"city":{"description":"City. Pass null to clear.","type":["string","null"]},"postal_code":{"description":"Postal code. Pass null to clear.","type":["string","null"]},"country":{"description":"Country. Pass null to clear.","type":["string","null"]},"state_province_region":{"description":"State, province, or region. Pass null to clear.","type":["string","null"]},"notes":{"description":"Notes. Pass null to clear.","type":["string","null"]},"customer_status":{"description":"Customer status. Pass null to clear.","anyOf":[{"type":"string","enum":["cold","prospect","active"],"description":"Customer status: cold, prospect, or active."},{"type":"null"}]},"representative_name":{"description":"Representative name. Pass null to clear.","type":["string","null"]}},"required":[]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers/{customer_id}/touchpoints":{"post":{"operationId":"create_touchpoint","summary":"Add a touchpoint to a customer","description":"Create a customer touchpoint (a logged contact or note). created_at is a calendar date in the farm timezone and defaults to today. Requires the same edit-orders permission as creating a touchpoint in the app.","tags":["customers"],"x-required-scope":"touchpoints:write","parameters":[{"name":"customer_id","in":"path","required":true,"description":"Customer id to attach this touchpoint to.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Customer id to attach this touchpoint to."}},{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"description":"Notes for the touchpoint.","type":["string","null"]},"created_at":{"description":"Touchpoint date. Calendar date, preferably YYYY-MM-DD in the farm timezone. An ISO-8601 date-time or unix seconds is also accepted; only its calendar day in the farm timezone is kept. Defaults to today in the farm timezone.","type":["string","number"]}},"required":[]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/touchpoints/{id}":{"patch":{"operationId":"edit_touchpoint","summary":"Edit a touchpoint","description":"Update an existing touchpoint's notes and/or date. Only provided fields are changed. Requires the same edit-orders permission as editing a touchpoint in the app.","tags":["touchpoints"],"x-required-scope":"touchpoints:write","parameters":[{"name":"id","in":"path","required":true,"description":"Touchpoint id to update.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Touchpoint id to update."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"description":"Updated notes. Pass null to clear.","type":["string","null"]},"created_at":{"description":"Updated touchpoint date. Calendar date, preferably YYYY-MM-DD in the farm timezone. An ISO-8601 date-time or unix seconds is also accepted; only its calendar day in the farm timezone is kept.","type":["string","number"]}},"required":[]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"get":{"operationId":"list_orders","summary":"List orders","description":"List orders for the authenticated user's organization. Filterable by customer, status, and delivery date range.","tags":["orders"],"x-required-scope":"orders:read","parameters":[{"name":"customer_name","in":"query","required":false,"description":"Filter by exact customer name.","schema":{"description":"Filter by exact customer name.","type":"string"}},{"name":"customer_id","in":"query","required":false,"description":"Filter by customer id.","schema":{"description":"Filter by customer id.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"status","in":"query","required":false,"description":"Filter by order_status (planned, in_progress, completed).","schema":{"description":"Filter by order_status (planned, in_progress, completed).","type":"string","enum":["planned","in_progress","completed"]}},{"name":"from","in":"query","required":false,"description":"Start of delivery date range.","schema":{"description":"Start of delivery date range.","type":["string","number"]}},{"name":"to","in":"query","required":false,"description":"End of delivery date range.","schema":{"description":"End of delivery date range.","type":["string","number"]}},{"name":"limit","in":"query","required":false,"description":"Max number of items to return (1-200, default 50).","schema":{"description":"Max number of items to return (1-200, default 50).","type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"Opaque pagination cursor returned from a previous list call.","schema":{"description":"Opaque pagination cursor returned from a previous list call.","type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_order","summary":"Create an order","description":"Create a one-off order in the authenticated user's organization, with its plantings and tasks, like the app's new order form. Call preview_order with the same inputs first and confirm the result with the grower; there is no undo or delete through MCP. Returns the same shape as preview_order, plus ids. Guide: get_order_guide (microgreenmanager://guides/orders). Requires the same edit-orders permission as creating an order in the app.","tags":["orders"],"x-required-scope":"orders:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"delivery_date":{"description":"Day the customer receives the order (delivery or pickup), not the harvest day. YYYY-MM-DD in the farm timezone.","type":["string","number"]},"customer_id":{"description":"Existing customer from list_customers. The order is saved under their name. Use this or customer_name.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"customer_name":{"description":"Name of a customer who is not in list_customers yet. Use this or customer_id.","type":"string","minLength":1,"maxLength":255},"save_customer":{"description":"With customer_name: also save them as a new customer, like the app does by default (default true). False keeps the name on this order only.","type":"boolean"},"notes":{"description":"Optional order notes.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"line_items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"crop_id":{"description":"Id of a crop in the user's organization (list_crops).","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"blend_id":{"description":"Id of a blend in the user's organization (list_blends).","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"product_id":{"description":"Id of one of this crop or blend's products (package sizes from list_crops / list_blends). quantity is then a whole number of packages, and unit is ignored.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"unit":{"description":"Required without product_id: trays, grams, or ounces. Blends cannot use trays.","type":"string","enum":["trays","grams","ounces"]},"quantity":{"type":"number","exclusiveMinimum":0,"multipleOf":0.01,"description":"Number of packages with product_id, otherwise the total trays, grams, or ounces. At most 2 decimals."},"price_per_item":{"description":"Price for one unit of quantity in the organization's currency: per package with product_id, otherwise per tray, gram, or ounce. Defaults to the product's price with product_id, otherwise none.","anyOf":[{"type":"number","minimum":0,"multipleOf":0.01},{"type":"null"}]}},"required":["quantity"],"additionalProperties":false},"description":"What the customer ordered, one entry per crop or blend and unit. Each item has exactly one of crop_id (list_crops) or blend_id (list_blends). To order packages, pass product_id (one of that crop or blend's products from list_crops / list_blends) and quantity as the number of packages (whole number); the unit and size come from the product. Otherwise pass unit (trays, grams, or ounces) and quantity as the total amount. Blends are never ordered in trays. Lines with the same item, unit, product, and price are merged."},"status":{"description":"Defaults to planned. Completed or cancelled orders are records only (e.g. logging a past sale) and get no plantings or tasks.","type":"string","enum":["planned","completed","cancelled"]},"use_surpluses":{"description":"Fill the order from unassigned surplus trays of the same crop first, if any are still sellable on the delivery date (default true, like the app).","type":"boolean"},"create_overdue_plantings":{"description":"Still create plantings whose grow cycle would have to start before today, with overdue tasks (default true, like the app). False leaves those crops out and lists them in overdue_plantings_skipped.","type":"boolean"}},"required":["delivery_date","line_items"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}":{"get":{"operationId":"get_order","summary":"Get an order","description":"Fetch a single order by id, including its order inputs (line items). Scoped to the authenticated user's organization.","tags":["orders"],"x-required-scope":"orders:read","parameters":[{"name":"id","in":"path","required":true,"description":"Order ID.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Order ID."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/preview":{"post":{"operationId":"preview_order","summary":"Preview an order's plantings and tasks without saving it","description":"Dry run of create_order: runs the real order logic on the farm's current data and returns the order, the plantings it would create (trays, grow start, harvest, surplus used, overdue), and every dated task, then saves nothing. Always call this before create_order and walk the grower through the result. Read get_order_guide (microgreenmanager://guides/orders) first. Requires the same edit-orders permission as creating an order in the app.","tags":["orders"],"x-required-scope":"orders:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"delivery_date":{"description":"Day the customer receives the order (delivery or pickup), not the harvest day. YYYY-MM-DD in the farm timezone.","type":["string","number"]},"customer_id":{"description":"Existing customer from list_customers. The order is saved under their name. Use this or customer_name.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"customer_name":{"description":"Name of a customer who is not in list_customers yet. Use this or customer_id.","type":"string","minLength":1,"maxLength":255},"save_customer":{"description":"With customer_name: also save them as a new customer, like the app does by default (default true). False keeps the name on this order only.","type":"boolean"},"notes":{"description":"Optional order notes.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"line_items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"crop_id":{"description":"Id of a crop in the user's organization (list_crops).","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"blend_id":{"description":"Id of a blend in the user's organization (list_blends).","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"product_id":{"description":"Id of one of this crop or blend's products (package sizes from list_crops / list_blends). quantity is then a whole number of packages, and unit is ignored.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"unit":{"description":"Required without product_id: trays, grams, or ounces. Blends cannot use trays.","type":"string","enum":["trays","grams","ounces"]},"quantity":{"type":"number","exclusiveMinimum":0,"multipleOf":0.01,"description":"Number of packages with product_id, otherwise the total trays, grams, or ounces. At most 2 decimals."},"price_per_item":{"description":"Price for one unit of quantity in the organization's currency: per package with product_id, otherwise per tray, gram, or ounce. Defaults to the product's price with product_id, otherwise none.","anyOf":[{"type":"number","minimum":0,"multipleOf":0.01},{"type":"null"}]}},"required":["quantity"],"additionalProperties":false},"description":"What the customer ordered, one entry per crop or blend and unit. Each item has exactly one of crop_id (list_crops) or blend_id (list_blends). To order packages, pass product_id (one of that crop or blend's products from list_crops / list_blends) and quantity as the number of packages (whole number); the unit and size come from the product. Otherwise pass unit (trays, grams, or ounces) and quantity as the total amount. Blends are never ordered in trays. Lines with the same item, unit, product, and price are merged."},"status":{"description":"Defaults to planned. Completed or cancelled orders are records only (e.g. logging a past sale) and get no plantings or tasks.","type":"string","enum":["planned","completed","cancelled"]},"use_surpluses":{"description":"Fill the order from unassigned surplus trays of the same crop first, if any are still sellable on the delivery date (default true, like the app).","type":"boolean"},"create_overdue_plantings":{"description":"Still create plantings whose grow cycle would have to start before today, with overdue tasks (default true, like the app). False leaves those crops out and lists them in overdue_plantings_skipped.","type":"boolean"}},"required":["delivery_date","line_items"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recurring-orders":{"get":{"operationId":"list_recurring_orders","summary":"List recurring orders","description":"List recurring orders for the authenticated user's organization, including each order's recurrence schedule. Typically a small list — no pagination.","tags":["recurring-orders"],"x-required-scope":"recurring_orders:read","parameters":[{"name":"status","in":"query","required":false,"description":"Filter by status (active, paused). Defaults to all when omitted.","schema":{"description":"Filter by status (active, paused). Defaults to all when omitted.","type":"string","enum":["active","paused","all"]}},{"name":"customer_id","in":"query","required":false,"description":"Filter by customer id.","schema":{"description":"Filter by customer id.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"customer_name","in":"query","required":false,"description":"Filter by exact customer name.","schema":{"description":"Filter by exact customer name.","type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_recurring_order","summary":"Create a recurring order","description":"Create a recurring (standing) order in the authenticated user's organization, like the app's new order form with repeat on. It creates the orders due in the next few weeks right away, with plantings and tasks, and later ones automatically as their dates come up. Call preview_recurring_order with the same inputs first and confirm the result with the grower; there is no undo or delete through MCP. Returns the same shape as preview_recurring_order, plus ids. Guide: get_order_guide (microgreenmanager://guides/orders). Requires the same edit-orders permission as creating a recurring order in the app.","tags":["recurring-orders"],"x-required-scope":"recurring_orders:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start_date":{"description":"First possible delivery day, today or later, YYYY-MM-DD in the farm timezone. For every_n_weeks it also sets the delivery weekday.","type":["string","number"]},"end_date":{"description":"Last possible delivery day, after start_date. Omit to repeat until the grower stops it.","anyOf":[{"description":"Calendar date, preferably YYYY-MM-DD in the farm timezone. An ISO-8601 date-time or unix seconds is also accepted; only its calendar day in the farm timezone is kept.","type":["string","number"]},{"type":"null"}]},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["every_n_weeks","weekly_on_day","monthly_nth_weekday"],"description":"every_n_weeks: every every_n_weeks weeks on start_date's weekday. weekly_on_day: every week on day_of_week. monthly_nth_weekday: the week_of_month-th day_of_week of every month."},"every_n_weeks":{"description":"For every_n_weeks: 1 is weekly, 2 is every other week (1-12).","type":"integer","minimum":1,"maximum":12},"day_of_week":{"description":"For weekly_on_day and monthly_nth_weekday: the delivery weekday.","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"week_of_month":{"description":"For monthly_nth_weekday: 1 for the first day_of_week of the month, up to 4 for the fourth.","type":"integer","minimum":1,"maximum":4}},"required":["frequency"],"additionalProperties":false,"description":"When it repeats. One delivery day per schedule."},"customer_id":{"description":"Existing customer from list_customers. The order is saved under their name. Use this or customer_name.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"customer_name":{"description":"Name of a customer who is not in list_customers yet. Use this or customer_id.","type":"string","minLength":1,"maxLength":255},"save_customer":{"description":"With customer_name: also save them as a new customer, like the app does by default (default true). False keeps the name on this order only.","type":"boolean"},"notes":{"description":"Optional order notes.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"line_items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"crop_id":{"description":"Id of a crop in the user's organization (list_crops).","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"blend_id":{"description":"Id of a blend in the user's organization (list_blends).","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"product_id":{"description":"Id of one of this crop or blend's products (package sizes from list_crops / list_blends). quantity is then a whole number of packages, and unit is ignored.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"unit":{"description":"Required without product_id: trays, grams, or ounces. Blends cannot use trays.","type":"string","enum":["trays","grams","ounces"]},"quantity":{"type":"number","exclusiveMinimum":0,"multipleOf":0.01,"description":"Number of packages with product_id, otherwise the total trays, grams, or ounces. At most 2 decimals."},"price_per_item":{"description":"Price for one unit of quantity in the organization's currency: per package with product_id, otherwise per tray, gram, or ounce. Defaults to the product's price with product_id, otherwise none.","anyOf":[{"type":"number","minimum":0,"multipleOf":0.01},{"type":"null"}]}},"required":["quantity"],"additionalProperties":false},"description":"What the customer ordered, one entry per crop or blend and unit. Each item has exactly one of crop_id (list_crops) or blend_id (list_blends). To order packages, pass product_id (one of that crop or blend's products from list_crops / list_blends) and quantity as the number of packages (whole number); the unit and size come from the product. Otherwise pass unit (trays, grams, or ounces) and quantity as the total amount. Blends are never ordered in trays. Lines with the same item, unit, product, and price are merged."},"create_overdue_orders":{"description":"Also create orders in the first weeks that are too soon to grow in time, with overdue plantings and tasks (default false). Otherwise they are skipped and listed in dates_too_soon_to_create.","type":"boolean"}},"required":["start_date","schedule","line_items"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recurring-orders/{id}":{"get":{"operationId":"get_recurring_order","summary":"Get a recurring order","description":"Fetch a single recurring order by id, including its line items and recurrence schedule. Scoped to the authenticated user's organization.","tags":["recurring-orders"],"x-required-scope":"recurring_orders:read","parameters":[{"name":"id","in":"path","required":true,"description":"Recurring order ID.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Recurring order ID."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recurring-orders/preview":{"post":{"operationId":"preview_recurring_order","summary":"Preview a recurring order without saving it","description":"Dry run of create_recurring_order: runs the real recurring order logic on the farm's current data and returns the schedule, the upcoming delivery dates, the orders that would be created right away with their plantings (trays, grow start, harvest, overdue) and dated tasks, and the dates too soon to create, then saves nothing. Always call this before create_recurring_order and walk the grower through the result. Read get_order_guide (microgreenmanager://guides/orders) first. Requires the same edit-orders permission as creating a recurring order in the app.","tags":["recurring-orders"],"x-required-scope":"recurring_orders:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start_date":{"description":"First possible delivery day, today or later, YYYY-MM-DD in the farm timezone. For every_n_weeks it also sets the delivery weekday.","type":["string","number"]},"end_date":{"description":"Last possible delivery day, after start_date. Omit to repeat until the grower stops it.","anyOf":[{"description":"Calendar date, preferably YYYY-MM-DD in the farm timezone. An ISO-8601 date-time or unix seconds is also accepted; only its calendar day in the farm timezone is kept.","type":["string","number"]},{"type":"null"}]},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["every_n_weeks","weekly_on_day","monthly_nth_weekday"],"description":"every_n_weeks: every every_n_weeks weeks on start_date's weekday. weekly_on_day: every week on day_of_week. monthly_nth_weekday: the week_of_month-th day_of_week of every month."},"every_n_weeks":{"description":"For every_n_weeks: 1 is weekly, 2 is every other week (1-12).","type":"integer","minimum":1,"maximum":12},"day_of_week":{"description":"For weekly_on_day and monthly_nth_weekday: the delivery weekday.","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"week_of_month":{"description":"For monthly_nth_weekday: 1 for the first day_of_week of the month, up to 4 for the fourth.","type":"integer","minimum":1,"maximum":4}},"required":["frequency"],"additionalProperties":false,"description":"When it repeats. One delivery day per schedule."},"customer_id":{"description":"Existing customer from list_customers. The order is saved under their name. Use this or customer_name.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"customer_name":{"description":"Name of a customer who is not in list_customers yet. Use this or customer_id.","type":"string","minLength":1,"maxLength":255},"save_customer":{"description":"With customer_name: also save them as a new customer, like the app does by default (default true). False keeps the name on this order only.","type":"boolean"},"notes":{"description":"Optional order notes.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"line_items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"crop_id":{"description":"Id of a crop in the user's organization (list_crops).","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"blend_id":{"description":"Id of a blend in the user's organization (list_blends).","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"product_id":{"description":"Id of one of this crop or blend's products (package sizes from list_crops / list_blends). quantity is then a whole number of packages, and unit is ignored.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"unit":{"description":"Required without product_id: trays, grams, or ounces. Blends cannot use trays.","type":"string","enum":["trays","grams","ounces"]},"quantity":{"type":"number","exclusiveMinimum":0,"multipleOf":0.01,"description":"Number of packages with product_id, otherwise the total trays, grams, or ounces. At most 2 decimals."},"price_per_item":{"description":"Price for one unit of quantity in the organization's currency: per package with product_id, otherwise per tray, gram, or ounce. Defaults to the product's price with product_id, otherwise none.","anyOf":[{"type":"number","minimum":0,"multipleOf":0.01},{"type":"null"}]}},"required":["quantity"],"additionalProperties":false},"description":"What the customer ordered, one entry per crop or blend and unit. Each item has exactly one of crop_id (list_crops) or blend_id (list_blends). To order packages, pass product_id (one of that crop or blend's products from list_crops / list_blends) and quantity as the number of packages (whole number); the unit and size come from the product. Otherwise pass unit (trays, grams, or ounces) and quantity as the total amount. Blends are never ordered in trays. Lines with the same item, unit, product, and price are merged."},"create_overdue_orders":{"description":"Also create orders in the first weeks that are too soon to grow in time, with overdue plantings and tasks (default false). Otherwise they are skipped and listed in dates_too_soon_to_create.","type":"boolean"}},"required":["start_date","schedule","line_items"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/planting-groups":{"get":{"operationId":"list_planting_groups","summary":"List planting groups","description":"List planting groups for the authenticated user's organization, matching the Plantings page grouping (harvest date + crop + plant completion). batch_id is the stable ID a planted group keeps (null until planted). Nested plantings are summarized. Filterable by harvest date range, status, and crop.","tags":["planting-groups"],"x-required-scope":"plantings:read","parameters":[{"name":"from","in":"query","required":false,"description":"Start of harvest date range (planting harvest time).","schema":{"description":"Start of harvest date range (planting harvest time).","type":["string","number"]}},{"name":"to","in":"query","required":false,"description":"End of harvest date range (planting harvest time).","schema":{"description":"End of harvest date range (planting harvest time).","type":["string","number"]}},{"name":"status","in":"query","required":false,"description":"Filter by planting status. Use \"all\" for every status. Defaults to all when omitted.","schema":{"description":"Filter by planting status. Use \"all\" for every status. Defaults to all when omitted.","type":"string","enum":["planned","in_progress","completed","all"]}},{"name":"crop_id","in":"query","required":false,"description":"Filter by crop id, or an array of crop ids.","schema":{"description":"Filter by crop id, or an array of crop ids.","type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},{"name":"crop_name","in":"query","required":false,"description":"Filter by an array of exact crop names.","schema":{"description":"Filter by an array of exact crop names.","type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","required":false,"description":"Max number of items to return (1-200, default 50).","schema":{"description":"Max number of items to return (1-200, default 50).","type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"Opaque pagination cursor returned from a previous list call.","schema":{"description":"Opaque pagination cursor returned from a previous list call.","type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_planting","summary":"Create a planting (without an order)","description":"Create a one-off planting (trays grown without an order) in the authenticated user's organization, with its tasks, like the app's new planting form. Call preview_planting with the same inputs first and confirm the result with the grower; there is no undo or delete through MCP. Returns the same shape as preview_planting, plus ids. Guide: get_planting_and_task_guide (microgreenmanager://guides/plantings-and-tasks). Requires the same edit-plantings permission as creating a planting in the app.","tags":["planting-groups"],"x-required-scope":"plantings:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"crop_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Id of a crop in the user's organization (list_crops)."},"trays":{"type":"integer","exclusiveMinimum":0,"maximum":10000,"description":"Number of trays to grow. Growers plant whole trays."},"harvest_date":{"description":"Harvest day, YYYY-MM-DD in the farm timezone. Pass this or start_date.","type":["string","number"]},"start_date":{"description":"Day 1 of the grow cycle (usually soaking or planting), YYYY-MM-DD in the farm timezone. Pass this or harvest_date.","type":["string","number"]},"status":{"description":"Defaults to planned. in_progress: some steps are already done (see completed_steps). completed: every step is done, e.g. logging a past harvest.","type":"string","enum":["planned","in_progress","completed"]},"completed_steps":{"description":"For in_progress: names of the crop steps already done, like \"Soak\" or \"Plant\" (preview_planting lists every step). Defaults to the first step and every step dated before today, except the last step, like the app.","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":255}},"notes":{"description":"Optional planting notes.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["crop_id","trays"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/planting-groups/batch/{batch_id}":{"get":{"operationId":"get_planting_group_by_batch_id","summary":"Get a planted group by batch ID","description":"Fetch a planting group by any member planting id or by its batch_id, matching the Planting Group page. batch_id is the stable ID a planted group keeps (null until planted); users may record it for traceability. Nested plantings are summarized (id, order, state, trays).","tags":["planting-groups"],"x-required-scope":"plantings:read","parameters":[{"name":"batch_id","in":"path","required":true,"description":"Batch ID shown on the Planting Group page. Only planted groups have one. Pass this or id, not both.","schema":{"description":"Batch ID shown on the Planting Group page. Only planted groups have one. Pass this or id, not both.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/planting-groups/{id}":{"get":{"operationId":"get_planting_group","summary":"Get a planting group by any of its planting IDs","description":"Fetch a planting group by any member planting id or by its batch_id, matching the Planting Group page. batch_id is the stable ID a planted group keeps (null until planted); users may record it for traceability. Nested plantings are summarized (id, order, state, trays).","tags":["planting-groups"],"x-required-scope":"plantings:read","parameters":[{"name":"id","in":"path","required":true,"description":"Any planting ID that belongs to the planting group.","schema":{"description":"Any planting ID that belongs to the planting group.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/planting-groups/preview":{"post":{"operationId":"preview_planting","summary":"Preview a planting's trays and tasks without saving it","description":"Dry run of create_planting: runs the real planting logic on the farm's current data and returns the planting it would create (trays, grow start, harvest, status, overdue) with every dated task, then saves nothing. Always call this before create_planting and walk the grower through the result. Read get_planting_and_task_guide (microgreenmanager://guides/plantings-and-tasks) first. Requires the same edit-plantings permission as creating a planting in the app.","tags":["planting-groups"],"x-required-scope":"plantings:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"crop_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Id of a crop in the user's organization (list_crops)."},"trays":{"type":"integer","exclusiveMinimum":0,"maximum":10000,"description":"Number of trays to grow. Growers plant whole trays."},"harvest_date":{"description":"Harvest day, YYYY-MM-DD in the farm timezone. Pass this or start_date.","type":["string","number"]},"start_date":{"description":"Day 1 of the grow cycle (usually soaking or planting), YYYY-MM-DD in the farm timezone. Pass this or harvest_date.","type":["string","number"]},"status":{"description":"Defaults to planned. in_progress: some steps are already done (see completed_steps). completed: every step is done, e.g. logging a past harvest.","type":"string","enum":["planned","in_progress","completed"]},"completed_steps":{"description":"For in_progress: names of the crop steps already done, like \"Soak\" or \"Plant\" (preview_planting lists every step). Defaults to the first step and every step dated before today, except the last step, like the app.","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":255}},"notes":{"description":"Optional planting notes.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["crop_id","trays"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recurring-plantings":{"get":{"operationId":"list_recurring_plantings","summary":"List recurring plantings","description":"List recurring plantings for the authenticated user's organization, including each planting's recurrence schedule. Typically a small list — no pagination.","tags":["recurring-plantings"],"x-required-scope":"recurring_plantings:read","parameters":[{"name":"status","in":"query","required":false,"description":"Filter by status (active, paused). Defaults to all when omitted.","schema":{"description":"Filter by status (active, paused). Defaults to all when omitted.","type":"string","enum":["active","paused","all"]}},{"name":"crop_id","in":"query","required":false,"description":"Filter by crop id.","schema":{"description":"Filter by crop id.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_recurring_planting","summary":"Create a recurring planting","description":"Create a recurring planting (the same crop and trays harvested on a schedule, without an order) in the authenticated user's organization, like the app's new recurring planting form. It creates the plantings harvested in the next few weeks right away, with tasks, and later ones automatically as their dates come up. Call preview_recurring_planting with the same inputs first and confirm the result with the grower; there is no undo or delete through MCP. Returns the same shape as preview_recurring_planting, plus ids. Guide: get_planting_and_task_guide (microgreenmanager://guides/plantings-and-tasks). Requires the same edit-plantings permission and plan as creating a recurring planting in the app.","tags":["recurring-plantings"],"x-required-scope":"recurring_plantings:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"Name shown in the recurring plantings list, like \"Pea for the farmers market\"."},"crop_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Id of a crop in the user's organization (list_crops)."},"trays":{"type":"integer","exclusiveMinimum":0,"maximum":10000,"description":"Trays per harvest. Growers plant whole trays."},"notes":{"description":"Optional notes, copied to every planting.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"start_date":{"description":"First possible harvest day, today or later, YYYY-MM-DD in the farm timezone. For every_n_weeks it also sets the harvest weekday.","type":["string","number"]},"end_date":{"description":"Last possible harvest day, after start_date. Omit to repeat until the grower stops it.","anyOf":[{"description":"Calendar date, preferably YYYY-MM-DD in the farm timezone. An ISO-8601 date-time or unix seconds is also accepted; only its calendar day in the farm timezone is kept.","type":["string","number"]},{"type":"null"}]},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["every_n_weeks","weekly_on_day","monthly_nth_weekday"],"description":"every_n_weeks: every every_n_weeks weeks on start_date's weekday. weekly_on_day: every week on day_of_week. monthly_nth_weekday: the week_of_month-th day_of_week of every month."},"every_n_weeks":{"description":"For every_n_weeks: 1 is weekly, 2 is every other week (1-12).","type":"integer","minimum":1,"maximum":12},"day_of_week":{"description":"For weekly_on_day and monthly_nth_weekday: the harvest weekday.","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"week_of_month":{"description":"For monthly_nth_weekday: 1 for the first day_of_week of the month, up to 4 for the fourth.","type":"integer","minimum":1,"maximum":4}},"required":["frequency"],"additionalProperties":false,"description":"When it repeats. One harvest day per schedule."},"create_overdue_plantings":{"description":"Also create plantings in the first weeks whose harvest is too soon to grow in time, with overdue tasks (default true, like the app). False skips them and lists them in dates_too_soon_to_create.","type":"boolean"}},"required":["name","crop_id","trays","start_date","schedule"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recurring-plantings/{id}":{"get":{"operationId":"get_recurring_planting","summary":"Get a recurring planting","description":"Fetch a single recurring planting by id, including its recurrence schedule. Scoped to the authenticated user's organization.","tags":["recurring-plantings"],"x-required-scope":"recurring_plantings:read","parameters":[{"name":"id","in":"path","required":true,"description":"Recurring planting ID.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Recurring planting ID."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recurring-plantings/preview":{"post":{"operationId":"preview_recurring_planting","summary":"Preview a recurring planting without saving it","description":"Dry run of create_recurring_planting: runs the real recurring planting logic on the farm's current data and returns the schedule, the upcoming harvest dates, the plantings that would be created right away (trays, grow start, harvest, overdue) with their dated tasks, and the dates too soon to create, then saves nothing. Always call this before create_recurring_planting and walk the grower through the result. Read get_planting_and_task_guide (microgreenmanager://guides/plantings-and-tasks) first. Requires the same edit-plantings permission and plan as creating a recurring planting in the app.","tags":["recurring-plantings"],"x-required-scope":"recurring_plantings:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"Name shown in the recurring plantings list, like \"Pea for the farmers market\"."},"crop_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Id of a crop in the user's organization (list_crops)."},"trays":{"type":"integer","exclusiveMinimum":0,"maximum":10000,"description":"Trays per harvest. Growers plant whole trays."},"notes":{"description":"Optional notes, copied to every planting.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"start_date":{"description":"First possible harvest day, today or later, YYYY-MM-DD in the farm timezone. For every_n_weeks it also sets the harvest weekday.","type":["string","number"]},"end_date":{"description":"Last possible harvest day, after start_date. Omit to repeat until the grower stops it.","anyOf":[{"description":"Calendar date, preferably YYYY-MM-DD in the farm timezone. An ISO-8601 date-time or unix seconds is also accepted; only its calendar day in the farm timezone is kept.","type":["string","number"]},{"type":"null"}]},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["every_n_weeks","weekly_on_day","monthly_nth_weekday"],"description":"every_n_weeks: every every_n_weeks weeks on start_date's weekday. weekly_on_day: every week on day_of_week. monthly_nth_weekday: the week_of_month-th day_of_week of every month."},"every_n_weeks":{"description":"For every_n_weeks: 1 is weekly, 2 is every other week (1-12).","type":"integer","minimum":1,"maximum":12},"day_of_week":{"description":"For weekly_on_day and monthly_nth_weekday: the harvest weekday.","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"week_of_month":{"description":"For monthly_nth_weekday: 1 for the first day_of_week of the month, up to 4 for the fourth.","type":"integer","minimum":1,"maximum":4}},"required":["frequency"],"additionalProperties":false,"description":"When it repeats. One harvest day per schedule."},"create_overdue_plantings":{"description":"Also create plantings in the first weeks whose harvest is too soon to grow in time, with overdue tasks (default true, like the app). False skips them and lists them in dates_too_soon_to_create.","type":"boolean"}},"required":["name","crop_id","trays","start_date","schedule"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/task-groups":{"get":{"operationId":"list_task_groups","summary":"List task groups","description":"List task groups for the authenticated user's organization, matching the Tasks page grouping. Nested plantings are summarized (id, order, trays). Supports filtering by date range, task name, status, crop, and cursor pagination.","tags":["task-groups"],"x-required-scope":"tasks:read","parameters":[{"name":"start_date","in":"query","required":false,"description":"Start of task date range, as unix timestamp seconds or ISO-8601 date-time.","schema":{"description":"Start of task date range, as unix timestamp seconds or ISO-8601 date-time.","type":["string","number"]}},{"name":"end_date","in":"query","required":false,"description":"End of task date range, as unix timestamp seconds or ISO-8601 date-time.","schema":{"description":"End of task date range, as unix timestamp seconds or ISO-8601 date-time.","type":["string","number"]}},{"name":"task_name","in":"query","required":false,"description":"Filter by exact task name, or an array of exact task names.","schema":{"description":"Filter by exact task name, or an array of exact task names.","type":"array","items":{"type":"string"}}},{"name":"status","in":"query","required":false,"description":"Filter by task status. Use \"all\" for planned and completed tasks. Defaults to all tasks when omitted.","schema":{"description":"Filter by task status. Use \"all\" for planned and completed tasks. Defaults to all tasks when omitted.","type":"string","enum":["planned","completed","all"]}},{"name":"crop_id","in":"query","required":false,"description":"Filter by crop id, an array of crop ids.","schema":{"description":"Filter by crop id, an array of crop ids.","type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},{"name":"crop_name","in":"query","required":false,"description":"Filter by an array of exact crop names.","schema":{"description":"Filter by an array of exact crop names.","type":"array","items":{"type":"string"}}},{"name":"limit","in":"query","required":false,"description":"Max number of items to return (1-200, default 50).","schema":{"description":"Max number of items to return (1-200, default 50).","type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"Opaque pagination cursor returned from a previous list call.","schema":{"description":"Opaque pagination cursor returned from a previous list call.","type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_task","summary":"Create a task","description":"Create a one-off farm task (work that isn't a crop step, like cleaning racks) in the authenticated user's organization, like the app's new task form. Set status completed to log work that is already done, with completed_at if it was not done on the task day. It is recorded as completed by the signed-in user. Confirm the name and day with the grower first; there is no undo or delete through MCP. Guide: get_planting_and_task_guide (microgreenmanager://guides/plantings-and-tasks). Requires the same edit-tasks permission as creating a task in the app.","tags":["task-groups"],"x-required-scope":"tasks:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_name":{"type":"string","minLength":1,"maxLength":255,"description":"What to do, like \"Clean racks\". Crop step names (Soak, Plant, Harvest, ...) are reserved."},"date":{"description":"Day the task is due, YYYY-MM-DD in the farm timezone.","type":["string","number"]},"status":{"description":"Defaults to planned. completed logs work that is already done and is not attached to a crop or planting.","type":"string","enum":["planned","completed"]},"completed_at":{"description":"For a completed task: when it was done, as an ISO-8601 date-time with its offset, unix seconds, or YYYY-MM-DD for just the day. Defaults to the task's day. It is recorded as completed by you (the signed-in user).","type":["string","number"]},"notes":{"description":"Optional task notes.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]}},"required":["task_name","date"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/task-groups/{id}":{"get":{"operationId":"get_task_group","summary":"Get a task group by any of its task IDs","description":"Fetch a task group by any member task id, matching the Task Group page. Nested plantings are summarized (id, order, trays).","tags":["task-groups"],"x-required-scope":"tasks:read","parameters":[{"name":"id","in":"path","required":true,"description":"Any task ID that belongs to the task group.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Any task ID that belongs to the task group."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recurring-tasks":{"get":{"operationId":"list_recurring_tasks","summary":"List recurring tasks","description":"List recurring tasks for the authenticated user's organization, including each task's recurrence schedule. Typically a small list — no pagination.","tags":["recurring-tasks"],"x-required-scope":"recurring_tasks:read","parameters":[{"name":"status","in":"query","required":false,"description":"Filter by status (active, paused). Defaults to all when omitted.","schema":{"description":"Filter by status (active, paused). Defaults to all when omitted.","type":"string","enum":["active","paused","all"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_recurring_task","summary":"Create a recurring task","description":"Create a recurring farm task in the authenticated user's organization, like the app's new task form with repeat on. It creates the tasks for the next 30 days right away and later ones automatically. Its tasks are not linked to a crop, planting, or order. Call preview_recurring_task with the same inputs first and confirm the result with the grower; there is no undo or delete through MCP. Returns the same shape as preview_recurring_task, plus ids. Guide: get_planting_and_task_guide (microgreenmanager://guides/plantings-and-tasks). Requires the same edit-tasks permission and plan as creating a recurring task in the app.","tags":["recurring-tasks"],"x-required-scope":"recurring_tasks:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_name":{"type":"string","minLength":1,"maxLength":255,"description":"What to do, like \"Clean racks\". Crop step names (Soak, Plant, Harvest, ...) are reserved."},"notes":{"description":"Optional notes, copied to every task.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"start_date":{"description":"First possible task day, today or later, YYYY-MM-DD in the farm timezone. For every_n_days and every_n_weeks it also sets which days the task falls on.","type":["string","number"]},"end_date":{"description":"Last possible task day, after start_date. Omit to repeat until the grower stops it.","anyOf":[{"description":"Calendar date, preferably YYYY-MM-DD in the farm timezone. An ISO-8601 date-time or unix seconds is also accepted; only its calendar day in the farm timezone is kept.","type":["string","number"]},{"type":"null"}]},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["every_n_days","every_n_weeks","weekly_on_day","monthly_nth_weekday"],"description":"every_n_days: every every_n_days days from start_date. every_n_weeks: every every_n_weeks weeks on start_date's weekday. weekly_on_day: every week on day_of_week. monthly_nth_weekday: the week_of_month-th day_of_week of every month."},"every_n_days":{"description":"For every_n_days: 1 is daily, 2 is every other day (1-60).","type":"integer","minimum":1,"maximum":60},"every_n_weeks":{"description":"For every_n_weeks: 1 is weekly, 2 is every other week (1-52).","type":"integer","minimum":1,"maximum":52},"day_of_week":{"description":"For weekly_on_day and monthly_nth_weekday: the task weekday.","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"week_of_month":{"description":"For monthly_nth_weekday: 1 for the first day_of_week of the month, up to 4 for the fourth.","type":"integer","minimum":1,"maximum":4}},"required":["frequency"],"additionalProperties":false,"description":"When it repeats. One task day per schedule."}},"required":["task_name","start_date","schedule"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recurring-tasks/{id}":{"get":{"operationId":"get_recurring_task","summary":"Get a recurring task","description":"Fetch a single recurring task by id, including its recurrence schedule. Scoped to the authenticated user's organization.","tags":["recurring-tasks"],"x-required-scope":"recurring_tasks:read","parameters":[{"name":"id","in":"path","required":true,"description":"Recurring task ID.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Recurring task ID."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recurring-tasks/preview":{"post":{"operationId":"preview_recurring_task","summary":"Preview a recurring task without saving it","description":"Dry run of create_recurring_task: runs the real recurring task logic and returns the schedule, the upcoming task dates, and the tasks that would be created right away, then saves nothing. Always call this before create_recurring_task and walk the grower through the result. Read get_planting_and_task_guide (microgreenmanager://guides/plantings-and-tasks) first. Requires the same edit-tasks permission and plan as creating a recurring task in the app.","tags":["recurring-tasks"],"x-required-scope":"recurring_tasks:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_name":{"type":"string","minLength":1,"maxLength":255,"description":"What to do, like \"Clean racks\". Crop step names (Soak, Plant, Harvest, ...) are reserved."},"notes":{"description":"Optional notes, copied to every task.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"start_date":{"description":"First possible task day, today or later, YYYY-MM-DD in the farm timezone. For every_n_days and every_n_weeks it also sets which days the task falls on.","type":["string","number"]},"end_date":{"description":"Last possible task day, after start_date. Omit to repeat until the grower stops it.","anyOf":[{"description":"Calendar date, preferably YYYY-MM-DD in the farm timezone. An ISO-8601 date-time or unix seconds is also accepted; only its calendar day in the farm timezone is kept.","type":["string","number"]},{"type":"null"}]},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["every_n_days","every_n_weeks","weekly_on_day","monthly_nth_weekday"],"description":"every_n_days: every every_n_days days from start_date. every_n_weeks: every every_n_weeks weeks on start_date's weekday. weekly_on_day: every week on day_of_week. monthly_nth_weekday: the week_of_month-th day_of_week of every month."},"every_n_days":{"description":"For every_n_days: 1 is daily, 2 is every other day (1-60).","type":"integer","minimum":1,"maximum":60},"every_n_weeks":{"description":"For every_n_weeks: 1 is weekly, 2 is every other week (1-52).","type":"integer","minimum":1,"maximum":52},"day_of_week":{"description":"For weekly_on_day and monthly_nth_weekday: the task weekday.","type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"week_of_month":{"description":"For monthly_nth_weekday: 1 for the first day_of_week of the month, up to 4 for the fourth.","type":"integer","minimum":1,"maximum":4}},"required":["frequency"],"additionalProperties":false,"description":"When it repeats. One task day per schedule."}},"required":["task_name","start_date","schedule"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/crops":{"get":{"operationId":"list_crops","summary":"List crops","description":"List all crops for the authenticated user's organization, including each crop's available container products (sizes and prices). Returns every crop regardless of status.","tags":["crops"],"x-required-scope":"crops:read","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_crop","summary":"Create a crop","description":"Create a crop in the authenticated user's organization. A crop is a template: each order for it creates a planting whose harvest date is the order due date minus harvest_buffer_time_days, whose grow cycle starts (day 1, usually planting) total_grow_time_days earlier, with one task per step and a tray count from yield_per_tray and safety_margin_percent. Times are whole days. Call list_crops first to avoid a duplicate. Read get_crop_scheduling_guide first and confirm the fields and steps with the grower before creating. Full field guide: microgreenmanager://guides/crop-scheduling. Requires the same edit-crops-and-blends permission as creating a crop in the app.","tags":["crops"],"x-required-scope":"crops:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"crop_name":{"type":"string","minLength":1,"maxLength":100,"description":"Crop name (1-100 characters)."},"yield_per_tray":{"type":"number","exclusiveMinimum":0,"description":"Expected harvested weight per tray in yield_unit. Must be positive. Sets tray counts: trays = quantity x package size / yield_per_tray (grams and ounces are converted), then plus safety_margin_percent."},"yield_unit":{"type":"string","enum":["grams","ounces"],"description":"Unit for yield_per_tray: grams or ounces."},"total_grow_time_days":{"type":"integer","minimum":0,"maximum":365,"description":"Whole days from the first day of the grow cycle (usually soaking or planting) to harvest, 0-365. Day 1 is scheduled this many days before the harvest date, and Harvest falls on day total_grow_time_days + 1."},"sow_density":{"description":"Seed amount per tray in sow_density_unit. Non-negative, at most 2 decimals. Shown to growers on plantings and plant tasks and will drive future seed tracking features; does not change dates or tray counts today. Omit if unknown.","anyOf":[{"type":"number","minimum":0,"multipleOf":0.01},{"type":"null"}]},"sow_density_unit":{"description":"Unit for sow_density: grams, ounces, teaspoons, tablespoons, or cups. Defaults to grams.","type":"string","enum":["grams","ounces","teaspoons","tablespoons","cups"]},"shelf_life_days":{"description":"Shelf life: whole days a harvest stays sellable after the harvest date (0-120). Decides how long surplus trays can still fill orders. Must be >= harvest_buffer_time_days. Defaults to 0.","anyOf":[{"type":"integer","minimum":0,"maximum":120},{"type":"null"}]},"harvest_buffer_time_days":{"description":"Whole days between harvest and the order due date (0-120). For an order due on day D, the Harvest task is on D minus this value and planting is total_grow_time_days before that. 0 harvests on the due date. Must be <= shelf_life_days. Defaults to 0.","anyOf":[{"type":"integer","minimum":0,"maximum":120},{"type":"null"}]},"safety_margin_percent":{"description":"Safety margin: extra whole percent of trays planted on top of what orders need. 10 plants 1.1 trays for every tray an order needs. Default to 0 unless the grower asks for a margin.","anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"null"}]},"notes":{"description":"Optional notes. Copied into the notes of each planting created for this crop.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"steps":{"description":"Crop cycle steps. Days are numbered the way the app shows them: Day 1 is the first day of the grow cycle and Harvest falls on day total_grow_time_days + 1. Each step becomes one task on first day + (day - 1) whenever a planting of this crop is created. Usually the first step is planting (Plant or a \"Plant and ...\" step on day 1). If the grower soaks seed overnight, Soak is day 1 and the plant step is day 2; if they soak and plant the same day, both are day 1. Stage steps (Plant and weighted germination, Plant and unweighted germination, Plant and humidity dome, Plant and blackout, Weighted germination, Unweighted germination, Humidity dome, Blackout, Under lights, Uncover) start a stage that lasts until the next stage step or harvest, so \"blackout for 3 days from planting\" is Plant and blackout on day 1 plus Uncover or Under lights on day 4. One-off steps (Soak, Plant, Watering, Fertilize, Harvest) are single actions. Repeat a one-off step (e.g. Watering) for each day it should happen. Use a \"Plant and ...\" step to combine planting with a stage that starts on planting day in one task. At most one plant-type step and at most one Harvest step. If omitted, a Plant step on day 1 and a Harvest step on day total_grow_time_days + 1 are added. A Harvest step, if given, must be on exactly day total_grow_time_days + 1.","maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","enum":["Soak","Plant","Plant and weighted germination","Plant and unweighted germination","Plant and humidity dome","Plant and blackout","Weighted germination","Unweighted germination","Humidity dome","Blackout","Watering","Fertilize","Under lights","Harvest","Uncover"],"description":"Step name. One of: Soak, Plant, Plant and weighted germination, Plant and unweighted germination, Plant and humidity dome, Plant and blackout, Weighted germination, Unweighted germination, Humidity dome, Blackout, Watering, Fertilize, Under lights, Harvest, Uncover."},"day":{"type":"integer","minimum":1,"maximum":366,"description":"Day of the grow cycle this step's task falls on, numbered like the app: day 1 is the first day (usually planting or an overnight soak) and Harvest is day total_grow_time_days + 1. Must be between 1 and total_grow_time_days + 1."},"description":{"description":"Optional instructions. Copied into the notes of every task created from this step.","anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["name","day"],"additionalProperties":false}},"sizes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"size":{"type":"number","exclusiveMinimum":0,"multipleOf":0.01,"description":"Package size in the given unit. Must be positive with at most 2 decimals."},"unit":{"type":"string","enum":["grams","ounces","trays"],"description":"Size unit: grams, ounces, or trays. To sell a crop by the tray at a set price, use size 1 and trays."},"price":{"description":"Price per package in the organization's currency. Non-negative, at most 2 decimals. Omit if unknown.","anyOf":[{"type":"number","minimum":0,"multipleOf":0.01},{"type":"null"}]},"product_type":{"description":"Optional product type: restaurant, wholesale, consumer, retail, or other.","anyOf":[{"type":"string","enum":["restaurant","wholesale","consumer","retail","other"]},{"type":"null"}]}},"required":["size","unit"],"additionalProperties":false},"description":"Container products (package sizes with optional prices) customers can order. Pass an empty array for none. Exact duplicates are collapsed."}},"required":["crop_name","yield_per_tray","yield_unit","total_grow_time_days"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/blends":{"get":{"operationId":"list_blends","summary":"List blends","description":"List all blends for the authenticated user's organization, including each blend's component crops (with percentages) and available container products (sizes and prices). Returns every blend regardless of status.","tags":["blends"],"x-required-scope":"blends:read","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_blend","summary":"Create a blend","description":"Create a blend in the authenticated user's organization: a product made from at least 2 of the organization's crops that are planted and grown separately, then mixed together after harvest. Call list_crops first: every crop_id must belong to this organization, each crop may appear once, and the percentages must add up to exactly 100. A blend has no schedule of its own: an order for it creates one planting per crop, using each crop's grow time, harvest buffer, steps, and yield, with trays scaled by percentage. Blends are ordered in grams, ounces, or packages of one of their sizes, never in trays. Confirm the crops and percentages with the grower before creating. Full guide: microgreenmanager://guides/crop-scheduling. Requires the same edit-crops-and-blends permission as creating a blend in the app.","tags":["blends"],"x-required-scope":"blends:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"blend_name":{"type":"string","minLength":1,"maxLength":100,"description":"Blend name."},"notes":{"description":"Optional notes about the blend.","anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"crops":{"minItems":2,"maxItems":100,"type":"array","items":{"type":"object","properties":{"crop_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Id of a crop in the user's organization (see list_crops)."},"percentage":{"type":"number","exclusiveMinimum":0,"maximum":100,"multipleOf":0.01,"description":"Percent of the blend's weight this crop makes up (above 0, up to 100, at most 2 decimals). Scales this crop's trays for blend orders."}},"required":["crop_id","percentage"],"additionalProperties":false},"description":"Crops in the blend (at least 2). Each crop_id must be unique and belong to the user's organization (use list_crops to find ids). Percentages must add up to exactly 100."},"sizes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"size":{"type":"number","exclusiveMinimum":0,"multipleOf":0.01,"description":"Package size in the given unit. Must be positive with at most 2 decimals."},"unit":{"type":"string","enum":["grams","ounces"],"description":"Size unit: grams or ounces."},"price":{"description":"Price per package in the organization's currency. Non-negative, at most 2 decimals. Omit if unknown.","anyOf":[{"type":"number","minimum":0,"multipleOf":0.01},{"type":"null"}]},"product_type":{"description":"Optional product type: restaurant, wholesale, consumer, retail, or other.","anyOf":[{"type":"string","enum":["restaurant","wholesale","consumer","retail","other"]},{"type":"null"}]}},"required":["size","unit"],"additionalProperties":false},"description":"Container products (package sizes with optional prices) customers can order. Pass an empty array for none. Exact duplicates are collapsed."}},"required":["blend_name","crops"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products":{"post":{"operationId":"create_products","summary":"Add products to crops and blends","description":"Add container products (package sizes with optional prices and product types) to existing crops and blends in the authenticated user's organization. Customers order a crop or blend in packages of one of its products. One call can cover many crops and blends, up to 500 sizes in total. It is all-or-nothing: an unknown id or invalid size creates nothing. Call list_crops or list_blends first for ids and the products each already has. A size that matches an existing product (same size, unit, price, and product type) is returned under products_already_existing instead of being created again. To create a new crop or blend with products, pass sizes to create_crop or create_blend instead. Confirm the sizes and prices with the grower before creating; there is no undo through MCP. Requires the same edit-crops-and-blends permission as adding a product in the app.","tags":["products"],"x-required-scope":"products:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"crops":{"description":"Crops to add products to, each with its own sizes (up to 100 crops).","maxItems":100,"type":"array","items":{"type":"object","properties":{"crop_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Id of a crop in the user's organization (see list_crops)."},"sizes":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"size":{"type":"number","exclusiveMinimum":0,"multipleOf":0.01,"description":"Package size in the given unit. Must be positive with at most 2 decimals."},"unit":{"type":"string","enum":["grams","ounces","trays"],"description":"Size unit: grams, ounces, or trays. To sell a crop by the tray at a set price, use size 1 and trays."},"price":{"description":"Price per package in the organization's currency. Non-negative, at most 2 decimals. Omit if unknown.","anyOf":[{"type":"number","minimum":0,"multipleOf":0.01},{"type":"null"}]},"product_type":{"description":"Optional product type: restaurant, wholesale, consumer, retail, or other.","anyOf":[{"type":"string","enum":["restaurant","wholesale","consumer","retail","other"]},{"type":"null"}]}},"required":["size","unit"],"additionalProperties":false},"description":"Container products to add (package sizes with optional prices). Sizes that match an existing product with the same size, unit, price, and product type are skipped."}},"required":["crop_id","sizes"],"additionalProperties":false}},"blends":{"description":"Blends to add products to, each with its own sizes (up to 100 blends).","maxItems":100,"type":"array","items":{"type":"object","properties":{"blend_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Id of a blend in the user's organization (see list_blends)."},"sizes":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"size":{"type":"number","exclusiveMinimum":0,"multipleOf":0.01,"description":"Package size in the given unit. Must be positive with at most 2 decimals."},"unit":{"type":"string","enum":["grams","ounces"],"description":"Size unit: grams or ounces."},"price":{"description":"Price per package in the organization's currency. Non-negative, at most 2 decimals. Omit if unknown.","anyOf":[{"type":"number","minimum":0,"multipleOf":0.01},{"type":"null"}]},"product_type":{"description":"Optional product type: restaurant, wholesale, consumer, retail, or other.","anyOf":[{"type":"string","enum":["restaurant","wholesale","consumer","retail","other"]},{"type":"null"}]}},"required":["size","unit"],"additionalProperties":false},"description":"Container products to add (package sizes with optional prices). Sizes that match an existing product with the same size, unit, price, and product type are skipped."}},"required":["blend_id","sizes"],"additionalProperties":false}}},"required":[]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/surpluses":{"get":{"operationId":"list_surpluses","summary":"List surplus","description":"List current and future grouped surplus plantings for the authenticated user's organization, similar to the Surpluses page. Supports optional filtering by crop id/name.","tags":["surpluses"],"x-required-scope":"surpluses:read","parameters":[{"name":"crop_id","in":"query","required":false,"description":"Filter by an array of crop ids.","schema":{"description":"Filter by an array of crop ids.","type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},{"name":"crop_name","in":"query","required":false,"description":"Filter by an array of exact crop names.","schema":{"description":"Filter by an array of exact crop names.","type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/financial":{"get":{"operationId":"get_financial_report","summary":"Get the financial report","description":"Get flat revenue facts for the authenticated user's organization. Includes completed-order actual revenue and optional projected revenue from planned/in-progress orders due today or later in the org timezone. Incomplete orders before today are excluded. When from and to are set, previous_facts covers the equal-length prior period for comparison. Client can reshape by time, customer, crop/blend, or product (crop/blend and container) without refetching. Requires the same view-financial-report permission as the Financial Report page.","tags":["reports"],"x-required-scope":"financial_report:read","parameters":[{"name":"from","in":"query","required":false,"description":"Start of delivery date range (inclusive). Required with `to` for previous-period compare.","schema":{"description":"Start of delivery date range (inclusive). Required with `to` for previous-period compare.","type":["string","number"]}},{"name":"to","in":"query","required":false,"description":"End of delivery date range (inclusive). Required with `from` for previous-period compare.","schema":{"description":"End of delivery date range (inclusive). Required with `from` for previous-period compare.","type":["string","number"]}},{"name":"include_projections","in":"query","required":false,"description":"Include projected revenue from planned/in-progress orders whose delivery date is today or later in the org timezone. Defaults to true. Completed orders are always included as actual revenue. Incomplete orders before today are never projected.","schema":{"description":"Include projected revenue from planned/in-progress orders whose delivery date is today or later in the org timezone. Defaults to true. Completed orders are always included as actual revenue. Incomplete orders before today are never projected.","type":"boolean"}},{"name":"include_previous_period","in":"query","required":false,"description":"When from and to are both set, also return previous_facts for the equal-length period immediately before. Defaults to true.","schema":{"description":"When from and to are both set, also return previous_facts for the equal-length period immediately before. Defaults to true.","type":"boolean"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/yield":{"get":{"operationId":"get_yield_analysis","summary":"Get the yield analysis","description":"Get flat harvest yield facts for the authenticated user's organization. Each fact is one completed harvest (harvest_info; harvest_info_id is the batch_id shown on the Planting Group page and accepted by get_planting_group) with expected yield and optional recorded actual yield. Weight fields are returned in both grams and ounces. actual_yield_grams / actual_yield_ounces are the measured sample; the extrapolated fields scale that sample to trays_total. Client can reshape by time or crop without refetching.","tags":["reports"],"x-required-scope":"yield_analysis:read","parameters":[{"name":"from","in":"query","required":false,"description":"Start of harvest time range (inclusive). Harvest time is the planting harvest time.","schema":{"description":"Start of harvest time range (inclusive). Harvest time is the planting harvest time.","type":["string","number"]}},{"name":"to","in":"query","required":false,"description":"End of harvest time range (inclusive). Harvest time is the planting harvest time.","schema":{"description":"End of harvest time range (inclusive). Harvest time is the planting harvest time.","type":["string","number"]}},{"name":"crop_ids","in":"query","required":false,"description":"Optional crop ids to include. Omit or pass an empty list to include every crop.","schema":{"description":"Optional crop ids to include. Omit or pass an empty list to include every crop.","type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/label-layouts":{"get":{"operationId":"list_label_layouts","summary":"List label layouts","description":"Label layouts set where tray labels land on the page when the farm prints or exports them in the app (Create Labels): paper, margins, label size, columns and rows, and spacing. Layouts are shared by everyone in the farm. Lists the built-in layouts (ids like \"preset:auto-pack\", which can't be changed) and the farm's saved layouts (numeric ids), with each one's settings and which is the farm default that labels open with.","tags":["label-layouts"],"x-required-scope":"label_layouts:read","parameters":[{"name":"unit","in":"query","required":true,"description":"Unit for every length in this call, in and out.","schema":{"type":"string","enum":["inches","millimeters"],"description":"Unit for every length in this call, in and out."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"create_label_layout","summary":"Create a label layout","description":"Label layouts set where tray labels land on the page when the farm prints or exports them in the app (Create Labels): paper, margins, label size, columns and rows, and spacing. Layouts are shared by everyone in the farm. Saves a new layout for the farm, for example to match a label sheet the farm buys (use the sheet's label size, columns, rows, margins, and spacing). Settings not passed start from 4 x 2 in fixed-size labels on US Letter with 0.5 in margins and 0.125 in spacing, as many columns and rows as fit. For labels sized to their content, pass label_sizing fit_content; for a label printer, also pass paper label_sized. Layouts that can't print, like columns that don't fit across the page, are rejected with the reason. A farm can have up to 50 saved layouts. Requires the edit-plantings permission, like in the app. Labels are printed from the app; this doesn't print anything.","tags":["label-layouts"],"x-required-scope":"label_layouts:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"Layout name shown in the app, e.g. \"Avery 5163 shipping labels\"."},"unit":{"description":"Unit for every length in this call: inches or millimeters. Required when passing any length. The response uses it too, or millimeters when left out.","type":"string","enum":["inches","millimeters"]},"paper":{"description":"us_letter (8.5 x 11 in) or a4 (210 x 297 mm) sheets; custom sheets with paper_width and paper_height; or label_sized, which prints each label on its own page exactly the size of the label (for label printers; paper, margins, columns, rows, and spacing are then ignored).","type":"string","enum":["us_letter","a4","custom","label_sized"]},"paper_width":{"description":"Paper width before orientation is applied. Only with paper custom.","type":"number","minimum":0},"paper_height":{"description":"Paper height before orientation is applied. Only with paper custom.","type":"number","minimum":0},"orientation":{"description":"Landscape swaps the paper width and height.","type":"string","enum":["portrait","landscape"]},"margins":{"description":"Blank space at each edge of the page. Label sheets list these as top and side margins.","type":"object","properties":{"top":{"type":"number","minimum":0},"right":{"type":"number","minimum":0},"bottom":{"type":"number","minimum":0},"left":{"type":"number","minimum":0}},"required":["top","right","bottom","left"]},"label_sizing":{"description":"fixed: every label is exactly label_width x label_height, like the labels on a sheet; content shrinks to fit inside. fit_content: each label is as big as its content.","type":"string","enum":["fixed","fit_content"]},"label_width":{"description":"Width of each fixed-size label. Passing it makes labels fixed-size.","type":"number","minimum":0},"label_height":{"description":"Height of each fixed-size label. Passing it makes labels fixed-size.","type":"number","minimum":0},"columns":{"description":"Labels across each sheet. null fits as many as the page allows.","anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"rows":{"description":"Labels down each sheet. null fits as many as the page allows.","anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"horizontal_spacing":{"description":"Space between columns. Label sheets often call this the horizontal pitch minus the label width.","type":"number","minimum":0},"vertical_spacing":{"description":"Space between rows. Label sheets often call this the vertical pitch minus the label height.","type":"number","minimum":0}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/label-layouts/default":{"post":{"operationId":"set_default_label_layout","summary":"Set the farm's default label layout","description":"Label layouts set where tray labels land on the page when the farm prints or exports them in the app (Create Labels): paper, margins, label size, columns and rows, and spacing. Layouts are shared by everyone in the farm. Sets the farm's default layout, which the label dialog opens with for everyone in the farm. Requires the edit-plantings permission, like in the app.","tags":["label-layouts"],"x-required-scope":"label_layouts:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"string","enum":["preset:auto-pack","preset:one-per-page"]}],"description":"A saved layout id, or a built-in layout id like \"preset:auto-pack\", from list_label_layouts."}},"required":["id"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/label-layouts/{id}":{"patch":{"operationId":"edit_label_layout","summary":"Edit a label layout","description":"Label layouts set where tray labels land on the page when the farm prints or exports them in the app (Create Labels): paper, margins, label size, columns and rows, and spacing. Layouts are shared by everyone in the farm. Changes a saved layout's name or settings for everyone in the farm. Only the settings passed change. Built-in layouts can't be edited; create a new layout instead. Requires the edit-plantings permission, like in the app.","tags":["label-layouts"],"x-required-scope":"label_layouts:write","parameters":[{"name":"id","in":"path","required":true,"description":"Saved layout id from list_label_layouts.","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Saved layout id from list_label_layouts."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"New layout name.","type":"string","minLength":1,"maxLength":60},"unit":{"description":"Unit for every length in this call: inches or millimeters. Required when passing any length. The response uses it too, or millimeters when left out.","type":"string","enum":["inches","millimeters"]},"paper":{"description":"us_letter (8.5 x 11 in) or a4 (210 x 297 mm) sheets; custom sheets with paper_width and paper_height; or label_sized, which prints each label on its own page exactly the size of the label (for label printers; paper, margins, columns, rows, and spacing are then ignored).","type":"string","enum":["us_letter","a4","custom","label_sized"]},"paper_width":{"description":"Paper width before orientation is applied. Only with paper custom.","type":"number","minimum":0},"paper_height":{"description":"Paper height before orientation is applied. Only with paper custom.","type":"number","minimum":0},"orientation":{"description":"Landscape swaps the paper width and height.","type":"string","enum":["portrait","landscape"]},"margins":{"description":"Blank space at each edge of the page. Label sheets list these as top and side margins.","type":"object","properties":{"top":{"type":"number","minimum":0},"right":{"type":"number","minimum":0},"bottom":{"type":"number","minimum":0},"left":{"type":"number","minimum":0}},"required":["top","right","bottom","left"]},"label_sizing":{"description":"fixed: every label is exactly label_width x label_height, like the labels on a sheet; content shrinks to fit inside. fit_content: each label is as big as its content.","type":"string","enum":["fixed","fit_content"]},"label_width":{"description":"Width of each fixed-size label. Passing it makes labels fixed-size.","type":"number","minimum":0},"label_height":{"description":"Height of each fixed-size label. Passing it makes labels fixed-size.","type":"number","minimum":0},"columns":{"description":"Labels across each sheet. null fits as many as the page allows.","anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"rows":{"description":"Labels down each sheet. null fits as many as the page allows.","anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}]},"horizontal_spacing":{"description":"Space between columns. Label sheets often call this the horizontal pitch minus the label width.","type":"number","minimum":0},"vertical_spacing":{"description":"Space between rows. Label sheets often call this the vertical pitch minus the label height.","type":"number","minimum":0}},"required":[]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/team/employees":{"get":{"operationId":"list_employees","summary":"List team members","description":"List the farm's team members (admin only): each one's email, name, whether they are an admin, their permissions, and when they joined. Team members are identified by email. Admins always have every permission.","tags":["team"],"x-required-scope":"team:read","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/team/employees/{email}":{"patch":{"operationId":"update_employee_permissions","summary":"Change a team member's permissions","description":"Change a team member's permissions (admin only), like the checkboxes on the app's team page. Pass only the permissions to change. Admins always have every permission, and you can't change your own. Turning a permission on needs the Pro plan; taking one away works on any plan. Confirm the change with the grower first. Returns the team member with their new permissions.","tags":["team"],"x-required-scope":"team:write","parameters":[{"name":"email","in":"path","required":true,"description":"The team member's email from list_employees.","schema":{"type":"string","minLength":3,"maxLength":255,"description":"The team member's email from list_employees."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"permissions":{"type":"object","properties":{"can_edit_orders":{"description":"Create and edit orders, recurring orders, customers, and touchpoints.","type":"boolean"},"can_edit_crops_blends":{"description":"Create and edit crops, blends, and their products.","type":"boolean"},"can_edit_tasks":{"description":"Create and edit tasks and recurring tasks.","type":"boolean"},"can_edit_plantings":{"description":"Create and edit plantings and recurring plantings.","type":"boolean"},"can_complete_tasks":{"description":"Mark tasks as completed.","type":"boolean"},"can_view_financial_report":{"description":"See revenue in the financial report.","type":"boolean"},"can_manage_api_keys":{"description":"Create API keys for the public API, limited to what they can do in the app. Turning this off revokes their keys.","type":"boolean"}},"additionalProperties":false,"description":"Only the permissions to change: true to allow, false to take away. Others stay as they are."}},"required":["permissions"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/team/invites":{"get":{"operationId":"list_invites","summary":"List pending invites","description":"List invites to join the farm that haven't been accepted yet (admin only), with the name, email, and permissions each was sent with. Use invite_id with cancel_invite.","tags":["team"],"x-required-scope":"team:read","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/team/invites/{invite_id}/cancel":{"post":{"operationId":"cancel_invite","summary":"Cancel an invite","description":"Cancel an invite to join the farm (admin only), like the app's team page, so its link stops working. Confirm with the grower first; to invite them again they need a new invite from the app.","tags":["team"],"x-required-scope":"team:write","parameters":[{"name":"invite_id","in":"path","required":true,"description":"invite_id from list_invites.","schema":{"type":"string","minLength":1,"maxLength":100,"description":"invite_id from list_invites."}},{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique value for this request, like a UUID, so retrying it is safe. A retry with the same key and body within 24 hours gets the first response back (with Idempotent-Replayed: true) instead of creating it again.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The farm's plan doesn't include the API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key doesn't have the scope, or its creator doesn't have the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with the same Idempotency-Key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The Idempotency-Key was already used for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 60 requests in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Something went wrong on our side","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Down for maintenance. Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key starting with mm_live_"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable error code, e.g. API_SCOPE_MISSING"},"message":{"type":"string"},"params":{"type":"object"}},"required":["code","message"]}},"required":["error"]}}}}