Traccar Server integration requires API Key, breaks with Traccar <6.x

Hello!
After HA 2025.11, the Traccar Server integration now requires an API Key (token) for authentication.
Our server is Traccar add-on 5.12, which does not support /api/session/token endpoint.
Previously, login/password worked fine.

Please consider backward compatibility or allow login/password authentication for older Traccar versions.

6 Likes

Report in GitHub may get more attention from the developers.

Hello! Bumping…

I’m using TracCar HA addon v0.25.0 that is not maintaining anymore. I don’t understand why TracCar Integration dropped user/password as addon is still ustable…

I ran this script on my server and was able to get the api key

#!/bin/bash

get_traccar_token.sh — Display Traccar API token cleanly (no file, no errors)

SERVER=“http://serverip:8082

echo “=== Traccar API Token Generator ===”
read -p "Enter Traccar username (email): " USERNAME
read -s -p "Enter Traccar password: " PASSWORD
echo “”
read -p "Enter token expiration date (YYYY-MM-DD, default: 2035-01-01): " EXPIRATION
EXPIRATION=${EXPIRATION:-2035-01-01}

AUTH=$(echo -n “$USERNAME:$PASSWORD” | base64 | tr -d ‘\n’)

echo “”
echo “Requesting token from $SERVER …”
echo “”

RESPONSE=$(curl -s -X POST “$SERVER/api/session/token”
-H “Authorization: Basic $AUTH”
-H “Content-Type: application/x-www-form-urlencoded”
–data-urlencode “expiration=${EXPIRATION}T00:00:00Z”)

Extract token if possible

TOKEN=$(echo “$RESPONSE” | grep -oP ‘(?<=“token”\s*:\s*“)[^”]+’ | head -n1)

echo “Raw response:”
echo “$RESPONSE”
echo “”

if [[ -n “$TOKEN” ]]; then
echo “:white_check_mark: Extracted Token:”
echo “$TOKEN”
echo “”
echo “Use it like this:”
echo “curl -H "Authorization: Bearer $TOKEN" $SERVER/api/devices”
fi

This script doesn’t work for me, but was able to generate a token with the traccar webapp->settings->Token

2 Likes

Thanks. Summary, solution is just to create a toke a copy/past it in HA when it request API.

I got this problem now having updated HA. I run my own server locally as the Add-On.

Solved it by going to the local web page http://IP Address:8082 then Settings/Preferences/Token. I clicked the little wheely thing icon and a Token appeared in the box. Copied that into HA Repair dialog and it accepted it ok.

The only thing was I left the date of the token only a few day’s away so might have to go and re-do it soon.