REST API & SDK reference
Every endpoint, the SDK function that wraps it in Python and JavaScript, its fields, its errors, and its limits. Base URL https://www.usethatapp.com; JSON in and out. A live OpenAPI schema is at https://www.usethatapp.com/api/v1/schema/ with Swagger UI at https://www.usethatapp.com/api/v1/docs/.
Endpoints at a glance
| Endpoint | Auth | Python | JavaScript |
|---|---|---|---|
GET /api/v1/public/apps/{client_id}/ | none | get_app_info() | getAppInfo() |
GET /api/v1/public/apps/{client_id}/prices/ | none | get_prices() | getPrices() |
GET /api/v1/public/search/ | none | — | — (see Search API) |
/buy/{price_id}/ (browser link) | — | purchase_url(price_id, next=, ref=, email=) | purchaseUrl(priceId, { next, ref, email }) |
/manage/{client_id}/ (browser link) | — | manage_url(next=) | manageUrl({ next }) |
GET /api/v1/orders/{ref} | client | get_order(ref) | getOrder(ref) |
POST /api/v1/licenses/validate | client | validate_license_key(key) | validateLicenseKey(key) |
POST /api/v1/licenses/{license_id}/regenerate-key | client | regenerate_license_key(license_id) | regenerateLicenseKey(licenseId) |
GET /licensing/entitlement/ | bearer | get_entitlement(access_token) | getEntitlement(accessToken) |
OpenID Connect under /o/ | — | begin_login, complete_login, refresh, userinfo, logout_url | beginLogin, completeLogin, refresh, userinfo, logoutUrl |
none: anonymous, CORS-enabled for any origin. client: HTTP Basic with the app's client id and secret, server to server. bearer: an end user's access token from Hosted sign-in. Python also has get_entitlement_async, get_prices_async and get_app_info_async.
SDKs
pip install usethatapp # Python 3.9+
npm install usethatapp # Node 18+Both packages are server-side and framework-agnostic: they take and return plain values, and you wire them into your routes. Source and runnable examples: https://github.com/UseThatApp/python and https://github.com/UseThatApp/javascript.
Configuration
The SDKs read environment variables (Python also reads Django settings). configure(...) overrides them in code.
| Variable | Needed for | Default |
|---|---|---|
UTA_CLIENT_ID | Everything except purchase_url | — |
UTA_CLIENT_SECRET | License keys, Hosted sign-in | — |
UTA_CLIENT_SECRET_PATH | Read the secret from a mounted file instead | — |
UTA_REDIRECT_URI | Hosted sign-in | — |
UTA_SCOPES | Hosted sign-in | openid entitlements |
UTA_API_URL | Pointing at another instance | https://www.usethatapp.com |
UTA_ISSUER | Pointing at another instance | https://www.usethatapp.com/o |
UTA_REQUEST_TIMEOUT_SECONDS | — | 10 |
UTA_CLOCK_SKEW_SECONDS | ID-token time leeway | 60 |
Store the secret in your host's secret store (or a mounted secret file with UTA_CLIENT_SECRET_PATH), never in source control and never in anything a browser or a shipped binary can read. It is shown once and stored hashed. If it leaks, rotate it on Manage app → Integration or with MCP regenerate_client_secret; the old secret stops working at once.
App profile
{
"client_id": "AbC123dEf456",
"name": "Acme Analytics",
"tagline": "Dashboards your team actually reads",
"listing_mode": "external",
"url": "https://acmeanalytics.com",
"marketplace_url": "https://www.usethatapp.com/apps/acme-analytics/"
}listing_mode is external (the default: the app's search card links to its own site) or marketplace (a full product page on usethatapp.com).
Prices
{
"client_id": "AbC123dEf456",
"app_name": "Acme Analytics",
"has_free_tier": true,
"prices": [
{
"public_id": "prc_9f2kq8w7",
"product_id": "prod_9XkKe2QGxN4Ttz1Rw7Ya",
"product_name": "Pro",
"amount": "10.00",
"currency": "usd",
"is_recurring": true,
"frequency": "month",
"trial_period_days": 14,
"buy_url": "https://www.usethatapp.com/buy/prc_9f2kq8w7/"
}
]
}| Field | Meaning |
|---|---|
public_id | The price id (prc_…), used in buy links. |
product_id | The plan's prod_… id. Equal to product_public_id in license and entitlement responses: the plan bought is the plan you gate. |
amount | Decimal string, tax-exclusive ("10.00"). |
currency | Lowercase ISO code ("usd"). |
is_recurring, frequency | frequency is day, week, month, year, or null for a one-time price. |
trial_period_days | 7, 14, 30 or null: the trial offered, not whether this visitor qualifies. |
buy_url | The hosted checkout link for this price. Use it as the Buy button's href. |
has_free_tier | The app has a free plan. Free plans have no price rows. |
Both public endpoints answer 404 unless the app is published and its external sales is on (an unknown client_id looks the same). Responses carry Cache-Control: public, max-age=60.
Buy and manage links
https://www.usethatapp.com/buy/<prc_id>/?next=<url>&ref=<affiliate code>&email=<address>
https://www.usethatapp.com/manage/<client_id>/?next=<url>Every parameter is optional. next must be HTTPS on the app's registered domain (localhost allowed). After a paid checkout, uta_order=<ref> is appended to the return URL. Behaviour of each parameter: Sell from your website. The SDK builders make no network call; purchase_url needs no configuration and manage_url needs UTA_CLIENT_ID.
License keys and orders
Authenticate with HTTP Basic: username = client id, password = client secret.
# Exchange the uta_order from the return URL for the key
curl -u "$UTA_CLIENT_ID:$UTA_CLIENT_SECRET" \
"https://www.usethatapp.com/api/v1/orders/$UTA_ORDER"
# Validate a stored key
curl -u "$UTA_CLIENT_ID:$UTA_CLIENT_SECRET" \
-H "Content-Type: application/json" -d '{"key": "key_..."}' \
https://www.usethatapp.com/api/v1/licenses/validate
# Rotate a leaked key (old key dies immediately)
curl -u "$UTA_CLIENT_ID:$UTA_CLIENT_SECRET" -X POST \
"https://www.usethatapp.com/api/v1/licenses/$LICENSE_ID/regenerate-key"{
"entitled": true,
"status": "active",
"license_id": "lic_...",
"product_id": "prod_9XkKe2QGxN4Ttz1Rw7Ya",
"product_public_id": "prod_9XkKe2QGxN4Ttz1Rw7Ya",
"is_trial": false,
"period_end": "2026-12-02",
"canceled_at": null
}| Field | Meaning |
|---|---|
entitled | Whether this key may use the app now. Gate on this. |
status | See statuses. |
license_id | Stable id of the license. Pass it to regenerate. |
product_public_id, product_id | The prod_… plan held now (equal values). |
is_trial | In a free trial. |
period_end | ISO date the paid period or trial ends; null for one-time purchases. |
canceled_at | When the license ended for good, or null. |
license_key | Only from orders and regenerate (regenerate also adds rotated_at). |
An order whose license is not stored yet answers 202 {"status": "processing"}: retry after a second or two.
Entitlement
For Hosted sign-in. Send the user's access token as Authorization: Bearer <token>. The path /api/v1/entitlement/ is an identical alias.
{
"entitled": true,
"version": "Pro",
"product_id": "prod_9XkKe2QGxN4Ttz1Rw7Ya",
"product_public_id": "prod_9XkKe2QGxN4Ttz1Rw7Ya",
"status": "active",
"is_free": false,
"is_trial": false,
"period_end": "2026-12-02"
}| Field | Meaning |
|---|---|
entitled | The user may use the app now (a paid plan, a trial, or your free plan). Gate on this. |
product_public_id, product_id | The prod_… plan (equal values), or null. |
version | The plan's display name. Show it; never branch on it. |
status | active, trialing, one_time_active, free, preview (developer test), or none. |
is_free | The entitlement is the app's free plan. |
is_trial | In a free trial; period_end is the conversion date. |
period_end | ISO date the current period ends, or null. |
The response never includes sub; identity comes from sign-in.
OpenID Connect
Issuer https://www.usethatapp.com/o; discovery at https://www.usethatapp.com/o/.well-known/openid-configuration. Authorization code with PKCE; the token endpoint takes the client secret. Scopes: openid entitlements. The ID token and userinfo carry only the pairwise sub. Logout is RP-initiated through end_session_endpoint. Any certified OIDC client library works if you are not using the SDK.
Errors
Error bodies are {"error": "<code>"}. Every SDK exception subclasses UtaError; names are identical in Python and JavaScript.
| HTTP | Body error | Where | SDK exception | What to do |
|---|---|---|---|---|
| 400 | message | entitlement | UtaError | The OAuth client is not linked to an app. Configuration bug. |
| 401 | invalid_token | entitlement, userinfo | UtaTokenError | Refresh or sign in again; after logout, clear the session. |
| 401 | invalid_client | licenses, orders | UtaConfigError | Wrong client id or secret. |
| 403 | insufficient_scope | entitlement | UtaPermissionError | Sign in again with openid entitlements. |
| 403 | service_not_enabled | entitlement | UtaServiceNotEnabledError | Hosted sign-in add-on is off. Not user-fixable. |
| 404 | unknown_key, unknown_order, unknown_license | licenses, orders | UtaNotFoundError (.code) | Never issued for this app. |
| 404 | — | public apps, prices | UtaError | App unknown, unpublished, or external sales off. |
| 202 | processing | orders | UtaOrderProcessingError | Retry shortly. |
| 409 | license_canceled | regenerate | UtaLicenseCanceledError | The license is gone; nothing to rotate. |
| 429 | varies (rate_limited on licenses, orders and entitlement; detail on public endpoints) | all | UtaServerError | Wait Retry-After seconds (retry_after / retryAfter). |
| 5xx | — | all | UtaServerError | Retry with backoff. |
Raised locally: UtaConfigError for missing settings, UtaDiscoveryError when the OIDC discovery document or keys cannot be fetched, and UtaAuthError when a sign-in callback fails its state check or lacks a code. A cancelled purchase never raises: it returns entitled: false.
Rate limits
| Surface | Limit |
|---|---|
| Public app profile and prices | 120 / minute per IP |
| Search API | 60 / minute per IP |
| Order lookup, key validation | 120 / minute per IP and client |
| Key regeneration | 30 / minute per IP and client |
| Entitlement | 60 / minute per token |
| MCP server | 60 / minute per token |
