Learn how to securely authenticate with our API and understand how access is tied to the party type of the account issuing the tokens.
Requests use the HTTP authorization header to authorize operations. The facilioo API accepts bearer tokens (JWT) in this header. These bearer tokens can be obtained using the /api/auth/login or /api/auth/refresh method.
Level of AccessAccess levels in the facilioo API depend on multiple factors. Beyond dynamic runtime checks, a core aspect is the party type your account belongs to — such as a property management company, contractor, or user. This information is embedded in the
accessTokenand determines which resources and operations are available.To learn more about how accounts and party types relate, see the Parties and Accounts documentation.
Login
| Attribute | Type | Description |
|---|---|---|
email | string | Email of the user |
password | string | The password of the user |
skipMultiFactorAuthentication | boolean | If true, the user will not be asked for multifactor authentication |
Access Token (JWT)
Both access tokens and refresh tokens use JWT open standard.
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE2NTE3NjAyNDIsImV4cCI6MTY1MTc2Mzg0MiwiaXNzIjoiZGV2LWFwaS5mYWNpbGlvby5kZSIsImF1ZCI6ImRldi1hcHAuZmFjaWxpb28uZGUiLCJzdWIiOnsiYWNjb3VudElkIjoyLCJjb21wYW55SWQiOjJ9fQ.KJPsiOzcu8SHXU_GhGz5qS6cg-moXAC83WOLI8J9vFLgk5k0MdkxR8S88Ri0BJuCmifFtHpbR7bH4tKxeF8-pW_wU08uQ_MJxJqcK9MOjyVITsLzok7RJxqevv0SjPZkgqqxGwgGbcgsYJaG2u44RYnnyf5xPce9MKQcfHa23C-NyQIBmseO7RdFNAFZM8Lc-nEf0tjJc3ciBdr7t_s8dUS2vCb4ALWj8Dhrs9UyO3bA1yMQt4xACfQzGbDMV_4R8nbgOL9KkywcmJD-JdcIiYIGk2GEhbhuL05CtJthZT4XWVE0wdA00YmDBdvuekzykDKalXU2C1ED3winvL6VGgNote: The example token has expired and can't be used for authorization.
| Type | Decoded (Example) | Description |
|---|---|---|
| Header | { "alg": "RS256", "kid": "x9LflM4h1du42Ik53mfxRlYgN-zEPqxva3UhyvEkbg8", "typ": "JWT" } | Specifies the type of the token and the algorithm used to sign it. The |
| Payload | { "sub": "2", "partyId": "2", "partyName": "Demo Hausverwaltung", "accountRole": "2", "email": "[email protected]", "scope": "platform", "permissions": "/v3//z/w/c/1IwAa/We23/kGAA==", "telemetry": "{\"UnitCount\":10,\"ProcessCount\":25}", "iat": 1651760242, "exp": 1651763842, "iss": "api.facilioo.de", "aud": "app.facilioo.de" } | The The The The The The The The attribute The attribute The The For more information about claims, please refer to RFC 7519 . |
| Signature | <omitted> | <omitted> |
Verifying Tokens
To verify the signature of an access token yourself, fetch the public keys from the key set (JSON Web Key Set, RFC 7517) and use the key whose kid matches the kid header of the token. The key set needs no authentication.
| Environment | Key set URL |
|---|---|
| Production | https://api.facilioo.de/api/auth/jwks |
| Staging | https://stage-api.facilioo.de/api/auth/jwks |
{
"keys": [
{
"kty": "RSA",
"use": "sig",
"alg": "RS256",
"kid": "x9LflM4h1du42Ik53mfxRlYgN-zEPqxva3UhyvEkbg8",
"n": "sYTOhgsDkokcFw97Sy9bR8Fi…",
"e": "AQAB"
}
]
}Most JWT libraries accept the key set URL directly and pick the matching key themselves. Cache the key set for up to an hour, and fetch it again when a token names a kid that is not in your cached copy, so a new signing key is picked up without a release on your side.
Permissions
Beyond the party type, most endpoints also require the calling account to hold a specific account permission. The permission(s) required for a given endpoint are documented on that endpoint itself (see its authorization section in the API reference) and are checked against the effective permission set embedded in the access token's permissions claim (see above).
The set of all permissions that can be required is exposed via GET /api/account-permissions. Which of those permissions an account actually holds is determined by the account group it belongs to — GET /api/account-groups/{id}/permission-mappings returns the effective permissions of a group. You can find your own account's group by calling GET /api/accounts/myself and looking at its groupId.
Permissions Can Have an Effect Beyond the Endpoint ItselfHolding the permission required by an endpoint grants you access to call it, but does not necessarily mean every result it returns is visible to you. For example, you may be permitted to call the endpoint that lists parties in general, but the actual set of parties returned can still be reduced based on your specific permissions.
Permissions Are Not Evaluated for UsersAccounts with the party type
Userare not subject to account permission checks — required permissions are not evaluated for them.
Refresh
When an access token reaches its expiration, any subsequent API call will result in a status code 401 Unauthorized error. To resolve this, the client should initiate a call to the refresh token endpoint. It is essential for the client to persistently store the refresh token.
By utilizing the refresh token in this scenario, the client can obtain both a new access token and a new refresh token. The newly received refresh token should be saved and used for all future refresh requests.
Request
| Attribute | Type | Description |
|---|---|---|
refreshToken | string | One-time usable refresh token from the last login or refresh request. |
Response
| Attribute | Type | Description |
|---|---|---|
accessToken | string | The access token, which can be used to make new requests. |
refreshToken | object | The refresh token to generate a new set. |
Decoding Tokens
The header and the payload of a token are Base64URL-encoded JSON, so you can read them without a key, e.g. to check the attributes described above or to send the payload to support (see Getting Help). The best way is to decode the payload locally, so the token never leaves your machine, e.g. with Python:
python3 -c "import sys, base64, json; p = sys.argv[1].split('.')[1]; print(json.dumps(json.loads(base64.urlsafe_b64decode(p + '=' * (-len(p) % 4))), indent=2))" "$ACCESS_TOKEN"Or with Node.js:
node -e "console.log(JSON.parse(Buffer.from(process.argv[1].split('.')[1], 'base64url')))" "$ACCESS_TOKEN"An easier way is pasting the token into jwt.io, but we don't recommend this for access tokens of the production environment. To check the signature there as well, choose the public key format JWK and paste the key from the key set whose kid matches the token.
Customer App Password Reset Flow
The password reset flow allows users to recover their account in case they forget their password. It consists of three main steps: sending a recovery email, changing the password using a recovery code, and unblocking the recovery code if necessary.
1. Initiate Password Recovery
Endpoint: POST /api/auth/recover-password
Description: Sends a password recovery message to the user’s email. This operation is rate-limited using the DefaultRateLimitAuth policy.
Behavior:
- The user provides their registered email address.
- The system sends an email with a recovery code or a link containing the recovery code.
- Rate limiting prevents abuse of this endpoint.
Note: This endpoint is currently marked as obsolete and will be removed once an external identity provider is implemented.
Example Request DTO:
{
"email": "[email protected]"
}Response DTO: PasswordRecoveryResponseDto
2. Change Password Using Recovery Code
Endpoint: PUT /api/auth/change-password-with-recovery-code
Description: Changes the user’s password using a recovery code received via email.
Behavior:
- The user enters the recovery code received in their email, along with the new password.
- The system validates the recovery code and updates the user’s password.
- If the user enters the wrong recovery code 5 times, the account will be temporarily blocked for 24 hours.
Example Request DTO:
{
"email": "[email protected]",
"password": "newSecurePassword",
"recoveryCode": "123456"
}Response DTO: PasswordChangeRecoveryCodeResponseDto
Note: This endpoint is also marked as obsolete and will be removed once an identity provider is implemented.
3. Unblock Recovery Code
Endpoint: POST /api/account/unblock-recovery-code
Description: Unblocks a user’s recovery code if the account has been temporarily blocked due to multiple failed attempts.
Behavior:
- Requires authentication with either an Admin or PropertyManagementCompany role.
- The request must include the account’s email address.
- The owner of the account (typically a PropertyManager) can unblock the recovery code.
Example Request DTO:
{
"email": "[email protected]"
}Response DTO: UnblockRecoveryCodeResponseDto
Note: This endpoint is marked as obsolete and will be removed once an identity provider is implemented.
