google route optimization does not return polyline - role error?
06:25 09 Feb 2026

i'm using routeoptimization api and i see something strange:

if I use the api key gotten with gcloud auth print-access-token (i tested on postman), the api returns polylines,

but when i use the same request body (populate polylines and transition polylines are true) on my backend it does not return polylines, as in the field is there but it is null.

i use the node library for the api: @googlemaps/routeoptimization

what i think may be the problem is that i am using a service account for the backend, and maybe it's missing some role? it has "route optimization editor" and everything else seems to work correctly

i think everything else seems correct so i am doubting the permissions it has

google-cloud-platform