curl --request POST \
--url https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"attributes": {
"vehicleId": "a6a425d6-c661-4b21-af7a-d6b75f80f3b0",
"userId": "1e258add-fb21-4293-b9ab-cf8a61f7a880",
"redirectUri": "https://example.com/smartcar/callback"
}
}
}
'import requests
url = "https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity"
payload = { "data": { "attributes": {
"vehicleId": "a6a425d6-c661-4b21-af7a-d6b75f80f3b0",
"userId": "1e258add-fb21-4293-b9ab-cf8a61f7a880",
"redirectUri": "https://example.com/smartcar/callback"
} } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
attributes: {
vehicleId: 'a6a425d6-c661-4b21-af7a-d6b75f80f3b0',
userId: '1e258add-fb21-4293-b9ab-cf8a61f7a880',
redirectUri: 'https://example.com/smartcar/callback'
}
}
})
};
fetch('https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'attributes' => [
'vehicleId' => 'a6a425d6-c661-4b21-af7a-d6b75f80f3b0',
'userId' => '1e258add-fb21-4293-b9ab-cf8a61f7a880',
'redirectUri' => 'https://example.com/smartcar/callback'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"vehicleId\": \"a6a425d6-c661-4b21-af7a-d6b75f80f3b0\",\n \"userId\": \"1e258add-fb21-4293-b9ab-cf8a61f7a880\",\n \"redirectUri\": \"https://example.com/smartcar/callback\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"attributes\": {\n \"vehicleId\": \"a6a425d6-c661-4b21-af7a-d6b75f80f3b0\",\n \"userId\": \"1e258add-fb21-4293-b9ab-cf8a61f7a880\",\n \"redirectUri\": \"https://example.com/smartcar/callback\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"attributes\": {\n \"vehicleId\": \"a6a425d6-c661-4b21-af7a-d6b75f80f3b0\",\n \"userId\": \"1e258add-fb21-4293-b9ab-cf8a61f7a880\",\n \"redirectUri\": \"https://example.com/smartcar/callback\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "9f1c2b7e-3a4d-4e5f-8a9b-0c1d2e3f4a5b",
"type": "interaction",
"attributes": {
"interactionType": "select-battery-capacity",
"url": "https://connect.smartcar.com/battery-capacity?token=REDACTED",
"expiresAt": "2026-11-07T18:00:00Z"
},
"meta": {
"createdAt": "2026-10-08T18:00:00Z"
}
}
}{
"errors": [
{
"status": "400",
"type": "VALIDATION",
"code": "BAD_REQUEST",
"title": "Bad Request",
"detail": "The request could not be understood by the server due to malformed syntax.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/validation-errors"
}
}
]
}{
"errors": [
{
"status": "401",
"type": "AUTHENTICATION",
"code": "UNAUTHORIZED",
"title": "Unauthorized",
"detail": "The Authorization token is missing or invalid.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/authentication-errors#authentication"
}
}
]
}{
"errors": [
{
"status": "403",
"type": "AUTHENTICATION",
"code": "FORBIDDEN",
"title": "Forbidden",
"detail": "You do not have permission to access this resource.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/authentication-errors"
}
}
]
}{
"errors": [
{
"status": "404",
"type": "RESOURCE_NOT_FOUND",
"code": "NOT_FOUND",
"title": "Not Found",
"detail": "The requested resource could not be found.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/resource-not-found-errors"
}
}
]
}{
"errors": [
{
"status": "422",
"type": "VALIDATION",
"code": "INTERACTION_NOT_APPLICABLE",
"title": "Interaction Not Applicable",
"detail": "This vehicle doesn't have more than one battery capacity option, so there's nothing for the owner to choose. Read its capacity from the tractionbattery-nominalcapacity signal."
}
]
}{
"errors": [
{
"status": "500",
"type": "SERVER",
"code": "INTERNAL",
"title": "Internal Server Error",
"detail": "An unexpected error occurred on the server.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/server-errors"
}
}
]
}Create a select-battery-capacity interaction
Creates a URL that takes the vehicle owner to Smartcar Connect to
choose the vehicle’s battery capacity. While the URL’s token is valid,
the owner isn’t asked to log in again. The token is valid until
expiresAt (30 days) at the latest. It may stop being valid earlier,
for example after the owner completes a selection or when a newer URL
is created for the same vehicle. After that the URL still works, but
the owner has to log in first.
Returns 422 if the vehicle has fewer than two capacity options, because there’s nothing for the owner to choose.
curl --request POST \
--url https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"attributes": {
"vehicleId": "a6a425d6-c661-4b21-af7a-d6b75f80f3b0",
"userId": "1e258add-fb21-4293-b9ab-cf8a61f7a880",
"redirectUri": "https://example.com/smartcar/callback"
}
}
}
'import requests
url = "https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity"
payload = { "data": { "attributes": {
"vehicleId": "a6a425d6-c661-4b21-af7a-d6b75f80f3b0",
"userId": "1e258add-fb21-4293-b9ab-cf8a61f7a880",
"redirectUri": "https://example.com/smartcar/callback"
} } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
attributes: {
vehicleId: 'a6a425d6-c661-4b21-af7a-d6b75f80f3b0',
userId: '1e258add-fb21-4293-b9ab-cf8a61f7a880',
redirectUri: 'https://example.com/smartcar/callback'
}
}
})
};
fetch('https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'attributes' => [
'vehicleId' => 'a6a425d6-c661-4b21-af7a-d6b75f80f3b0',
'userId' => '1e258add-fb21-4293-b9ab-cf8a61f7a880',
'redirectUri' => 'https://example.com/smartcar/callback'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity"
payload := strings.NewReader("{\n \"data\": {\n \"attributes\": {\n \"vehicleId\": \"a6a425d6-c661-4b21-af7a-d6b75f80f3b0\",\n \"userId\": \"1e258add-fb21-4293-b9ab-cf8a61f7a880\",\n \"redirectUri\": \"https://example.com/smartcar/callback\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"attributes\": {\n \"vehicleId\": \"a6a425d6-c661-4b21-af7a-d6b75f80f3b0\",\n \"userId\": \"1e258add-fb21-4293-b9ab-cf8a61f7a880\",\n \"redirectUri\": \"https://example.com/smartcar/callback\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vehicle.api.smartcar.com/v3/interactions/select-battery-capacity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"attributes\": {\n \"vehicleId\": \"a6a425d6-c661-4b21-af7a-d6b75f80f3b0\",\n \"userId\": \"1e258add-fb21-4293-b9ab-cf8a61f7a880\",\n \"redirectUri\": \"https://example.com/smartcar/callback\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "9f1c2b7e-3a4d-4e5f-8a9b-0c1d2e3f4a5b",
"type": "interaction",
"attributes": {
"interactionType": "select-battery-capacity",
"url": "https://connect.smartcar.com/battery-capacity?token=REDACTED",
"expiresAt": "2026-11-07T18:00:00Z"
},
"meta": {
"createdAt": "2026-10-08T18:00:00Z"
}
}
}{
"errors": [
{
"status": "400",
"type": "VALIDATION",
"code": "BAD_REQUEST",
"title": "Bad Request",
"detail": "The request could not be understood by the server due to malformed syntax.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/validation-errors"
}
}
]
}{
"errors": [
{
"status": "401",
"type": "AUTHENTICATION",
"code": "UNAUTHORIZED",
"title": "Unauthorized",
"detail": "The Authorization token is missing or invalid.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/authentication-errors#authentication"
}
}
]
}{
"errors": [
{
"status": "403",
"type": "AUTHENTICATION",
"code": "FORBIDDEN",
"title": "Forbidden",
"detail": "You do not have permission to access this resource.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/authentication-errors"
}
}
]
}{
"errors": [
{
"status": "404",
"type": "RESOURCE_NOT_FOUND",
"code": "NOT_FOUND",
"title": "Not Found",
"detail": "The requested resource could not be found.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/resource-not-found-errors"
}
}
]
}{
"errors": [
{
"status": "422",
"type": "VALIDATION",
"code": "INTERACTION_NOT_APPLICABLE",
"title": "Interaction Not Applicable",
"detail": "This vehicle doesn't have more than one battery capacity option, so there's nothing for the owner to choose. Read its capacity from the tractionbattery-nominalcapacity signal."
}
]
}{
"errors": [
{
"status": "500",
"type": "SERVER",
"code": "INTERNAL",
"title": "Internal Server Error",
"detail": "An unexpected error occurred on the server.",
"links": {
"about": "https://smartcar.com/docs/errors/api-errors/v3/server-errors"
}
}
]
}Authorizations
The Authorization header must be provided with a valid bearer token.
Example: Authorization: Bearer {token}
Body
Request for creating a select-battery-capacity interaction.
Show child attributes
Show child attributes
Response
Interaction created
Show child attributes
Show child attributes
Was this page helpful?

