[grid-api] async-ops: GET /operations + wallet_operation webhooks (DRAFT — do not merge until async feature deploys)#559
Conversation
Mirror the async-ops public API surface from webdev sparkcore PR #28463
(which edited webdev's vendored grid-api/openapi.yaml) into the canonical
grid-api spec + docs.
Spec (openapi/ source, rebundled into openapi.yaml + mintlify/openapi.yaml):
- GET /operations/{operationId} polling endpoint (getOperationById), tagged
under a new "Operations" tag
- Operation / OperationResult / OperationError schemas
- wallet-operation webhook (WALLET_OPERATION.COMPLETED / .FAILED) +
WalletOperationWebhook / WalletOperationWebhookData schemas
- WALLET_OPERATION.COMPLETED / .FAILED added to the WebhookType enum
Adapted to the canonical spec's OpenAPI 3.1.0 dialect: nullable fields use
type-array / anyOf-with-`null` instead of the 3.0 `nullable: true` used in
webdev's vendored copy.
Docs:
- New api-reference/async-operations.mdx prose page (polling endpoint +
wallet_operation webhooks), wired into docs.json nav
- WALLET_OPERATION.* row added to the shared webhooks retry-policy table
redocly + spectral (--fail-severity=error) both pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-kotlin studio · code · diff
✅ grid-python studio · code · diff
✅ grid-cli studio · code · diff
✅ grid-typescript studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
✅ grid-csharp studio · code · diff
✅ grid-php studio · code · diff
✅ grid-openapi studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
What
Publish the canonical async-operations public surface in the Grid API spec + docs: the
GET /operations/{operationId}endpoint (withOperation/OperationResult/OperationErrorschemas), and theWALLET_OPERATION.COMPLETED/WALLET_OPERATION.FAILEDwebhooks (withWalletOperationWebhook*schemas +WebhookTypeenum values), plus theasync-operations.mdxMintlify guide and the webhooks snippet.Why
This is the partner-facing contract for the Turnkey request-driven async migration. When a state-changing or data-returning Turnkey op goes async it returns
202 {operationId: "Operation:<uuid>"}; partners then pollGET /operations/{operationId}and/or receive aWALLET_OPERATION.*webhook on terminal state. The endpoint is the only way to retrieve a data-returning result (wallet.export's HPKE bundle) — it is re-fetched on demand and never stored by Grid, never delivered in the webhook. This spec is what gates flippingGRID_TURNKEY_ASYNC_EXPORTON. See50-async-ops-api-design.md§1/§2.This is the external
lightsparkdev/grid-apisource-of-truth counterpart to the monorepo's vendored regen (sparkcore PR #28463); the two stay in lockstep.Notable points
statusisPROCESSING/COMPLETED/FAILED(uppercase) on the GET; webhookdata.statusis lowercasecompleted/failed— the docs call out branching on webhooktype, notdata.status.typecasing isWALLET_OPERATION.*(UPPERCASEOBJECT.EVENT), matching the establishedWebhookTypeconvention; reconciled atomically with the emitter in sparkcore PR #28460. Safe pre-GA since no partner has consumed the event yet.OperationResultis tagged bytypeso result shapes can grow per operation type without a breaking change; state-changing ops returnresult: null.Status
DRAFT — part of the Turnkey login-family migration / async-ops program; do not merge yet. Hold until the async feature actually deploys (the underlying knobs are still OFF), so the published docs don't promise an endpoint partners can't yet use.
Part of the Turnkey login-family migration program. See
00-program-plan.mdin the sparkcore login-migration docs.