Assistant

Exchange an assistant code or refresh token

POST/v1/assistant/oauth/token

Trades 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 · stringrequired
    Bearer <token>, with an ID token from a console sign-in or an API key (flw_ak_…). How authentication works

Request body

  • client_idstringnullable
  • codestringnullable
  • code_verifierstringnullable
  • grant_typestringnullable
  • redirect_uristringnullable
  • refresh_tokenstringnullable
  • resourcestringnullable

Responses

A new access token and refresh token.

  • access_tokenstringrequired
    The access token. Send it as a bearer token.
  • expires_inintegerrequired≥ 0
    Seconds until it expires, never more than 3600.
  • refresh_tokenstringrequired
    Use it to get the next pair. It works once.
  • token_typestringrequired
    Always Bearer.

Headers

  • RateLimit-Limitheader · string
  • RateLimit-Remainingheader · string
  • RateLimit-Resetheader · string

invalid_request, invalid_grant, invalid_target or unsupported_grant_type.

  • errorstringrequired
  • error_descriptionstringrequired

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

  • errorstringrequired
  • error_descriptionstringrequired

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

  • errorstringrequired
  • error_descriptionstringrequired

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.

The sign-in service isn't available right now. Try again shortly.

  • errorstringrequired
  • error_descriptionstringrequired

Headers

  • Retry-Afterheader · string