Help topics

API reference

API overview

Send tenants, units and tenancies to Nyumbisha from your own system.

Base URL

https://api.astralyngroup.com/tenure/v1

Every path in this reference is relative to it.

Authentication

Send an OAuth 2.0 access token issued by Astralyn ID for the tenure audience. The token carries your organisation; you never send an organisation id yourself.

Authorization: Bearer <access token>
ScopeAllows
tenure:readGET endpoints
tenure:writePOST and DELETE endpoints

Required headers

HeaderWhenValue
Authorizationevery requestBearer <token>
Idempotency-Keyevery POST and DELETEa new UUID per request
Content-Typerequests with a bodyapplication/json (or text/csv for the import)

A POST or DELETE without Idempotency-Key is rejected with 400 idempotency_key_required.

Conventions

  • Money is a string of whole cents (minor units): "2500000" is KES 25,000. Never a number, never a decimal. The CSV import is the one exception: it reads amounts as a landlord types them.
  • Dates are YYYY-MM-DD, in Nairobi time.
  • Phone numbers are accepted as 0722145880, 722145880 or +254722145880, and returned as +254722145880. A phone number identifies a tenant.
  • Ids in paths are UUIDs, as returned in the id field.

Errors

Every error has the same body:

{
  "error": {
    "code": "unprocessable",
    "message": "We have not met this number before. What is their name?"
  },
  "request_id": "req_01J9…"
}
StatuscodeMeaning
400validation_failedBody or query has the wrong shape. details lists each field.
400idempotency_key_requiredMissing Idempotency-Key header.
401unauthenticatedMissing, expired or invalid token.
403forbiddenToken lacks the scope for this endpoint.
404not_foundNo such record in your organisation.
409conflictThe request clashes with current state, e.g. unit already let.
422unprocessableWell-formed, but not allowed. message says why.
5xxinternal_errorOur fault. Retry with backoff; quote request_id to support.

message is written for a person and safe to show to your users.

Endpoints

TaskReference
Upload many tenancies from a CSVBulk import
Create properties and units, move one tenant in, read a tenantTenants