Exchange an assistant code or refresh token
/v1/assistant/oauth/tokenTrades the code from an approved connection for an access token and a refresh token, or trades a refresh token for a new pair. The body is form-encoded (application/x-www-form-urlencoded), and the response is never cached. It needs no sign-in.
With grant_type=authorization_code, send client_id, code, code_verifier, redirect_uri and resource. A code works once: presenting it a second time is invalid_grant and revokes the tokens the first exchange produced. With grant_type=refresh_token, send client_id and refresh_token. The refresh token is replaced in the same response that retires it, and replaying a retired one revokes the whole connection.
The access token starts with flw_mc_, lasts at most an hour (expires_in), and is sent as a bearer token. It is read-only and works only on the read endpoints Flowion allows for assistants. resource must be the assistant server's address.
Authorization
Authorizationheader · stringrequiredBearer <token>, with an ID token from a console sign-in or an API key (flw_ak_…). How authentication works
Request body
client_idstringnullablecodestringnullablecode_verifierstringnullablegrant_typestringnullableredirect_uristringnullablerefresh_tokenstringnullableresourcestringnullable
Responses
A new access token and refresh token.
access_tokenstringrequiredThe access token. Send it as a bearer token.expires_inintegerrequired≥ 0Seconds until it expires, never more than 3600.refresh_tokenstringrequiredUse it to get the next pair. It works once.token_typestringrequiredAlwaysBearer.
Headers
RateLimit-Limitheader · stringRateLimit-Remainingheader · stringRateLimit-Resetheader · string
invalid_request, invalid_grant, invalid_target or unsupported_grant_type.
errorstringrequirederror_descriptionstringrequired
Your token is missing, has expired or isn't valid. Sign in again, or use a valid API key.
errorstringrequirederror_descriptionstringrequired
Too many requests. Wait the number of seconds in Retry-After, then try again.
errorstringrequirederror_descriptionstringrequired
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.
The sign-in service isn't available right now. Try again shortly.
errorstringrequirederror_descriptionstringrequired
Headers
Retry-Afterheader · string