window.aptly. New to the SDK? Start with the Quickstart.
Related documentation:
- Building Embedded Apps & Dashboards — full guide for embedded apps and dashboards
- Embed App Actions — per-action payload reference and permission model
- Delegate Tokens — raw token exchange API for server-side integrations
- Field Types Reference — value formats for reading and writing card data
- Rate Limits — request limits and 429 handling
Canonical pattern
Always callrequestToken with { version: 2 }. It returns a result object — token on success, structured error on failure — so you can handle rate limits and other failures without a separate side channel.
Note:requestToken()called without arguments returns a barestring | nullfor backward compatibility. Prefer{ version: 2 }in all new code.
API reference
Fetching board data
aptly.fetch prepends the Aptly API base URL and handles auth automatically. Pass the path starting from /board/ — omit /api.
Pagination
Pages are zero-based. The first page is
page=0, the second is page=1, and so on. The page parameter is required — omitting it returns a 400 error.Query parameters
Schema endpoint
To get the field definitions for a board (key → label → type mapping):{ data }).
Config scoping
aptly.config always contains the fully merged configuration for the current context — app devs just read aptly.config.YOUR_KEY without knowing which scope a value came from.
Admins set a contextScope on each app that controls how config values are stored:
Merge priority:
user > board > company. If the same key is set at multiple levels, the narrowest scope wins.
Rate limiting
Token requests are rate-limited per browser connection (not per user account), so opening the same app in multiple tabs does not share a quota. The default limit is 60 token requests per 60 seconds per connection. When the limit is exceeded,requestToken({ version: 2 }) returns { token: null, error } where error is:
Handling rate limit errors
Use{ version: 2 } and check the error field:
aptly.fetch does not automatically retry on rate limit errors — it only retries once on 401. Your app is responsible for scheduling retries when error.code === 'RATE_LIMITED'.
URL params (Option C dev testing)
Append any of these to your app’s URL to simulate Aptly context with no code changes:
Example:
Standard boards
aptly.boards delivers pre-fetched schema and records for standard Aptly board types — no fetches required. The app admin selects which boards to pre-load in the marketplace admin panel. Only declared boards are populated; undeclared keys are null.
Board data shape
Each non-null entry is aBoardData object:
Usage
Board keys
A key is
null if the app didn’t declare that board, or if the company doesn’t have it. Always guard:
Fetching more records
The first 50 records are pre-loaded. Iftotal > 50, use aptly.fetch to page through the rest:
Dev mode
aptly.boards is null by default in startEmulation and APTLY_DEV (no live Aptly session to deliver data). Pass a boards override to simulate it locally. You can use either the full rich object or a plain UUID string (the SDK normalizes it):
startEmulation: