Introduction

Seshat turns raw M-Pesa, bank and card statements into a categorized ledger with budgets, goals, bills, debt plans and insights. These docs cover every import source and the REST API that powers the app.

Quick start

Create an account

Sign up with your email, choose your currency and payday, pick the accounts you use (M-Pesa, bank, SACCO, cash) and accept the Terms and Privacy Policy.

First import

Go to Import, choose M-Pesa statement, upload the PDF and enter the SMS password. Review the preview and confirm. Done.

M-Pesa statements

Getting the PDF

In the M-Pesa app: Statements → Request statement. Or dial *334# → My Account → M-PESA Statement. Safaricom emails a PDF.

Password

The PDF password arrives by SMS from M-PESA. Enter it in Seshat — it is used once to open the file in memory and never stored.

M-Pesa SMS

Paste one or many confirmation messages. The receipt code, amount, counterparty, date, balance and transaction cost are extracted.

Example message
QK12ABC345 Confirmed. Ksh1,500.00 sent to JOHN DOE 0712345678 on 12/11/26 at 10:23 AM. New M-PESA balance is Ksh2,345.00. Transaction cost, Ksh23.00.

Bank & card statements

CSV or Excel exports give the best accuracy. Seshat auto-detects Date, Description/Narration, Amount or Debit/Credit, Balance and Reference columns, and handles KSh 1,234.00, (1,234.00) and DR/CR notations and day-first dates.

SMS auto-import

Create a device token under SMS Auto-import, then have your phone POST each M-Pesa or bank SMS to the webhook. Transactions appear within seconds, categorized and de-duplicated.

Forward a message
curl -X POST https://your-domain/api/ingest/sms \
  -H "Authorization: Bearer ssh_your_token" \
  -H "Content-Type: application/json" \
  -d '{"text":"QK12ABC345 Confirmed. Ksh1,500.00 sent to JOHN DOE ...","sender":"MPESA"}'

Also accepted: ?token= in the URL, form posts, plain text bodies and {"messages": [...]} batches of up to 50.

Browsers and Play Store apps can't read SMS without special Google approval, so Seshat uses forwarding automations (MacroDroid, SMS forwarder apps, iPhone Shortcuts) that you control.

Overlapping statements

Upload a 12-month statement, then a 1-month statement a week later — only new transactions are added. Each transaction gets a fingerprint:

text
with reference:    r|<RECEIPT>|<amount_cents>|<direction>|<fee?>
without reference: h|<YYYY-MM-DD>|<amount_cents>|<direction>|<normalised description>[#n]

The #n occurrence suffix keeps two genuinely identical purchases on the same day. A unique database index guarantees no duplicates even if two imports run at once. The account balance only syncs from a statement when it contains the newest data. Every import can be undone from Import → Import history.

The preview shows the statement's date range, what the account already covers, and exactly how many transactions are new. Coverage gaps longer than a week are flagged.

Category rules

Active rules are evaluated by descending priority; the first match wins. Fields: description, merchant, reference, amount. Types: contains, equals, starts_with, regex (case-insensitive). If no rule matches, known Paybill/Till numbers and merchant aliases are used.

Rule
{
  "match_field": "description",
  "match_type": "regex",
  "match_pattern": "^Pay Bill to (888880|888888)",
  "category_id": "…",
  "priority": 90
}

Budgets & goals

Budget spending is computed live from the current period's transactions, so periods reset automatically. Amber at 75%, red at 100%. Rollover carries last period's unused amount forward.

Debt planner

Interest is applied monthly to each balance; minimums are paid first and the extra goes to the smallest balance (snowball) or highest rate (avalanche) until all debts are paid.

Install as an app

Seshat is a Progressive Web App. Android Chrome: Install app. iPhone Safari: Share → Add to Home Screen. A Play Store build uses a Trusted Web Activity wrapper around the same app.

API overview

The web app uses a JSON REST API on the same origin. All endpoints require a signed-in session cookie and only ever return your own records.

Authentication

POST/api/auth/signupCreate an account
POST/api/auth/loginStart a session (httpOnly cookie)
POST/api/auth/logoutEnd the session
GET/api/auth/meCurrent user

Entities

Entities: transactions, accounts, categories, category-rules, merchants, budgets, goals, bills, debts, subscriptions, investments, savings-challenges, notifications (read/write) and payments, activity-logs, legal-acceptances (read-only).

GET/api/entities/:entity?field=value&q=&from=&to=&sort=-dateList with filters
POST/api/entities/:entityCreate one, or up to 200 in an array
PATCH/api/entities/:entity/:idUpdate
DELETE/api/entities/:entity/:idDelete
List this month's expenses
curl -b cookies.txt "https://your-domain/api/entities/transactions?direction=expense&from=2026-11-01&sort=-date"

Functions

POST/api/functions/parse-statementmultipart: source, file | text, password → normalized transactions
POST/api/functions/import-completeStamp account and log the import
POST/api/functions/import-undoRemove an import batch
POST/api/functions/paystackinitialize | verify a subscription payment
GET/api/functions/my-tasksTasks assigned to you
GET/api/export?entity=allDownload your data

Money & dates

All amounts are integer cents (amount_cents: 150000 = KSh 1,500.00) with a separate direction of income, expense or transfer. Timestamps are ISO-8601; calendar dates are YYYY-MM-DD.

Docs · Seshat