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.
Account provisioning
Section titled “Account provisioning”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.
Token lifecycle
Section titled “Token lifecycle”| Token | Lifetime | How to get it |
|---|---|---|
| Access token | 1 hour | POST /login/access-token (form fields username, password) |
| Refresh token | 7 days | Returned alongside the access token |
| Non-expiring token | Until replaced | POST /login/non-expiring-token (authenticated) |
Send the access token on every data request:
Authorization: Bearer <access_token>Refresh the access token
Section titled “Refresh the 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:
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.
Non-expiring tokens
Section titled “Non-expiring tokens”If a server-to-server integration cannot refresh every hour, generate a non-expiring token while you are authenticated:
# 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 onecurl "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.
Subscription tiers
Section titled “Subscription tiers”Your subscription tier decides which endpoint families your account can call:
| Tier | /data/portfolio/* | /data/plant/* |
|---|---|---|
| Portfolio | Yes | No |
| Plant | Yes | Yes |
| Device | Yes | Yes |
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.
Error responses
Section titled “Error responses”Errors return a JSON body with a detail field.
| Status | Meaning | Typical detail |
|---|---|---|
| 400 | Bad credentials or invalid refresh token | "Invalid refresh token" |
| 401 | Missing, invalid, or expired token | "Token has expired" |
| 403 | No valid subscription, wrong tier, or plant outside your account | "Access to the Plant/Devices is forbidden." |
| 404 | Resource not found | "Non-Expiring Token not found." |
| 422 | Malformed JSON request body | Validation object describing the parse error |
| 500 | Server 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.