Skip to content

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.

Writes need a secret key

App data has no per-user scoping, so there is nothing for the server to pin a publishable key to. Reading it — get_app_data, iter_app_data, get_single_app_data and search_in_app_data — works with either kind of key. Writing it — add_app_data, update_app_data and delete_app_data — requires a secret key and raises InsufficientScopeError (403) with a publishable one.

That means writes belong on your server, with the secret key in an environment variable.

add_app_data

No session neededSecret key, server only

POST /api/app/:appId/data/:dataCategory

Python
authix.add_app_data(*, data_category: str, data: dict) -> dict
ParamTypeRequiredDescription
data_categorystrYesA namespace — 'products', 'announcements'. Lower-cased and fixed on create.
datadictYesAny JSON-serialisable payload.

Returns: dict — the created record

Python
1record = authix.add_app_data(
2    data_category="products",
3    data={"sku": "A-1", "name": "Widget", "price": 1200},
4)

get_app_data

No session needed

GET /api/app/:appId/app-data

Python
authix.get_app_data(
    *, category: str | None = None,
    limit: int | None = None, cursor: str | None = None,
) -> Page
ParamTypeRequiredDescription
categorystrNoRestrict to one category.
limitintNo1–100. Defaults to 20.
cursorstrNonext_cursor from the previous page.

Returns: Page

Python
1page = authix.get_app_data(category="products", limit=100)
2
3for product in page:
4    print(product["sku"])

iter_app_data

No session needed

GET /api/app/:appId/app-data (paged)

Python
authix.iter_app_data(
    *, category: str | None = None,
    limit: int | None = None, max_pages: int | None = None,
) -> Iterator[dict]
ParamTypeRequiredDescription
categorystrNoRestrict to one category.
limitintNoPage size while iterating.
max_pagesintNoBound the traversal.

Returns: Iterator[dict]

Python
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_data

No session needed

GET /api/app/:appId/data/:itemId

Python
authix.get_single_app_data(*, data_id: str) -> dict
ParamTypeRequiredDescription
data_idstrYesThe record id.

Returns: dict

Python
1product = authix.get_single_app_data(data_id=data_id)

search_in_app_data

No session needed

POST /api/app/:appId/app-data/search

Python
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
ParamTypeRequiredDescription
qstrNoFree-text match.
categorystrNoRestrict to one category.
keysdictNoExact-match filter on payload fields.
limitintNo1–100.
cursorstrNoFor the next page.

Returns: Page

Python
1page = authix.search_in_app_data(
2    category="products",
3    keys={"in_stock": True},
4    q="widget",
5)

update_app_data

No session neededSecret key, server only

PATCH /api/app/:appId/data/:itemId

Python
authix.update_app_data(
    *, data_id: str, data: dict, version: int | None = None,
) -> dict
ParamTypeRequiredDescription
data_idstrYesWhich record.
datadictYesFields to merge in.
versionintNoThe version you read, for optimistic concurrency.

Returns: dict

Python
1authix.update_app_data(
2    data_id=data_id,
3    data={"price": 1100},
4    version=product["version"],
5)
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_data

No session neededSecret key, server only

DELETE /api/app/:appId/data/:itemId

Python
authix.delete_app_data(*, data_id: str) -> dict
ParamTypeRequiredDescription
data_idstrYesWhich record.

Returns: dict

Python
1authix.delete_app_data(data_id=data_id)
Permanent, and app-wide — every user of the app stops seeing it immediately.

Related