Revoke tenant authorizations
Revoke every authorization your application holds for a tenant, after deleting your endpoints there.
Revoke every authorization your application currently holds for a tenant, across all scopes. Use this when your application should disconnect from a user's agrirouter account, for example when the user closes their account with you or unlinks agrirouter in your application. It is the API counterpart of the user clicking Revoke in the agrirouter UI (see Managing Authorizations).
The application is taken from the access token. Like the endpoint operations, the tenant is passed in the x-agrirouter-tenant-id header.
Today an authorization exists only for the endpoints:manage scope, so this removes that single authorization. If additional scopes are introduced later, this operation revokes all of them at once.
Delete your endpoints first
The call is rejected with 409 Conflict while your application still has at least one endpoint in the tenant, and nothing is revoked. Endpoints of other applications in the tenant do not count.
This protects integrations that connect more than one instance of the same platform to one agrirouter account. Without the check, revoking from one instance would also disconnect the other instances. Disconnect in this order:
Delete your endpoints in the tenant
Delete each of your endpoints in the tenant with DELETE /endpoints/{externalId}. Deleting an owner (parent) endpoint also deletes the endpoints it owns. Use GET /tenants/{tenantId}/endpoints to find the endpoints that remain.
Revoke the authorizations
Call DELETE /authorizations with the tenant in the x-agrirouter-tenant-id header.
Revocation cannot be undone through the API. To reconnect, the user has to grant a new authorization through the authorization flow.
After a 204 response, you receive an AUTHORIZATION_REVOKED event for each revoked authorization on GET /events.
A 404 means your application holds no authorization for the tenant, for example because it was already revoked. Treat it as "already disconnected".
Agrirouter OAuth2 authentication for QA environment.
The client credentials flow obtains tokens from https://api.qa.agrirouter.farm/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.farm/jwks.
In: header
Scope: endpoints:manage
Header Parameters
The farmer's tenant ID in relation to which communication is done.
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://api.agrirouter.com/authorizations" \ -H "x-agrirouter-tenant-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}