DEVELOPERS
Build the tool your farm needs on the record it already keeps.
FarmHub has three ways in: a REST API for reading and writing farm data, signed webhooks that push farm events to your URL, and an MCP server that lets an AI assistant work with the access you approve.
Plan: API keys, the Customer API, webhooks, and MCP work on every plan. Each request still sees only what the signed-in person or key is allowed to see.
Customer API v1 (REST)
The Customer API covers projects (farms), notebooks and their records, people and invitations, and store data: products, orders and refunds, subscription plans, discount codes, and subscriptions. Its contract is published as an OpenAPI document at GET /v1/openapi.json, with a YAML copy and a hosted reference at api.farmhub.ag/docs.
- Authenticate with an OAuth 2.1 access token or a project API key in the Authorization header.
- Project API keys start with fh_live_, are shown once, cover one project and the scopes chosen at creation, and stop working when revoked or when their creator leaves the project.
- Send an Idempotency-Key header to retry POST, PUT, PATCH, and DELETE requests safely.
- Resources outside your access return 404 rather than revealing that they exist.
- Sensor-managed notebooks are read-only through the API to protect measurement provenance.
- Version 1 changes additively: new optional fields and endpoints, no silent renames or removals.
Signed webhooks
FarmHub POSTs JSON to your HTTPS endpoint when a harvest is recorded, an alert is raised or resolved, a corrective action is resolved, a recall is initiated, or a report is generated. Each request carries X-FarmHub-Signature (HMAC-SHA256 of the raw body), X-FarmHub-Timestamp, X-FarmHub-Event, and X-FarmHub-Delivery headers, and failed deliveries are retried.
MCP server for assistants
Add the FarmHub MCP server to an assistant that supports MCP, sign in, and approve the scopes it asks for. Each scope unlocks a set of tools, and every tool runs as you, so FarmHub's normal permissions and farm boundaries still apply.
- farms_read: View your farms, members, and access grants.
- farms_write: Update farms, invite members, manage access.
- crops_read: View crop plans, plantings, and locations.
- crops_write: Create and manage crop plans and plantings.
- monitoring_read: View sensors, readings, alerts, and weather.
- monitoring_write: Record readings, manage sensors and alerts.
- harvest_read: View harvests and traceability records.
- harvest_write: Record harvests and supply chain events.
- inventory_read: View inventory items, lots, and bundles.
- inventory_write: Adjust stock and manage inventory.
- compliance_read: View compliance records and assessments.
- compliance_write: Manage compliance records and corrective actions.
- insights_read: View metrics, reports, and recommendations.
- tasks_read: View activities and checklist items.
- tasks_write: Create and manage activities.
Questions farmers ask
Which plan do I need for the API?
None in particular. API keys, the Customer API, webhooks, and MCP work on every plan, including the free Sprout plan.
Where is the API reference?
The OpenAPI document is at GET /v1/openapi.json on api.farmhub.ag, with a YAML copy at /v1/openapi.yaml and a hosted reference at /docs.
Can an API key read every farm on my account?
No. A project API key covers the one project it was created for, carries only the scopes chosen at creation, and acts as the person who created it.
Can I write sensor readings through the API?
You can write records to manually managed notebooks. Sensor-managed notebooks are read-only through the Customer API.
READY FOR THE NEXT SHIFT
Create a key and make the first call.
Create your account, make a project API key in project settings, and call GET /v1/me to see your scopes.
Create your FarmHub account