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

# Action Connect

> Generate a URL to initiate the account connection flow, which allows users to connect their accounts.
The generated URL is active for a **one-hour period**. If not authenticated within this timeframe, the link will become invalid.

After the connection flow is completed, the device owner is redirected to the provided return URL with the following parameters:
- `result` indicating success or failure.
- `accountId` representing the ID of the connected account.

For further customization and integration details, consider the following resources:
- See the [Scopes documentation](/overview/scopes) for information on how to utilize scopes in your integration.
- See the [Regions documentation](/overview/regions) for guidelines on setting geographic regions.

You can also connect a single vehicle using the VIN upload flow. Pass the VIN, and (if available) the model and model year.
This will generate a consent flow link that's dedicated to uploading a single vehicle.


Possible Codes in Error Response (see [Errors](https://docs.volteras.com/api-reference/errors) for error response schema and meaning of codes):

- AUTHENTICATION_ERROR
- DEVICE_LIMIT_REACHED
- NOT_PERMITTED
- REQUEST_VALIDATION_ERROR
- SERVER_ERROR
- UNSUPPORTED_OEM



## OpenAPI

````yaml post /v1/accounts:connect
openapi: 3.1.0
info:
  title: VOLTERAS CONNECT
  version: 0.1.0
servers:
  - url: https://api.volteras.com
  - url: https://api.sandbox.volteras.com
security: []
paths:
  /v1/accounts:connect:
    post:
      tags:
        - Accounts
      summary: Action Connect
      description: >-
        Generate a URL to initiate the account connection flow, which allows
        users to connect their accounts.

        The generated URL is active for a **one-hour period**. If not
        authenticated within this timeframe, the link will become invalid.


        After the connection flow is completed, the device owner is redirected
        to the provided return URL with the following parameters:

        - `result` indicating success or failure.

        - `accountId` representing the ID of the connected account.


        For further customization and integration details, consider the
        following resources:

        - See the [Scopes documentation](/overview/scopes) for information on
        how to utilize scopes in your integration.

        - See the [Regions documentation](/overview/regions) for guidelines on
        setting geographic regions.


        You can also connect a single vehicle using the VIN upload flow. Pass
        the VIN, and (if available) the model and model year.

        This will generate a consent flow link that's dedicated to uploading a
        single vehicle.



        Possible Codes in Error Response (see
        [Errors](https://docs.volteras.com/api-reference/errors) for error
        response schema and meaning of codes):


        - AUTHENTICATION_ERROR

        - DEVICE_LIMIT_REACHED

        - NOT_PERMITTED

        - REQUEST_VALIDATION_ERROR

        - SERVER_ERROR

        - UNSUPPORTED_OEM
      operationId: action_connect_v1_accounts_connect_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountConnectPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountConnect'
      security:
        - OAuth2ClientCredentialsBearer: []
components:
  schemas:
    AccountConnectPayload:
      properties:
        returnUrl:
          anyOf:
            - type: string
              minLength: 1
              format: uri
            - type: 'null'
          title: Redirect URI
          description: The url the user is redirected to at the end of the consent flow
        scopes:
          items:
            $ref: '#/components/schemas/ScopeEnum'
          type: array
          minItems: 1
          title: Scopes
          description: List of scopes that the application requires access to
        locale:
          anyOf:
            - $ref: '#/components/schemas/ConsentFlowLocales'
            - type: 'null'
          description: >-
            Set the language used in the the consent flow. The default is
            English.
        integrationMethod:
          anyOf:
            - $ref: '#/components/schemas/ConsentFlowIntegration'
            - type: 'null'
          description: >-
            This is for when a make can be connected via multiple methods. For
            example, if the make is BMW, the user can connect via the BMW Energy
            API (for smart charging) or via BMW Cardata (for other vehicle
            data).
        chargerLocationLatitude:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Chargerlocationlatitude
          description: >-
            The latitude of the charger location that the vehicle will be
            charging at. This is passed in specific cases to the OEM's Portal
            when the consent flow runs (currently only for BMW), to make it
            easier for the user to select their charger location, which in turn
            is needed (currently only for BMW) to restrict when start / stop
            charge commands can be sent.
        chargerLocationLongitude:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Chargerlocationlongitude
          description: >-
            The longitude of the charger location that the vehicle will be
            charging at. This is passed in specific cases to the OEM's Portal
            when the consent flow runs (currently only for BMW), to make it
            easier for the user to select their charger location, which in turn
            is needed (currently only for BMW) to restrict when start / stop
            charge commands can be sent.
        countryCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Countrycode
          description: >-
            The ISO 3166-1 alpha-2 country code (e.g. DE, GB, US etc.) of the
            account's country. This is required when it is necessary to fetch
            the key specifications (model, model year, trim, battery capacity
            etc.) for vehicles in the account.
        makes:
          anyOf:
            - items:
                $ref: '#/components/schemas/MakeEnum'
              type: array
            - type: 'null'
          title: Makes
          description: Only show these makes of device in the consent flow
        deviceTypes:
          items:
            $ref: '#/components/schemas/DeviceTypeEnum'
          type: array
          minItems: 1
          title: Device types
          description: >-
            Only show these device types in the consent flow. If only one device
            is selected, the device selection page is skipped.
        urlExpiration:
          anyOf:
            - type: integer
              maximum: 1209600
              minimum: 3600
            - type: 'null'
          title: Urlexpiration
          description: >-
            Defines the validity period of the authentication URL in seconds.
            Defaults to `3600`, with a range between `3600` seconds (1 hour) and
            `1209600` seconds (2 weeks). Once expired, the URL becomes invalid
            and cannot be used.
          default: 3600
        region:
          anyOf:
            - $ref: '#/components/schemas/OEMRegion'
            - type: 'null'
          description: >-
            Defines the geographic region for the account connection, directly
            influencing which OEM-specific API endpoint will be used for the
            connection. For OEMs with distinct APIs across regions, this setting
            ensures the correct regional API is utilized. The default is Europe.
        vin:
          anyOf:
            - type: string
            - type: 'null'
          title: Vin
          description: The VIN to connect, if connecting via the VIN upload flow.
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: The model to connect, if connecting via the VIN upload flow.
        modelYear:
          anyOf:
            - type: integer
            - type: 'null'
          title: Modelyear
          description: The model year to connect, if connecting via the VIN upload flow.
      type: object
      required:
        - scopes
        - deviceTypes
      title: AccountConnectPayload
    AccountConnect:
      properties:
        authenticationUrl:
          type: string
          title: Authenticationurl
          description: >-
            The URL to redirect the user to for authentication through the
            connect flow.
      type: object
      required:
        - authenticationUrl
      title: AccountConnect
    ScopeEnum:
      type: string
      enum:
        - vehicle:all
        - vehicle:charging_history
        - vehicle:driving_behavior
        - vehicle:location_history
        - vehicle:telemetry
        - vehicle:information
        - vehicle:commands
        - battery:all
        - battery:telemetry
        - geofences:all
        - geofences:read
        - geofences:write
      title: ScopeEnum
    ConsentFlowLocales:
      type: string
      enum:
        - en-GB
        - de-DE
        - fr-FR
        - nl-NL
      title: ConsentFlowLocales
    ConsentFlowIntegration:
      type: string
      enum:
        - BMW_ENERGY_API
      title: ConsentFlowIntegration
    MakeEnum:
      type: string
      enum:
        - ABARTH
        - ALFA ROMEO
        - AUDI
        - BMW
        - CHRYSLER
        - CITROEN
        - CUPRA
        - DODGE
        - DS AUTOMOBILES
        - FIAT
        - FORD
        - HYUNDAI
        - JEEP
        - KIA
        - LANCIA
        - LEXUS
        - MASERATI
        - MERCEDES BENZ
        - MINI
        - NISSAN
        - OPEL
        - PEUGEOT
        - POLESTAR
        - RAM
        - RENAULT
        - SEAT
        - SKODA
        - TESLA
        - TOYOTA
        - VAUXHALL
        - VOLKSWAGEN
        - VOLVO
      title: MakeEnum
      description: >-
        Implemented makes enum.


        Input normalization and aliases are handled via `from_input` /
        `_missing_`, so values like

        "Mercedes", "MERCEDES-BENZ", or "MERCEDES_BENZ" resolve to the canonical
        enum.


        OpenAPI exposure is filtered/normalized in
        `__get_pydantic_json_schema__`.


        When updating this enum you should also consider updating the public
        docs:
            docs/public/connect-api/tools/mintlify/overview/supported-oems.mdx
    DeviceTypeEnum:
      type: string
      enum:
        - VEHICLE
        - BATTERY
        - CHARGER
        - INVERTER
        - HEAT_PUMP
      title: DeviceTypeEnum
      description: All supported device types
    OEMRegion:
      type: string
      enum:
        - NORTH_AMERICA
        - EUROPE
      title: OEMRegion
  securitySchemes:
    OAuth2ClientCredentialsBearer:
      type: oauth2
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /v1/oauth2/token

````