Skip to main content

Authentication

Reconstructed from API key points.

Single endpoint:

https://{client-subdomain}.ublo.immo/api/graphql

Two authentication modes are available:

ModeLifetimeTypical use
Session cookie (UBLO_TOKEN_AUTHENTICATION)~7 daysScripts, curl trials, token generation
API token (Authorization: Bearer …)No expiry (revocable)Long-lived server integrations
Never expose the session or token in a public browser

Keep cookies.txt / the Bearer token only in your backend, worker, or CI.

Step 1 — Open a session (login)

The login mutation creates the UBLO_TOKEN_AUTHENTICATION cookie. Prefer a collaborator attached to the parent company (otherwise you may hit BU-related unauthorized).

With curl, persist the cookie jar with -c:

# -c cookies.txt: write the session cookie (UBLO_TOKEN_AUTHENTICATION)
curl -sS -X POST 'https://example.ublo.immo/api/graphql' \
-H 'Content-Type: application/json' \
-c cookies.txt \
-d '{
"query": "mutation Login($email: String!, $password: String!) { login(email: $email, password: $password) }",
"variables": {
"email": "[email protected]",
"password": "YOUR_PASSWORD"
}
}'
curl optionRole
-c cookies.txtWrite the cookie jar after the response (Set-Cookie)
-b cookies.txtSend the jar on subsequent requests

Once cookies.txt exists, reuse it on every query / mutation with -b (no Bearer):

# -b cookies.txt: send the session opened at login
curl -sS -X POST 'https://example.ublo.immo/api/graphql' \
-H 'Content-Type: application/json' \
-b cookies.txt \
-d '{"query":"query { company { id name } }"}'

Equivalent Node.js (Cookie header):

const cookieHeader = /* UBLO_TOKEN_AUTHENTICATION value from login */;

const { data } = await gql(
`query { company { id name } }`,
undefined,
{ cookieJar: cookieHeader },
);
Logout

Call the logout mutation (still with -b cookies.txt) to invalidate the session, then delete the jar file.

Option B — Generate an API token (Bearer)

For long-lived integrations: generate a token after login (cookie required), then authenticate with Authorization: Bearer ….

The mutation returns an ApiTokenResponse: the token is in success; on failure, use error.

mutation {
generateApiToken {
success
error
}
}

Related schema ops: apiTokens, revokeToken.

Subsequent Bearer calls

curl -sS -X POST 'https://example.ublo.immo/api/graphql' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-d '{"query":"query { company { id name } }"}'
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${process.env.UBLO_API_TOKEN}`,
}

Every cookbook curl tab offers Bearer and Cookie session variants. The Node helper accepts UBLO_API_TOKEN or UBLO_COOKIE.

Next