Skip to content

Authentication and access

Every data endpoint requires a Bearer token. The subscription of your account sets which endpoints it can call. This page covers both, and lists the error responses that your integration handles.

The SolarSENS team creates and manages API accounts. There is no self-service signup. Email support@solarsens.co with each IP address that your integration calls from. The API accepts requests only from IP addresses registered to your account. Use the same support email for plant access changes, subscription changes, and credential resets.

TokenLifetimeHow to get it
Access token1 hourPOST /login/access-token (form fields username, password)
Refresh token7 daysReturned alongside the access token
Non-expiring tokenUntil replacedPOST /login/non-expiring-token (authenticated)

Send the access token on every data request:

Authorization: Bearer <access_token>

When the access token expires, responses change to 401 {"detail": "Token has expired"}. Exchange the refresh token for a new pair instead of signing in again. Pass the refresh token as a query parameter:

Terminal window
curl -X POST "https://www.public.solarsens.co:8443/ava/public/api/v1/login/refresh-token?refresh_token=$REFRESH_TOKEN"

The response has the same shape as the login response: a new access_token and a new refresh_token. An invalid or expired refresh token returns 400 {"detail": "Invalid refresh token"}. Then sign in again with your credentials.

If a server-to-server integration cannot refresh every hour, generate a non-expiring token while you are authenticated:

Terminal window
# Generate (replaces any previous non-expiring token)
curl -X POST "https://www.public.solarsens.co:8443/ava/public/api/v1/login/non-expiring-token" \
-H "Authorization: Bearer $ACCESS_TOKEN"
# Fetch the current one
curl "https://www.public.solarsens.co:8443/ava/public/api/v1/login/non-expiring-token" \
-H "Authorization: Bearer $ACCESS_TOKEN"

Use the token exactly like an access token. Each account holds one non-expiring token at a time. If no token was generated, GET returns 404 {"detail": "Non-Expiring Token not found."}. Protect the token like a password. It stays valid until you replace it, and SolarSENS can revoke it on request.

Your subscription tier decides which endpoint families your account can call:

Tier/data/portfolio/*/data/plant/*
PortfolioYesNo
PlantYesYes
DeviceYesYes

Whatever the tier, each account sees only its own plants. GET /data/plant/list returns exactly the plants that you can query. A request for any other plant_id returns 403. New plants and metadata changes appear in the plant list after the daily refresh. If you need a new plant sooner, contact support.

Errors return a JSON body with a detail field.

StatusMeaningTypical detail
400Bad credentials or invalid refresh token"Invalid refresh token"
401Missing, invalid, or expired token"Token has expired"
403No valid subscription, wrong tier, or plant outside your account"Access to the Plant/Devices is forbidden."
404Resource not found"Non-Expiring Token not found."
422Malformed JSON request bodyValidation object describing the parse error
500Server error"An error occurred: ...". Check System status. If the error continues, contact support.

Request volume terms are set for each account. If you expect high call rates, contact support@solarsens.co.