> ## Documentation Index
> Fetch the complete documentation index at: https://smartcar.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.




## OpenAPI

````yaml /specs/full-vehicle.yaml post /interactions/select-battery-capacity
openapi: 3.0.3
info:
  title: Smartcar Vehicle API (Complete)
  version: 3.0.0
  description: API for vehicle data (signals) and operations (commands).
servers:
  - url: https://vehicle.api.smartcar.com/v3
security: []
tags:
  - name: Charging
    description: Commands for controlling vehicle charging behavior.
  - name: Security
    description: Commands for controlling vehicle door locks.
  - name: Navigation
    description: Commands for setting destinations in the vehicle navigation system.
  - name: Charge Schedules
    description: Create, retrieve, and delete recurring charge schedules on a vehicle.
  - name: Charge
    description: Signals and attributes for the Charge group.
  - name: Climate
    description: Signals and attributes for the Climate group.
  - name: Closure
    description: Signals and attributes for the Closure group.
  - name: ConnectivitySoftware
    description: Signals and attributes for the ConnectivitySoftware group.
  - name: ConnectivityStatus
    description: Signals and attributes for the ConnectivityStatus group.
  - name: Diagnostics
    description: Signals and attributes for the Diagnostics group.
  - name: HVAC
    description: Signals and attributes for the HVAC group.
  - name: InternalCombustionEngine
    description: Signals and attributes for the InternalCombustionEngine group.
  - name: Location
    description: Signals and attributes for the Location group.
  - name: LowVoltageBattery
    description: Signals and attributes for the LowVoltageBattery group.
  - name: Motion
    description: Signals and attributes for the Motion group.
  - name: Odometer
    description: Signals and attributes for the Odometer group.
  - name: Service
    description: Signals and attributes for the Service group.
  - name: Surveillance
    description: Signals and attributes for the Surveillance group.
  - name: TractionBattery
    description: Signals and attributes for the TractionBattery group.
  - name: Transmission
    description: Signals and attributes for the Transmission group.
  - name: VehicleIdentification
    description: Signals and attributes for the VehicleIdentification group.
  - name: VehicleUserAccount
    description: Signals and attributes for the VehicleUserAccount group.
  - name: Wheel
    description: Signals and attributes for the Wheel group.
paths:
  /interactions/select-battery-capacity:
    post:
      summary: Create a select-battery-capacity interaction
      description: |
        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.
      operationId: createSelectBatteryCapacityInteraction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SelectBatteryCapacityInteractionRequest'
      responses:
        '201':
          description: Interaction created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InteractionDataResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/InteractionNotApplicable'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    SelectBatteryCapacityInteractionRequest:
      type: object
      description: Request for creating a select-battery-capacity interaction.
      required:
        - data
      properties:
        data:
          type: object
          required:
            - attributes
          properties:
            attributes:
              $ref: '#/components/schemas/SelectBatteryCapacityInteractionAttributes'
      example:
        data:
          attributes:
            vehicleId: a6a425d6-c661-4b21-af7a-d6b75f80f3b0
            userId: 1e258add-fb21-4293-b9ab-cf8a61f7a880
            redirectUri: https://example.com/smartcar/callback
    InteractionDataResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/Interaction'
      example:
        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'
    SelectBatteryCapacityInteractionAttributes:
      type: object
      required:
        - vehicleId
      additionalProperties: false
      properties:
        vehicleId:
          type: string
          description: The vehicle whose battery capacity the owner will choose.
        userId:
          type: string
          description: |
            The user the vehicle is connected through. Required with an
            application token. With a vehicle user token, the token's user is
            used and this field is ignored.
        redirectUri:
          type: string
          format: uri
          description: >
            Where to send the owner when they finish. Must exactly match a
            redirect

            URI registered for the application in the Smartcar Dashboard.
            Defaults

            to the application's default redirect URI.
    Interaction:
      type: object
      required:
        - id
        - type
        - attributes
        - meta
      properties:
        id:
          type: string
          description: >-
            Unique identifier for this interaction (useful for support and log
            correlation).
        type:
          type: string
          enum:
            - interaction
          default: interaction
        attributes:
          type: object
          required:
            - interactionType
            - url
            - expiresAt
          properties:
            interactionType:
              $ref: '#/components/schemas/InteractionType'
            url:
              type: string
              format: uri
              description: >
                URL to send the person to. Treat it as opaque: it's a Connect
                URL

                today, but that may change.
            expiresAt:
              type: string
              format: date-time
        meta:
          type: object
          required:
            - createdAt
          properties:
            createdAt:
              type: string
              format: date-time
    ErrorResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - status
              - type
              - code
              - title
              - detail
            properties:
              status:
                type: string
              type:
                type: string
                enum:
                  - AUTHENTICATION
                  - BILLING
                  - COMPATIBILITY
                  - CONNECTED_SERVICES_ACCOUNT
                  - RATE_LIMIT
                  - RESOURCE_NOT_FOUND
                  - SERVER
                  - UPSTREAM
                  - VALIDATION
                  - VEHICLE_STATE
              code:
                type: string
              title:
                type: string
              detail:
                type: string
              resolution:
                type: object
                description: >-
                  Optional field providing guidance on how to resolve the error,
                  if applicable. The structure of this object can vary based on
                  the error type and is intended to provide actionable
                  information to clients.
                properties:
                  type:
                    type: string
                    description: >-
                      The type of resolution recommended (e.g., "RETRY_LATER",
                      "CONTACT_SUPPORT", etc.)
              suggestedUserMessage:
                type: string
                description: >-
                  Optional field providing a user-friendly message that can be
                  displayed to end-users, if applicable. This message is
                  intended to be easily understandable and actionable for users
                  who encounter the error.
              links:
                type: object
                properties:
                  about:
                    type: string
                    format: uri
              meta:
                type: object
                properties:
                  debug:
                    type: object
                    description: >-
                      Debug information for internal use, not intended for
                      clients
                    properties:
                      applicationId:
                        type: string
                        description: The unique identifier for the application
                      requestId:
                        type: string
                        description: The unique identifier for the request
                      origin:
                        type: string
                        description: The origin of the error
                    example:
                      applicationId: app_123abc
                      requestId: req_456def
                      origin: internal.com/path
    InteractionType:
      type: string
      enum:
        - select-battery-capacity
  responses:
    BadRequest:
      description: 400 Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            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
    Unauthorized:
      description: 401 Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            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
    Forbidden:
      description: 403 Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            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
    NotFound:
      description: 404 Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            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
    InteractionNotApplicable:
      description: 422 Unprocessable Entity - the interaction doesn't apply to this vehicle
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            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.
    InternalError:
      description: 500 Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or opaque
      description: |
        The Authorization header must be provided with a valid bearer token.
        Example: `Authorization: Bearer {token}`

````