List authorized tenants
List every tenant for which the current application has an existing authorization, together with each tenant's visible endpoints.
Returns every tenant for which your application has an existing authorization, together with the related endpoints currently visible to the application in each tenant. This is the primary global synchronization operation: call it on application startup, after a crash, or whenever you need to rebuild your complete view of authorized tenants from scratch.
For an ongoing, push-based view of the same data, subscribe to the AUTHORIZATION_ADDED, AUTHORIZATION_REVOKED, and ENDPOINTS_LIST_CHANGED events on GET /events.
tenants[].endpoints follows the privacy rule documented on the schema: until your application has at least one of its own endpoints in a tenant, that tenant's endpoints array is empty even if other endpoints exist there. The tenant itself still appears in the response.
Matching an authorization request with state
Each tenant entry carries state: the value your application supplied on the authorization request of the most recent authorization for that tenant. The field is omitted when that authorization request carried no state. When the user authorizes your application again for the same tenant, state reflects the newer authorization request.
This lets your backend find out which tenant a user connected without holding an open GET /events stream:
- Generate a unique
statefor every authorization request, and remember which customer or session it belongs to. - After the user returns from the consent page, call
GET /tenants. - Pick the tenant entry whose
stateequals the value you sent. Itstenant_idis the tenant the user connected.
agrirouter stores and returns state unchanged, so treat it as an opaque string. The same field is also delivered on tenant in the AUTHORIZATION_ADDED event.
Agrirouter OAuth2 authentication for QA environment.
The client credentials flow obtains tokens from https://api-qa.agrirouter.com/token,
the same host as the API. https://oauth.qa.agrirouter.farm/token keeps working but is
deprecated. The public keys that sign access tokens are available at
https://api-qa.agrirouter.com/jwks.
In: header
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://api.agrirouter.com/tenants"{
"tenants": [
{
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"company_name": "Example Company GmbH",
"state": "c2b7e1f0-customer-4711",
"endpoints": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"external_id": "string",
"name": "string",
"endpoint_type": "cloud_software",
"application_id": "48ac72d0-a829-4896-a067-dcb1c2b0f30c",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"owned_by_your_application": true,
"capabilities": {
"can_send": [
"string"
],
"can_receive": [
"string"
]
},
"routed_endpoints": {
"can_send_to": {
"property1": [
"iso:11783:-10:taskdata:zip"
],
"property2": [
"iso:11783:-10:taskdata:zip"
]
},
"can_receive_from": {
"property1": [
"iso:11783:-10:taskdata:zip"
],
"property2": [
"iso:11783:-10:taskdata:zip"
]
}
}
}
]
}
]
}{
"message": "string",
"errors": [
{
"path": "/items/0/name",
"message": "string"
}
],
"schema": "iso:15143:-3:equipment:json@20190501"
}{
"message": "string",
"errors": [
{
"path": "/items/0/name",
"message": "string"
}
],
"schema": "iso:15143:-3:equipment:json@20190501"
}{
"message": "string",
"errors": [
{
"path": "/items/0/name",
"message": "string"
}
],
"schema": "iso:15143:-3:equipment:json@20190501"
}