Skip to content

operation.completed: async write operation succeeded

The operation.completed event tells your endpoint that a write operation started with an API key owned by the webhook owner has finished successfully. The body's data field is the operation object, matching what GET /v2/operations/{id} returns. Deliveries go only to webhooks belonging to that key's owner, and the owner must hold the webhooks:read scope.

When this event fires

This event is tied to asynchronous writes. It is emitted when an operation initiated with an API key owned by the webhook owner reaches a successful result. It is not a general-purpose success signal for every change in the account: only operations started by that owner's key trigger it, and only that owner's webhooks receive it. The webhook owner needs webhooks:read.

If the same operation fails instead, the companion operation.failed event is delivered. Both events share the same payload schema, so your handler can branch on the type field and the operation status.

Delivery headers

Every delivery carries a set of headers. The signature header follows the t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>"> format. During the 24 hours after a secret rotation, the header carries a second v1 entry signed with the previous secret, so your verifier should accept either entry. The exact header contracts are supplied in the protected modules referenced below.

  • VT-Signature: required; see the signature module.
  • VT-Webhook-Id: identifies the webhook the delivery is for.
  • VT-Event-Id: matches the body's id; use it to skip duplicates.
  • VT-Event-Type: matches the body's type.
  • VT-Delivery-Id: unique per delivery and preserved across retries.
  • VT-Delivery-Attempt: attempt number, starting at 1.
  • User-Agent: fixed value identifying the sender.

Request body

The body is JSON. Its id is the event ID and matches the VT-Event-Id header; it is deterministic, so the same change always yields the same ID. The type field is operation.completed or operation.failed. apiVersion is "2". createdAt is an ISO 8601 timestamp. companyId identifies the company. The data field is the operation object, carrying its own id, status, action, createdAt, optional completedAt, optional actingAsUserId, optional resource, optional error, and any additional keys. An optional apiClient object identifies the API key that made the change when the change came through the API.

The operation status enum is PENDING, SUCCEEDED, FAILED, or UNKNOWN. UNKNOWN means no result arrived within 15 minutes; the change may or may not have been applied, so read the resource to check. A result that arrives later still changes the status to SUCCEEDED or FAILED. The error object, when present, carries code, name, description, resolution, requestId, and optional details.

Completed, failed, or unknown: what to do

Use this decision table to route an operation event before you act on it.

Verification and deduplication checklist

  1. Confirm the request came from the expected sender by checking the User-Agent value against the supplied contract.
  2. Recompute the HMAC-SHA256 over "<t>.<raw body>" using your secret and compare it to the v1 entry in VT-Signature. During a rotation window, accept a match against either v1 entry.
  3. Compare VT-Event-Id to the body's id; if they differ, treat the delivery as suspect.
  4. Look up VT-Event-Id in your processed-events store; if already seen, acknowledge and stop.
  5. Use VT-Delivery-Id and VT-Delivery-Attempt to distinguish a retry of the same delivery from a new one.
  6. Branch on type and data.status before applying any downstream change.

Worked example

Suppose an integration starts an asynchronous write with its API key and the operation succeeds. The delivery arrives with VT-Event-Type operation.completed and a VT-Event-Id that matches the body's id. Your handler verifies the signature, finds the event ID is new, and reads data.status. Because the status is SUCCEEDED, it applies the change to its local record. If a later retry of the same delivery arrives with the same VT-Delivery-Id and VT-Delivery-Attempt of 2, the handler recognizes the retry and does not reapply the change. If instead the status were UNKNOWN, the handler would read the affected resource before deciding, and would keep listening for a later SUCCEEDED or FAILED update.

Operation event handling
SituationSignalRecommended handling
Successtype is operation.completed and data.status is SUCCEEDEDTreat the write as applied; update downstream state.
Failuretype is operation.failed and data.status is FAILEDRead data.error for code, description, and resolution; do not retry blindly.
No result yetdata.status is UNKNOWNDo not assume success or failure; read the affected resource to check, and keep listening for a later SUCCEEDED or FAILED update.
Duplicate deliverySame VT-Event-Id as a prior deliverySkip processing; the event ID is deterministic.
Retry of same deliverySame VT-Delivery-Id with a higher VT-Delivery-AttemptProcess once per delivery; attempt number confirms it is a retry.

Status values and the 15-minute UNKNOWN window are part of the supplied operation schema; treat them as the reference contract for this event.

Frequently asked questions

When does the operation.completed event fire?

When an asynchronous write operation started with an API key owned by the webhook owner finishes successfully. Only that owner's webhooks receive it, and the owner needs webhooks:read.

How is operation.completed different from operation.failed?

Both share the same payload schema. operation.completed signals a successful result; operation.failed signals a failure and carries the error in data.error with status FAILED.

What does an UNKNOWN operation status mean?

No result arrived within 15 minutes. The change may or may not have been applied, so read the affected resource to check. A result that arrives later still changes the status to SUCCEEDED or FAILED.

How do I avoid processing the same event twice?

Use VT-Event-Id (same as the body's id) to skip duplicate deliveries. It is deterministic, so the same change always yields the same ID. Use VT-Delivery-Id and VT-Delivery-Attempt to distinguish retries of a single delivery.

What happens to VT-Signature during a secret rotation?

For 24 hours after a rotation, VT-Signature carries a second v1 entry signed with the previous secret, so your verifier should accept either entry.

VT-Signature

FieldTypeRequiredDescriptionConstraints
VT-SignaturestringYest= ,v1= . "> . For 24 hours after a secret rotation it carries a second v1 entry signed with the previous secret. See Signature verification at the top of this document.

VT-Webhook-Id

FieldTypeRequiredDescriptionConstraints
VT-Webhook-IdstringYesthe ID of the webhook the delivery is for.

VT-Event-Id

FieldTypeRequiredDescriptionConstraints
VT-Event-IdstringYesthe event ID, the same as id in the body. Use it to skip duplicate deliveries.

VT-Event-Type

FieldTypeRequiredDescriptionConstraints
VT-Event-TypestringYesthe event type, the same as type in the body.Allowed values: $3b

VT-Delivery-Id

FieldTypeRequiredDescriptionConstraints
VT-Delivery-IdstringYesthe delivery ID, unique per delivery and kept across retries of the same delivery.

VT-Delivery-Attempt

FieldTypeRequiredDescriptionConstraints
VT-Delivery-AttemptintegerYesthe attempt number of this delivery, starting at 1.1 <= value