Ulkoasu
Partner apps
A partner app is an integration that acts for a customer company without anyone signed in. Fitor registers the app; each customer's administrator installs it in their own company; your service then mints a short-lived token per installation and calls the REST API with it.
The API is unstable
Everything on this page is subject to the warning on the API overview.
What an app is, and is not
- An app acts as the company, never as a person. Its writes are recorded as the app, and a person leaving the company changes nothing about the installation.
- One installation is one company. There is no token that reaches two companies. A partner with 40 customers holds 40 installations and mints 40 tokens.
- Only the REST operations of the M2M API. A partner app token cannot call GraphQL, the
/auth/v1/*routes, the bureau or group surfaces, or file downloads and exports.
1. Registration
There is no self-service. Contact [email protected]. Before registering an app Fitor checks your business ID in the Finnish business register (YTJ), and records your contact person and the signed partner terms. You receive:
client_id | app_ followed by 20 characters. Not secret. |
client_secret | fsk_…, shown to Fitor staff once and handed to you over a secure channel. |
| Setup address | The https address you gave, where a customer's browser returns after installing. |
| Maximum access | The roles your app may ever request (see Access). |
| Per-app ceiling | Requests per minute across all your installations (see Limits). |
Rotating the secret
Up to two secrets are live at once. Ask Fitor for a second one, deploy it, then ask Fitor to revoke the first. Both work until the first is revoked.
2. Installation
Send the customer's administrator to:
GET https://<fitor>/oauth/install?client_id=app_…&state=<your value>&roles=ROLE_BILLING_READ+ROLE_MASTERDATA_READ| Parameter | |
|---|---|
client_id | Your app. |
state | Returned to you unchanged. Use it to tie the answer to your own session. |
roles | Optional, space-separated. Defaults to your app's maximum access. |
The administrator signs in to Fitor as usual, chooses the company, and sees a consent screen naming your app, your company and each requested permission in plain words. They may untick any of them. Only an administrator of that company can install.
The browser then returns to your setup address:
| Outcome | Query parameters |
|---|---|
| Installed | installation_id=<ULID>&tenant=<company id>&state=… |
| Declined, or the user is not an administrator | error=access_denied&state=… |
| A requested role is outside your app's maximum | error=invalid_scope&state=… |
| The app is suspended | error=unauthorized_client&state=… |
| The company's Fitor subscription does not include API integrations | error=api_integrations_not_entitled&state=… |
Store installation_id. It is not a secret: another app's secret cannot spend it.
Installing again in the same company replaces the earlier installation. The company's administrators see every installation, its access and its last use under Settings › Installed apps, and can revoke it there at any time.
3. Minting a token
http
POST /oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=app_…&client_secret=fsk_…&installation_id=01J…&scope=ROLE_BILLING_READscope is optional and narrows the token further (space-separated role names). The answer:
json
{ "access_token": "fit_…", "token_type": "Bearer", "expires_in": 3600, "scope": "ROLE_BILLING_READ" }The token lasts one hour and there is no refresh token: mint a new one with your secret when it expires. Call the API with Authorization: Bearer fit_….
Access
Access is expressed as role names — the same roles a Fitor user holds, for example ROLE_BILLING_READ or ROLE_MASTERDATA_WRITE. A token holds the intersection of:
- your app's maximum access, set by Fitor at registration (never an administrator role);
- what the installing administrator could grant themselves, and left ticked;
- the
scopeyou asked for when minting, if any.
If Fitor later narrows your app's maximum, the next token is narrowed too. Every API operation then checks the token's roles exactly as it checks a user's, so a read-only role cannot write. The OpenAPI specification (GET /docs.json) names the permission each operation needs.
Limits
| Limit | Value | Answer when exceeded |
|---|---|---|
| Each installation | 120 requests / minute | 429 with Retry-After, errorCode: RATE_LIMITED |
| All installations of your app | The per-app ceiling set at registration | 429 with Retry-After, errorCode: RATE_LIMITED |
| Minting, per app | 60 tokens / minute | 429 with Retry-After, error: slow_down |
| Wrong secrets, per app and address | 10 / 5 minutes | 429 with Retry-After, error: slow_down, for every request from that address |
| Wrong secrets, per app from all addresses | 100 / 5 minutes | 429 with Retry-After, error: slow_down, for a wrong secret only |
Wrong secrets sent by someone else cannot lock you out: your correct secret is always accepted from any address that has not itself sent too many wrong ones.
One busy customer's sync cannot use another customer's allowance, but all of them share your app's ceiling.
Errors
When minting
OAuth error bodies ({"error": …, "error_description": …}); key on error.
error | Status | Cause |
|---|---|---|
invalid_request | 400 | client_id, client_secret or installation_id is missing. |
invalid_client | 401 | Unknown, suspended or inactive app, or a wrong or revoked secret. |
slow_down | 429 | Over the minting limit or a wrong-secret limit. Wait Retry-After seconds. |
unauthorized_client | 400 | The client is not registered for this grant. |
invalid_grant | 400 | The installation is unknown, revoked, belongs to another app, or the company is not active. |
invalid_scope | 400 | scope names a role outside the installation's grant, or nothing usable is left. |
api_integrations_not_entitled | 403 | The company's Fitor subscription does not include API integrations. A token minted earlier keeps working until it expires. |
When calling the API
The usual error format; key on errorCode.
| Status | errorCode | Cause |
|---|---|---|
| 401 | — | The token expired, the installation was revoked, or the app was suspended. Takes effect on the next request. |
| 403 | PARTNER_APP_SURFACE_REFUSED | The route is outside the M2M REST surface. |
| 403 | ACCESS_DENIED | The token's roles do not include what the operation needs. |
| 429 | RATE_LIMITED | Over the per-installation limit or the per-app ceiling. |
A 401 after revocation is final for that installation: ask the customer to install the app again. If Fitor suspends your app, every installation stops at once and each customer's administrators are told; nothing is deleted, and reinstatement restores them.
What Fitor records
Every token use is logged with the installation, route, time and result — never the request or response contents — and kept for two years. Every write your app causes is attributed to the app.