apiRequest

api.apiRequest(endpoint, options?) Sends an authenticated HTTP request to the public REST API. The SDK adds Authorization: Bearer with the current access token and refreshes it on expiry. Resolves with a plain object { ok, status, data } (the parsed response) — not a fetch Response, so read response.data rather than calling response.json().

Arguments
argumentTypeDescription
endpointrequiredstringAPI path starting with /api/v1/... (e.g. /api/v1/cards/123). See the REST section for the full list of endpoints.
optionsRequestInitOptional fetch options (method, headers, body, etc.). The Authorization header is added automatically.

Return value - Promise<{ ok: boolean, status: number, data: any }>

// Inside an addon iframe
const api = window.Addon.iframe();

// Generic request — resolves with { ok, status, data } (not a fetch Response).
const response = await api.apiRequest('/api/v1/cards/123', {
  method: 'GET',
});

if (response.ok) {
  const card = response.data;
}
logo
FlowFast
If you have any questions or need help with integration feel free to write us at support@flowfast.io