Mandate Gatekeeping: Tenant Access Control
Mandate Gatekeeping: Tenant Access Control
Overview
The Mandate Gatekeeping Status API lets any authorised consumer query whether a specific tenant should be granted or restricted access to downstream systems, based on the current state of their Direct Debit mandate.
This is the recommended integration point for applications like agentOS that need to enforce access control based on a tenant's payment mandate health.
How It Works
- The consuming application identifies a tenant by their email address or external reference.
- It calls the gatekeeping status endpoint (authenticated with an API key).
- The response contains the mandate status, the last collection outcome, and a pre-computed
access_allowedboolean. - The consuming application uses
access_allowedto grant or restrict access (e.g. to a tenant portal). - Optionally, the application subscribes to the status change webhook to receive push notifications when the status transitions, avoiding the need to poll continuously.
Mandate Statuses
| Status | Meaning |
|---|---|
active | Mandate is in good standing; collections are running normally |
suspended | Mandate has been temporarily suspended; no collections are being taken |
cancelled | Mandate has been cancelled; no further collections will occur |
failed | The most recent collection or mandate registration failed |
The access_allowed Flag
The access_allowed boolean abstracts the access control decision away from the consumer. It is computed by the service based on the mandate status and the last collection outcome, so the consuming application does not need to implement its own status-to-access mapping logic.
true— the tenant has an active, healthy mandate; access should be grantedfalse— the mandate is suspended, cancelled, or failed; access should be restricted
Webhook Events
When a tenant's gatekeeping status changes, the service fires a webhook event. This allows consumers to react immediately to transitions without relying on polling.
Example trigger scenarios:
- A mandate is cancelled →
access_allowedtransitions tofalse→ webhook fires - A tenant sets up a new mandate that becomes active →
access_allowedtransitions totrue→ webhook fires - A collection fails →
last_collection_statusupdates → webhook fires
See the API Reference for webhook payload details.
Authentication
All requests to the gatekeeping status endpoint must be authenticated using an API key passed in the request header. API keys are scoped per customer (letting agent) and only return data for tenants within that customer's account.
Example Use Case
A letting agent uses agentOS to manage their tenant portal. When a tenant attempts to log in:
- agentOS calls the gatekeeping status endpoint with the tenant's email.
- The response returns
access_allowed: falsebecause the tenant's mandate was cancelled. - agentOS blocks the login and displays a message prompting the tenant to set up a new Direct Debit mandate.
- Once the tenant completes a new mandate setup and it becomes active, the webhook fires and agentOS automatically restores portal access.