Docs

API Reference

API reference for the agrirouter gateway API: endpoints, authentication, and request patterns

The agrirouter API is a small REST surface for managing endpoints, exchanging messages, and receiving events.

If you are maintaining an existing integration that uses the legacy protocol, see the Legacy API documentation.

Gateway Endpoints

See the sidebar for the full list of API operations and their reference pages.

Base URLs

The API is available in two environments:

EnvironmentBase URL
QAhttps://api.qa.agrirouter.farm
Productionhttps://api.agrirouter.com

See the URLs appendix for the complete list of environment URLs.

Authentication

Every request requires a Bearer token in the Authorization header. Applications obtain this token via the OAuth2 client credentials flow (see Authorization & Security).

Common Headers

HeaderValueDescription
Content-Typeapplication/jsonAll request bodies are JSON
AuthorizationBearer <token>JWT from client credentials or endpoint credentials

Request and Response Patterns

  • Request bodies are JSON-encoded.
  • Events come in over a Server-Sent Events (SSE) stream from GET /events. Keep a persistent connection open to receive them in real time.
  • Payloads arrive inline in events or via a payload_uri the client downloads directly.

OpenAPI Specification

Use the machine-readable OpenAPI document to generate clients, import the API into tools, or keep a local copy of the contract:

FormatURL
YAMLhttps://agrirouter.com/api/openapi.yaml
JSONhttps://agrirouter.com/api/openapi.json

The YAML endpoint is also available at https://agrirouter.com/api/openapi for tools that prefer a shorter URL.

Additional Resources

On this page