Skip to main content
Some work takes longer than a request should wait. An endpoint that starts this work returns 202 Accepted right away, with an operation that describes the work. You poll the operation until the work finishes. Every operation type has the same shape, so one polling loop handles all of them. Four endpoints work this way:

The operation object

The call that starts the work wraps the operation in an operation key:
While done is false, neither result nor error is set. When done is true, exactly one of them is set. Check done first. Then check which of the two fields is present. An operation’s error isn’t the error envelope that an HTTP failure returns. It has a code to branch on, a human-readable message, and an errors list for item-level failures. No operation type itemizes its failures today, so errors is empty.

Polling

Poll Get Operation with the operation’s id. It returns the operation itself, without the operation wrapper:
Polls count against your rate limit like any other request. Instead of polling in a tight loop, wait between polls and increase the wait each time:

What each operation type returns

App sync

Started by Trigger App Sync. metadata carries type, app_id, and the sync_type that you requested.
  • A successful sync sets result to { "app_id": "…", "sync_status": "success" }.
  • A failed sync sets error.code to app_sync.failed.
An app sync operation is a view of the app’s latest sync, not a record of one run. If another sync starts after yours, polling the same ID reports that newer sync. The operation reports the same state as the app’s sync_status field.

Account upload

Started by Upload Accounts. metadata carries type and app_id. Each upload gets its own operation, so the ID tracks that one upload.
  • A successful upload sets result to { "app_id": "…", "state": "SUCCESS" }.
  • A failed upload sets error.code to account_upload.failed.
  • An upload that’s cancelled before it finishes sets error.code to account_upload.cancelled.

App review sync

Started by Sync App Review. metadata carries type and app_review_id.
  • A successful sync sets result to { "app_review_id": "…", "status": "…" }, where status is the app review’s current status, such as assigning-reviewers.
  • A failed sync sets error.code to access_review_app_sync.failed.
Like an app sync operation, this operation tracks the app review’s latest sync, not one run.

App delete

Started by Delete App for an app connected through an integration. metadata carries type and app_id.
  • A successful delete sets result to { "app_id": "…" }, and the app no longer exists.
  • error.code app_delete.record_retained means other Lumos data still references the app, so it stays, disconnected.
  • error.code app_delete.failed means removing the app’s accounts failed. The app is already disconnected, so retry the delete.

Who can poll

You can poll an operation if you’re allowed to start that type of work on its resource, or if you can read that resource. Anyone else in your organization gets 403.

Errors when polling

An unknown or malformed operation ID returns 404, as does an operation whose resource has since been deleted. An app delete operation is the exception: you can still poll it after the app is gone.