Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

422 API Error (duplicate txid)

This site may earn commission on affiliate links.
Hi there,

I'm getting an error 422 response when asking for vehicle data.
{
"response": null,
"error": "{\"error\": \"duplicate txid xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"} for txid `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`",
"error_description": ""
}

Does anyone know why this error appears?
I'm polling https://owner-api.teslamotors.com/api/1/vehicles/XXXXXXXXXXXXXX/data
I'm using a valid token as Authentication.

Thank you!
 
This doesn't solve the problem for me. API calls were all failing last night. This morning they started working. This evening they stopped working again. I can't even login to my mobile application, so I don't believe this has anything to do with a change in the API request URL.

When I tried changing the request from "data" to "vehicle_data" the response code changed from 4xx to 5xx. It seems Tesla's APIs are just down and have been flaky for the past week+.
 
This morning the request with "data" is back to working intermittently. I tried changing to "vehicle_data" and now it's working consistently. So apparently, last night the APIs were just down completely. "vehicle_data" appears to be the better endpoint.
 
@radiusman thank you for this. Just out of curiosity, how did you decide to try that?

As I was investigating my issue, I happened to look up the API documentation again and noticed the URL had changed. I tried the new one and it worked instantly.

Documentation here:
State And Settings

I didn't notice it till now, but on the documentation on this link it actually lists '/data' as 'legacy'.