All Docs
API ReferenceagentOS Direct DebitUpdated March 13, 2026

Gatekeeping Status API Reference

Gatekeeping Status API Reference

Get Tenant Gatekeeping Status

Returns the current gatekeeping status for a tenant, including their mandate state, last collection outcome, and whether access should be permitted.

Endpoint

GET /v1/gatekeeping/status

Authentication

API key required. Pass the key in the Authorization header:

Authorization: Bearer <api_key>

Query Parameters

ParameterTypeRequiredDescription
emailstringConditionalThe tenant's email address. Required if external_ref is not provided.
external_refstringConditionalThe tenant's external reference as set by the consuming application. Required if email is not provided.

At least one of email or external_ref must be supplied.

Response

{
  "tenant_id": "tnt_01hx...",
  "email": "tenant@example.com",
  "external_ref": "agentOS-tenant-456",
  "mandate_status": "active",
  "last_collection_status": "collected",
  "access_allowed": true,
  "updated_at": "2025-01-15T09:32:00Z"
}

Response Fields

FieldTypeDescription
tenant_idstringThe tenant's internal ID within the DD service
emailstringThe tenant's email address
external_refstring | nullThe tenant's external reference, if set
mandate_statusenumCurrent mandate status: active, suspended, cancelled, or failed
last_collection_statusstring | nullOutcome of the most recent collection attempt, or null if no collection has been attempted
access_allowedbooleanWhether the consuming application should grant this tenant access
updated_atISO 8601 datetimeTimestamp of the last status change

Error Responses

HTTP StatusCodeDescription
400MISSING_IDENTIFIERNeither email nor external_ref was provided
401UNAUTHORIZEDMissing or invalid API key
404TENANT_NOT_FOUNDNo tenant matching the supplied identifier was found for this customer

Webhook: Gatekeeping Status Changed

Fired whenever a tenant's gatekeeping status changes — including transitions in mandate_status, last_collection_status, or access_allowed.

Event Name

gatekeeping.status_changed

Payload

{
  "event": "gatekeeping.status_changed",
  "occurred_at": "2025-01-15T09:32:00Z",
  "customer_id": "cus_01hx...",
  "data": {
    "tenant_id": "tnt_01hx...",
    "email": "tenant@example.com",
    "external_ref": "agentOS-tenant-456",
    "mandate_status": "cancelled",
    "last_collection_status": "collected",
    "access_allowed": false,
    "previous_access_allowed": true
  }
}

Payload Fields

FieldTypeDescription
eventstringAlways gatekeeping.status_changed
occurred_atISO 8601 datetimeWhen the status change occurred
customer_idstringThe letting agent's customer ID
data.tenant_idstringThe tenant's internal ID
data.emailstringThe tenant's email address
data.external_refstring | nullThe tenant's external reference, if set
data.mandate_statusenumNew mandate status
data.last_collection_statusstring | nullMost recent collection outcome
data.access_allowedbooleanNew value of the access flag
data.previous_access_allowedbooleanPrevious value of the access flag, to help detect transitions