Get or refresh an access token
/v1/connections/oauth/tokenExchanges the code your app received for an access token and a refresh token, or refreshes an access token. Send a form-encoded body and authenticate with your app's client id and secret over HTTP Basic.
Exchange a code:
grant_type=authorization_code, thecode, the exactredirect_uriit was sent to, and yourcode_verifier. A code works once, within 5 minutes.Refresh:
grant_type=refresh_tokenand yourrefresh_token. Every refresh returns a new refresh token: use that one next time. Reusing an old refresh token revokes it and every token issued with it, and your app then needs a new approval.
Access tokens last 15 minutes. A refresh token expires after 7 days without use, and 30 days after you exchanged the code at the latest. Errors use the standard OAuth shape: invalid_request, invalid_grant, invalid_client (401), slow_down (429) or temporarily_unavailable.
Authorization
Authorizationheader · stringrequiredBearer <token>, with an ID token from a console sign-in or an API key (flw_ak_…). How authentication works
Request body
grant_typestringrequiredauthorization_codeorrefresh_token.codestringnullableThe code your app received. Withauthorization_codeonly.code_verifierstringnullableThe verifier behind the challenge you prepared. Withauthorization_codeonly.redirect_uristringnullableThe exact address the code was sent to. Withauthorization_codeonly.refresh_tokenstringnullableYour current refresh token. Withrefresh_tokenonly.
Responses
A new access token and refresh token. Store them securely: neither is shown again.
access_tokenstringrequiredSend asAuthorization: Beareron your app's routes.expires_inintegerrequired≥ 0Seconds until the access token expires.refresh_tokenstringrequiredUse it once to get the next pair. Reusing an old one revokes every token issued with it.token_typestringrequiredAlwaysBearer.
Headers
RateLimit-Limitheader · stringRateLimit-Remainingheader · stringRateLimit-Resetheader · string
invalid_request: a required form field is missing or grant_type is unknown. invalid_grant: the code or refresh token is wrong, used, expired, or doesn't match the redirect_uri or code_verifier.
errorstringrequiredinvalid_request,invalid_grant,invalid_client,slow_down,temporarily_unavailableorserver_error.error_descriptionstringnullableMore detail, when there is any.
Your token is missing, has expired or isn't valid. Sign in again, or use a valid API key.
errorstringrequiredinvalid_request,invalid_grant,invalid_client,slow_down,temporarily_unavailableorserver_error.error_descriptionstringnullableMore detail, when there is any.
Too many requests. Wait the number of seconds in Retry-After, then try again.
errorstringrequiredinvalid_request,invalid_grant,invalid_client,slow_down,temporarily_unavailableorserver_error.error_descriptionstringnullableMore detail, when there is any.
Something went wrong on our side. Try again, and if it keeps happening, contact support with the response's requestId.
errorenumrequiredA stable code for the error. Switch on this value: it doesn't change between releases.One ofaccountHasOpenBalanceaccountNotReadyalreadyStartedambiguousIdTokenambiguousReservationAddressassetServiceUnavailableassistantCardRequiredassistantDisabledassistantLimitReachedinstallerPhotoDayLimitinstallerPhotoConversationLimitassistantNotEnabledassistantRouteNotAllowedassistantUnavailableauthenticationRequiredauthorizationUnavailablebadRequestbatchTooLargebillingAccountClosedbillingAccountSuspendedbillingNotConfiguredbillingServiceUnavailablecannotDeleteDefaultcapacityExceededcardAlreadyHeldcardBlockedcardOwnedByPrincipalcertificateAuthorityServiceUnavailablechargerUnsafeForHoldcircuitChosenTwicecircuitNotFoundcircuitNotOnJobLocationchargerNotRunningchargePointIdTakenchargerSplitAcrossLocationschargingStationNotAcceptedclaimNotEligibleclaimNotFoundcommandNotSupportedcommandTypeRemovedcommandsUnavailableconflictconfirmationInvalidconfirmationLockedconfirmationNotSentconfirmationRequiredconfirmEraseRequiredconsentMissingconversationClosedconversationBusyconnectionNotEligibleconnectorAlreadyOccupiedconnectorNotFoundconnectorNotOccupiedconfirmOverPlanRequiredcsmsManagedSettingdeclineddiagnosticsReceiverServiceUnavailablediagnosticsRequestOutstandingdiagnosticsUnsupportedProtocolVersiondisconnectedduplicateeaseeCircuitUnmappedeaseeSiteClaimedElsewhereeaseeUnreachableeaseeWrongSerialOrPinemailNotVerifiedemptyEventTypesemptyLimitemptyTransactionLimitenergyControllerUnavailableenergyPricingServiceUnavailableeventTypeNotSubscribableexceedsCapabilityfileExpiredfileNotAvailablefirmwareIdentityUnknownforbiddenhandoverNotReadyhasChildCircuitsholdAmountOutOfRangeholdNotAuthorizedidTokenNotAcceptedidTokenNotRecoverableidempotencyKeyConflictidempotencyKeyInFlightidempotencyKeyReplayedidempotencyStoreUnavailableintegrationEaseeServiceUnavailableintegrationUnavailableconnectionsServiceUnavailableinternalErrorinvalidinvalidAddressinvalidAppDestinationinvalidClientinvalidCoordinatesinvalidCountryinvalidCurrentTypeinvalidEvsesinvalidCursorinvalidErrorCodeinvalidIdTokeninvalidLineinvalidModeinvalidMonitorAssignmentinvalidMonitorConnectioninvalidNameinvalidPaginationinvalidRedirectUriinvalidReasoninvalidPhaseCountinvalidRequestinvalidImageimageTooLargeinvalidWindowmethodNotUsablenotAPaidChargernotCapturedoverRefundpaymentRequiredrevisionConflictinvalidScheduleinvalidScopeinvalidSettingValueinvalidLocationTargetinvalidSluginvalidStartingSocinvalidTargetSocinvalidTargetinvalidTargetUrlinvalidTariffinvalidTariffConditioninvalidTariffIdinvalidTimeZoneinvalidUrlinvalidValueinstallerNotHeldinvitationAlreadyAcceptedinvitationExpiredjobsServiceUnavailableopenJobsservesCustomerGrantsnotAnInstallationsProjectgrantNotActivelastCircuitOnLocationlocationUnderInstallationlocationNotBuiltlocationAlreadyBuiltmetricsStoreErrormetricsStoreUnavailablemessageTooLongmissingIdTokenmissingIdempotencyKeymonitorConflictmonitorNotFoundmqttServiceUnavailablemissingOrMalformedHeaderinvalidTokenjwksUnavailableapiKeyServiceUnavailablenotConnectednotDispatchablenotEntitledassigneeCannotReadJobnotFoundnotReadynotSandboxModenoFirmwareCatalogednoOpenSessionnoSupportedTransferProtocolnoVehicleocppUnavailableorganizationNotEmptyownerCannotLeaveownsOrganizationspaymentMethodRequiredbinding.driver_policy_requires_access_permissionbinding.holder_outside_home_projectpermission_policy.deny_not_allowedpermission_policy.deny_on_owner_floorpermission_policy.in_usepermission_policy.invalid_documentpermission_policy.limit_exceededpermission_policy.managed_immutablepermission_policy.management_permission_for_non_memberpermission_policy.name_takenpermission_policy.not_grantablepermission_policy.unknown_permissionpermission_policy.would_remove_last_editorpaymentsAccountNotFoundpaymentsAccountSubmittedpaymentsOrganizationSyntheticpaymentsUnavailablephaseTopologyNotConfirmedprincipalErasedprincipalInactiveprincipalNotFoundprojectNotFoundproposalAlreadyDecidedprotocolErrorrateLimitErrorrateLimitedratedCurrentNotPositivereferenceTakensandboxOrganizationChargerLimitReachedsandboxProjectChargerLimitReachedsandboxStationRefusedselfParentsellerUnavailableserviceUnavailablesessionServiceUnavailablestationOfflinesigningSecretTooShortsiteClaimedElsewheresiteOwnedByAnotherEaseeOperatorslugChangeNotAcknowledgedslugTakenspotCurrencyMismatchtariffEnergyAndSpottimeZoneRequiredtimedOutscopeNotGrantedscopeTooLargewindowEndedwindowTooLongsessionCapExceededinvalidMonthmonthTooLargemixedCurrenciesmonthNotClosablemonthHasOpenHoldsmonthAlreadyClosedmonthNotClosedoutcomeFinalmonthClosednotCarriabletargetMonthClosedsettlementServiceUnavailabletransactionAlreadyOpentransactionNotOpenunauthorizedunavailableunintelligibleResponseunknownBiddingZoneunknownChargerModelunknownEventTypeunknownFallbackStatusunknownSerialunknownVariableunknownVehicleModelunprocessableunrecognisedApiKeyModeunrecognisedSessionModeunsupportedvendorManagedFirmwarevendorUnreachablevirtualChargerLimitReachedvirtualChargerOrganizationLimitReachedvirtualChargerServiceUnavailablevirtualChargerStateUnavailablewebhookServiceUnavailablewrongPinmessagestringrequiredA description for people. Its wording may change, so don't parse it.requestIdstringThis request's id, the same as thex-request-idresponse header. Quote it when you contact support.
temporarily_unavailable: try again shortly.
errorstringrequiredinvalid_request,invalid_grant,invalid_client,slow_down,temporarily_unavailableorserver_error.error_descriptionstringnullableMore detail, when there is any.
Headers
Retry-Afterheader · string