Connections

Get or refresh an access token

POST/v1/connections/oauth/token

Exchanges 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, the code, the exact redirect_uri it was sent to, and your code_verifier. A code works once, within 5 minutes.

  • Refresh: grant_type=refresh_token and your refresh_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 · stringrequired
    Bearer <token>, with an ID token from a console sign-in or an API key (flw_ak_…). How authentication works

Request body

  • grant_typestringrequired
    authorization_code or refresh_token.
  • codestringnullable
    The code your app received. With authorization_code only.
  • code_verifierstringnullable
    The verifier behind the challenge you prepared. With authorization_code only.
  • redirect_uristringnullable
    The exact address the code was sent to. With authorization_code only.
  • refresh_tokenstringnullable
    Your current refresh token. With refresh_token only.

Responses

A new access token and refresh token. Store them securely: neither is shown again.

  • access_tokenstringrequired
    Send as Authorization: Bearer on your app's routes.
  • expires_inintegerrequired≥ 0
    Seconds until the access token expires.
  • refresh_tokenstringrequired
    Use it once to get the next pair. Reusing an old one revokes every token issued with it.
  • token_typestringrequired
    Always Bearer.

Headers

  • RateLimit-Limitheader · string
  • RateLimit-Remainingheader · string
  • RateLimit-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.

  • errorstringrequired
    invalid_request, invalid_grant, invalid_client, slow_down, temporarily_unavailable or server_error.
  • error_descriptionstringnullable
    More detail, when there is any.

Your token is missing, has expired or isn't valid. Sign in again, or use a valid API key.

  • errorstringrequired
    invalid_request, invalid_grant, invalid_client, slow_down, temporarily_unavailable or server_error.
  • error_descriptionstringnullable
    More detail, when there is any.

Too many requests. Wait the number of seconds in Retry-After, then try again.

  • errorstringrequired
    invalid_request, invalid_grant, invalid_client, slow_down, temporarily_unavailable or server_error.
  • error_descriptionstringnullable
    More 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.

  • errorenumrequired
    A 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_editorpaymentsAccountNotFoundpaymentsAccountSubmittedpaymentsOrganizationSyntheticpaymentsUnavailablephaseTopologyNotConfirmedprincipalErasedprincipalInactiveprincipalNotFoundprojectNotFoundproposalAlreadyDecidedprotocolErrorrateLimitErrorrateLimitedratedCurrentNotPositivereferenceTakensandboxOrganizationChargerLimitReachedsandboxProjectChargerLimitReachedsandboxStationRefusedselfParentsellerUnavailableserviceUnavailablesessionServiceUnavailablestationOfflinesigningSecretTooShortsiteClaimedElsewheresiteOwnedByAnotherEaseeOperatorslugChangeNotAcknowledgedslugTakenspotCurrencyMismatchtariffEnergyAndSpottimeZoneRequiredtimedOutscopeNotGrantedscopeTooLargewindowEndedwindowTooLongsessionCapExceededinvalidMonthmonthTooLargemixedCurrenciesmonthNotClosablemonthHasOpenHoldsmonthAlreadyClosedmonthNotClosedoutcomeFinalmonthClosednotCarriabletargetMonthClosedsettlementServiceUnavailabletransactionAlreadyOpentransactionNotOpenunauthorizedunavailableunintelligibleResponseunknownBiddingZoneunknownChargerModelunknownEventTypeunknownFallbackStatusunknownSerialunknownVariableunknownVehicleModelunprocessableunrecognisedApiKeyModeunrecognisedSessionModeunsupportedvendorManagedFirmwarevendorUnreachablevirtualChargerLimitReachedvirtualChargerOrganizationLimitReachedvirtualChargerServiceUnavailablevirtualChargerStateUnavailablewebhookServiceUnavailablewrongPin
  • messagestringrequired
    A description for people. Its wording may change, so don't parse it.
  • requestIdstring
    This request's id, the same as the x-request-id response header. Quote it when you contact support.

temporarily_unavailable: try again shortly.

  • errorstringrequired
    invalid_request, invalid_grant, invalid_client, slow_down, temporarily_unavailable or server_error.
  • error_descriptionstringnullable
    More detail, when there is any.

Headers

  • Retry-Afterheader · string