Skip to navigation

Long-running operations

Calls that finish after the response, and what to poll after each one.

Some operations depend on a charger or a roaming partner answering, which takes longer than one HTTP request should wait. These calls return at once and finish in the background. Each operation’s description in the API Reference names what to poll.

You calledThen pollUntil
energy.controlRequests.create (returns 202)energy.controlRequests.get with its request_idresult is no longer PENDING
emsp.commands.sendemsp.commands.get with the returned tracking_idthe command has a final result
emsp.tokens.bulkProvision with auto_activate (returns 202)emsp.tokens.get for each tokenit leaves PROVISIONED; a failed push stays PROVISIONED and is listed in the response

Polling well

  • Poll every 2 to 5 seconds, and stop at a deadline you choose.
  • emsp.commands.get refreshes a roaming command that is still PENDING from the partner, so polling it is what finishes it.

Prefer events to polling? Register a webhook endpoint with webhooks.endpoints.create, for example for energy.control_response.

Retries and asynchronous calls

The SDKs send a POST that could act twice only once, even after a 503: the first attempt may already have reached the charger. Check the status before you retry it yourself, or send an Idempotency-Key so a repeat returns the first result. See Errors and retries.