App data
Records owned by the application rather than by any one user — product catalogues, announcements, feature flags, pricing tables. Every user of the app sees the same rows.
API key only
App data has no per-user scoping, so there is nothing for the server to pin an API key to. Every method on this page requires an API key key and raises InsufficientScopeError (403) without one.
That means these calls belong on your server. To show app data in a browser or mobile app, read it server-side and serve it from your own endpoint.
add_app_dataAPI key only
POST /api/app/data
authix.add_app_data(*, data_category: str, data: dict) -> dict
| Param | Type | Required | Description |
|---|---|---|---|
| data_category | str | Yes | A namespace — 'products', 'announcements'. Lower-cased and fixed on create. |
| data | dict | Yes | Any JSON-serialisable payload. |
Returns: dict — the created record
1record = authix.add_app_data(
2 data_category="products",
3 data={"sku": "A-1", "name": "Widget", "price": 1200},
4)Throws: InsufficientScopeError (403) with an API key.
get_app_dataAPI key only
GET /api/app/data
authix.get_app_data(
*, category: str | None = None,
limit: int | None = None, cursor: str | None = None,
) -> Page| Param | Type | Required | Description |
|---|---|---|---|
| category | str | No | Restrict to one category. |
| limit | int | No | 1–100. Defaults to 20. |
| cursor | str | No | next_cursor from the previous page. |
Returns: Page
1page = authix.get_app_data(category="products", limit=100)
2
3for product in page:
4 print(product["sku"])iter_app_dataAPI key only
GET /api/app/data (paged)
authix.iter_app_data(
*, category: str | None = None,
limit: int | None = None, max_pages: int | None = None,
) -> Iterator[dict]| Param | Type | Required | Description |
|---|---|---|---|
| category | str | No | Restrict to one category. |
| limit | int | No | Page size while iterating. |
| max_pages | int | No | Bound the traversal. |
Returns: Iterator[dict]
1catalogue = list(authix.iter_app_data(category="products"))A catalogue rarely changes. Cache the result on your side rather than re-reading it on every request — a full sweep on each page load burns request quota for data that is identical each time.
get_single_app_dataAPI key only
GET /api/app/data/:dataId
authix.get_single_app_data(*, data_id: str) -> dict
| Param | Type | Required | Description |
|---|---|---|---|
| data_id | str | Yes | The record id. |
Returns: dict
1product = authix.get_single_app_data(data_id=data_id)Throws: NotFoundError (404) if no such record exists in this app.
search_in_app_dataAPI key only
GET /api/app/data/search
authix.search_in_app_data(
*, q: str | None = None, category: str | None = None,
keys: dict | None = None,
limit: int | None = None, cursor: str | None = None,
) -> Page| Param | Type | Required | Description |
|---|---|---|---|
| q | str | No | Free-text match. |
| category | str | No | Restrict to one category. |
| keys | dict | No | Exact-match filter on payload fields. |
| limit | int | No | 1–100. |
| cursor | str | No | For the next page. |
Returns: Page
1page = authix.search_in_app_data(
2 category="products",
3 keys={"in_stock": True},
4 q="widget",
5)update_app_dataAPI key only
PUT /api/app/data/:dataId
authix.update_app_data(
*, data_id: str, data: dict, version: int | None = None,
) -> dict| Param | Type | Required | Description |
|---|---|---|---|
| data_id | str | Yes | Which record. |
| data | dict | Yes | Fields to merge in. |
| version | int | No | The version you read, for optimistic concurrency. |
Returns: dict
1authix.update_app_data(
2 data_id=data_id,
3 data={"price": 1100},
4 version=product["version"],
5)Throws: VersionConflictError (409) if someone wrote first.
App data is more likely to be edited by several people at once than user data is — an admin panel and a sync job, for instance. Pass version here even more readily than you would elsewhere.
delete_app_dataAPI key only
DELETE /api/app/data/:dataId
authix.delete_app_data(*, data_id: str) -> dict
| Param | Type | Required | Description |
|---|---|---|---|
| data_id | str | Yes | Which record. |
Returns: dict
1authix.delete_app_data(data_id=data_id)Permanent, and app-wide — every user of the app stops seeing it immediately.
Related