API overview
Base URL, JSON conventions, pagination, and error shape.
The SaaSFlow API is HTTPS-only and uses JSON for both requests and responses. Almost
every resource lives under /companies/{companyId}/….
Base URLs
| Environment | URL |
|---|---|
| Production | https://api.saasflow.com |
| Staging | https://staging-api.saasflow.com |
| Local dev (sfdev) | https://{handle}-api.saasflow.com |
Resource structure
/companies Companies you have access to
/companies/{companyId} One company
/companies/{companyId}/accounts Bank/cash accounts
/companies/{companyId}/customers
/companies/{companyId}/vendors
/companies/{companyId}/transactions
/companies/{companyId}/subscriptions
/companies/{companyId}/categories
/companies/{companyId}/products
/companies/{companyId}/files
/companies/{companyId}/integrations
/companies/{companyId}/data/{slice} Analytics slices (MRR, P&L, etc.)
/companies/{companyId}/search?q=… Free-text searchSee API reference for every endpoint with parameters, responses, and code samples, and Data slices for the analytics endpoints.
Pagination
List endpoints accept limit and offset query params. When limit is set, the
response is wrapped:
{
"items": [...],
"totalCount": 1432
}Without limit, some list endpoints return a bare array. Always pass limit if you
want pagination metadata.
Errors
Errors are JSON with a non-2xx status code:
{
"error": "Invalid request",
"code": "validation_failed"
}code is optional; error is always present. The HTTP status code is the source of
truth:
| Status | Meaning |
|---|---|
400 | Bad request — usually validation. |
401 | Missing or invalid credentials. |
403 | Authenticated but lacking permission (see Team & permissions). |
404 | Resource not found (or hidden by your permissions). |
409 | Conflict — e.g. trying to create a duplicate. |
429 | Rate-limited (rare). |
5xx | Server error — safe to retry. |
Content types
- Requests with a body:
Content-Type: application/json. - Responses:
Content-Type: application/jsonfor data,Content-Type: application/pdfor similar for file downloads under/files.
OpenAPI spec
The full OpenAPI 3.1 document is served at
https://api.saasflow.com/openapi and is also
bundled in the @saasflow/api-client
package:
import openapiSpec from '@saasflow/api-client/openapi.json';The API reference is generated from the same document.