API Endpoints
All endpoints are read-only and require an X-API-Key header with a token that has read scope or higher.
Base URL: https://api.ogarni.ai
Purchase Documents
Section titled “Purchase Documents”GET /api/PurchaseDocuments/my
Section titled “GET /api/PurchaseDocuments/my”List your purchase documents (receipts, invoices, email purchases).
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
from | DateTime | — | Start date filter (ISO 8601) |
to | DateTime | — | End date filter (ISO 8601) |
sortBy | string | purchase_time | Sort field: purchase_time or created_at |
sortDirection | string | desc | Sort order: desc or asc |
Example:
curl "https://api.ogarni.ai/api/PurchaseDocuments/my?from=2025-01-01&to=2025-01-31&sortBy=purchase_time&sortDirection=desc" \ -H "X-API-Key: $OGARNIAI_API_TOKEN"GET /api/PurchaseDocuments/{id}
Section titled “GET /api/PurchaseDocuments/{id}”Get full details of a single purchase document by its UUID.
GET /api/PurchaseDocuments/{id}/image
Section titled “GET /api/PurchaseDocuments/{id}/image”Get the scanned image (receipt photo) of a document. Returns binary image data with the appropriate content type.
GET /api/PurchaseDocuments/{id}/duplicates
Section titled “GET /api/PurchaseDocuments/{id}/duplicates”Get duplicate suggestions for a specific document, including confidence scores and match reasons.
Categories and Tags
Section titled “Categories and Tags”GET /api/Categories
Section titled “GET /api/Categories”List all expense and income categories with their subcategories. Each category includes Polish and English names, an emoji, and a list of subcategories.
GET /api/Tags
Section titled “GET /api/Tags”List all user-defined tags. Tags can be attached to purchase documents for custom organization.
Summaries
Section titled “Summaries”GET /api/weekly-summaries/latest
Section titled “GET /api/weekly-summaries/latest”Get the most recent weekly spending summary, including an AI-generated text summary, daily breakdowns, and category totals.
GET /api/weekly-summaries
Section titled “GET /api/weekly-summaries”List weekly summaries with pagination.
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | int | 1 | Page number |
pageSize | int | 10 | Items per page |
GET /api/summaries/periods
Section titled “GET /api/summaries/periods”Get a spending summary for a custom date range.
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
startDate | DateTime | Yes | Start of the period (ISO 8601) |
endDate | DateTime | Yes | End of the period (ISO 8601) |
granularity | string | No | Day (default), Week, or Month |
GET /api/summaries/presets
Section titled “GET /api/summaries/presets”Get a spending summary for a preset period.
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
preset | string | Yes | current-week, current-month, last-week, or last-month |
granularity | string | No | Day (default), Week, or Month |
Notifications
Section titled “Notifications”GET /api/Notifications
Section titled “GET /api/Notifications”List notifications with filtering and pagination.
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
isRead | bool | — | Filter by read status |
type | enum | — | Error=1, Warning=2, Info=3, Success=4 |
category | enum | — | DocumentProcessing=1, WeeklySummary=2, System=3, DuplicateDetection=4 |
pageSize | int | 50 | Items per page |
pageNumber | int | 1 | Page number |
GET /api/Notifications/{id}
Section titled “GET /api/Notifications/{id}”Get details of a single notification by its UUID.
GET /api/Notifications/unread-count
Section titled “GET /api/Notifications/unread-count”Get the count of unread notifications. Returns {"count": N}.
Groups
Section titled “Groups”GET /api/Groups
Section titled “GET /api/Groups”List your finance groups (for shared expenses).
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
showArchived | bool | — | Include archived groups |
GET /api/Groups/{groupId}
Section titled “GET /api/Groups/{groupId}”Get details of a specific group by its UUID, including owner information.
Other Endpoints
Section titled “Other Endpoints”GET /api/inbound-mailboxes
Section titled “GET /api/inbound-mailboxes”List your inbound email addresses used for forwarding receipts to Ogarni.AI.
GET /api/Deduplication/suggestions
Section titled “GET /api/Deduplication/suggestions”List duplicate document suggestions with confidence scores and match reasons.
GET /api/external_loyalty
Section titled “GET /api/external_loyalty”List connected loyalty program accounts (e.g., store loyalty cards).
GET /api/BankStatement/supported-banks
Section titled “GET /api/BankStatement/supported-banks”Get the list of banks supported for bank statement import.
GET /api/RecurringExpenses
Section titled “GET /api/RecurringExpenses”List detected recurring expenses (subscriptions, regular payments).
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
includeInactive | bool | false | Include inactive recurring expenses |