Async operations
Follow long-running Wingspan V3 work that returns 202 Accepted by polling the operation or subscribing to Operation webhook events.
Follow long-running work, such as adding payees to a group or refreshing an accounting connection's reference data, by polling an operation or subscribing to webhook events. These endpoints return 202 Accepted with an operation.
What you get back
A long-running endpoint answers with 202 Accepted, a Location header pointing at the operation, a Retry-After header with a suggested wait in seconds, and an AsyncOperation body:
HTTP/1.1 202 Accepted
Location: /v3/platform/operations/Ts9mQ4vK2xLp7WzR1nBcHd
Retry-After: 2
Content-Type: application/json{
"id": "Ts9mQ4vK2xLp7WzR1nBcHd",
"operationType": "GroupMemberBulkAdd",
"status": "Processing",
"events": {
"createdAt": "2026-04-02T09:15:03Z"
},
"actors": {
"createdBy": "Hn4dW8kPq2ZxM7vRt5LcJa"
}
}The operation id is its own ID. It isn't the ID of the resource the work changes.
The 202 can arrive already finished. If the work completed while the request was open, status is already terminal and result or error is filled in. Check status before you start polling.
Operation fields
| Field | Meaning |
|---|---|
id | The operation's ID. Poll it at GET /v3/platform/operations/{id}. |
operationType | What kind of work this is, such as GroupMemberBulkAdd. New types are added over time, so handle values you don't recognize with generic logic. See Operation types. |
status | Processing, Completed, PartiallyCompleted, Failed, or Cancelled. |
progress | total, completed, failed, and sometimes skipped. Present only when the work is a set of countable items. |
result | Set when the operation finishes. It references resources by ID. Fetch those resources for their full detail. |
error | An error object, set when status is Failed. It can also appear on PartiallyCompleted and Cancelled. |
events | createdAt, plus completedAt, partiallyCompletedAt, failedAt, or cancelledAt once the operation ends. |
actors | createdBy, and cancelledBy when it applies. |
Operation types
These are the operationType values you can see today:
operationType | Started by | Can you poll it? |
|---|---|---|
GroupMemberBulkAdd | POST /v3/payments/groups/{groupId}/members/bulk | Yes |
ReferenceDataRefresh | Refreshing an accounting connection's reference data | Yes |
SyncActivityResync | Re-syncing one accounting sync activity | Yes |
NotificationBulkView | Marking a Person's notifications as viewed in bulk | No, the response is already final. See Notification bulk actions. |
NotificationBulkDismiss | Dismissing a Person's notifications in bulk | No, the response is already final. |
Two more types appear on endpoints that aren't built yet. FormSubmission (POST /v3/compliance/forms/{formId}/submit) and NotificationClearByHandle always return an operation that is already Failed with error.code: NotImplemented.
Statuses
| Status | Terminal | Meaning |
|---|---|---|
Processing | No | The work is running. |
Completed | Yes | All of the work succeeded. |
PartiallyCompleted | Yes | Some items succeeded and some failed. Check progress and result. |
Failed | Yes | The operation failed. Read error. |
Cancelled | Yes | The work was cancelled through the resource it belongs to. |
A terminal operation never changes again. There is no endpoint to cancel an operation directly.
Poll for the result
-
Read the operation. Use the
Retry-Aftervalue to determine how long to wait before the next request:curl "https://api.wingspan.app/v3/platform/operations/Ts9mQ4vK2xLp7WzR1nBcHd" \ -H "Authorization: Bearer $WINGSPAN_TOKEN"Get an operation returns the same body shape, with
Retry-Afterwhile it's stillProcessing. -
While
statusisProcessing, wait for theRetry-Afterseconds and read it again. -
When
statusis terminal, handle the outcome:// (trimmed) { "id": "Ts9mQ4vK2xLp7WzR1nBcHd", "operationType": "GroupMemberBulkAdd", "status": "Completed", "events": { "createdAt": "2026-04-02T09:15:03Z", "completedAt": "2026-04-02T09:15:07Z" } }
Poll with the same credentials, and the same X-Wingspan-Account if you used one, as the request that started the work. An operation that doesn't exist, has expired, or belongs to someone else returns 404.
Finished operations stay readable for 90 days. After that, they return 404. Store any result data your system needs before the operation expires.
Notification bulk actions
Bulk view and bulk dismiss finish before they respond. The 202 body is already Completed, PartiallyCompleted, or Failed. The response is already final; read status and progress from it and don't poll. The response still carries a Location header, but the operation it names can't be fetched.
Subscribe instead of polling
Subscribe to the Operation.* webhook events to receive notification when an operation finishes: Operation.Created, Operation.Completed, Operation.PartiallyCompleted, Operation.Failed, and Operation.Cancelled. Each event identifies the operation. Read the operation to get its result or error.
These events are about the operation. The resource the work changed may send its own events as well, and those are separate facts, not duplicates. See Webhooks and events.
When an operation fails
- Read
error.codeand handle it according to the error contract. Include a default case: a failed operation can carry a code that isn't in the error list. Treat any code you don't recognize as a permanent failure of that operation. - If
error.detailCodeisoperations.CompletionTimeout, Wingspan lost track of the work before it reported an outcome. The work may have finished anyway. Check the state of the affected resources before you start the work again, or you may do it twice. - For
PartiallyCompleted, useprogressandresultto find the items that failed, fix them, and send a new request for those items.
Operations and idempotency
Send an Idempotency-Key on the request that starts the work. A retry with the same key returns the same operation instead of starting a second one. See Idempotency.
Batches are tracked on the batch
Bulk imports through /v3/platform/batches don't return an AsyncOperation. A batch has its own status and progress counters. See Batches and bulk operations.
Related pages
Updated 10 days ago