Skip to content

Add support for vehicle​_location Fleet API scope#184

Merged
jonasman merged 2 commits into
jonasman:masterfrom
Krillle:master
Jun 3, 2026
Merged

Add support for vehicle​_location Fleet API scope#184
jonasman merged 2 commits into
jonasman:masterfrom
Krillle:master

Conversation

@Krillle

@Krillle Krillle commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Tesla’s Fleet API now requires the vehicle​_location scope for vehicle data requests such as get​All​Data(vehicle).

Without this scope, calls to /vehicle​_data can fail with 403 ​Forbidden, even when the client is otherwise authenticated correctly.

This change:
• adds case vehicle​Location = "vehicle​_location" to Tesla​API​.​Scope
• includes .vehicle​Location in Tesla​API​.​Scope​.all

This keeps the default Fleet API scope set aligned with current Tesla requirements and prevents missing-scope failures for apps using get​All​Data(...).

Why
Apps using Tesla​Swift with the Fleet API can otherwise hit authorization errors when requesting vehicle data, especially location-related fields included in /vehicle​_data.

Change summary
• Sources​/​Tesla​Swift​/​Tesla​Swift​.swift
• add vehicle​Location scope
• include it in Scope​.all

Tesla recently started requiring the `vehicle_location` scope for the `/vehicle_data` endpoint.
Without this scope, calls like `getAllData(vehicle)` fail with HTTP 403 (Forbidden).

This PR adds `.vehicleLocation = "vehicle_location"` to the `TeslaAPI.Scope` enum so developers
can request the proper scope when initializing the Fleet API client.
Patch Add support for `vehicle_location` Fleet API scope
@jonasman

Copy link
Copy Markdown
Owner

Thanks. I was under the impression that this was already added for some reason

@jonasman jonasman merged commit 82552c2 into jonasman:master Jun 3, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants