Skip to content

docs(spec): correct quote expiresAt window, document 501 on /cards, add 429 to verify#498

Open
jklein24 wants to merge 2 commits into
mainfrom
at-5351-grid-spec-doc-accuracy-fixes
Open

docs(spec): correct quote expiresAt window, document 501 on /cards, add 429 to verify#498
jklein24 wants to merge 2 commits into
mainfrom
at-5351-grid-spec-doc-accuracy-fixes

Conversation

@jklein24
Copy link
Copy Markdown
Contributor

@jklein24 jklein24 commented May 23, 2026

Summary

Spec/docs accuracy fixes from the Grid error audit (epic AT-5324):

  • Quote.expiresAt: replace "1-5 minutes" claim with rail-aware wording
  • GET /cards and GET /cards/{id}: add documented 501 NOT_IMPLEMENTED response (matches deployed server)
  • POST /auth/credentials/{id}/verify: document 429 response and Retry-After header
  • DELETE /auth/sessions/{id}: clarify 404 semantics in description

Schema additions (supportedNetworks, RealtimeFundingQuoteSource.network) deferred — those are API design changes, not doc fixes.

Why

Audit observed integrators getting surprised by:

  • expiresAt 2+ days out vs. docs claiming 5 min
  • GET /cards returning 501 (undocumented)
  • No Retry-After guidance on verify rate-limits
  • 404 on already-deleted session looking like a bug

Test plan

  • make build clean
  • make lint clean

Refs AT-5351 under epic AT-5324

…dd 429 to verify

Updates several OpenAPI accuracy gaps surfaced by the Grid error audit
(parent epic AT-5324):

- Quote.expiresAt was documented as 1-5 minutes; probes show window
  varies by rail and corridor. Replace with rail-aware description and
  the instruction to rely on the timestamp rather than a fixed window.
- GET /cards (and /cards/{id}) returns 501 in dev today; document the
  response so SDK clients can handle it without surprise.
- POST /auth/credentials/{id}/verify can return 429 with Retry-After;
  document the rate-limit envelope and header.
- DELETE /auth/sessions/{id} description clarified to set expectations
  about 404 semantics on already-revoked sessions.

Schema additions (supportedNetworks on InternalAccount, network field
on RealtimeFundingQuoteSource) deferred — those are API design changes,
not doc fixes, and warrant their own tickets.

Refs AT-5351
@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment May 23, 2026 7:18am

Request Review

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 23, 2026

✱ Stainless preview builds for grid

This PR will update the grid SDKs with the following commit messages.

cli

chore(internal): regenerate SDK with no functional changes

csharp

docs(api): clarify session expiration/404 behavior and quote expiration timing

go

docs(api): update auth session delete and quote expiresAt documentation

kotlin

docs(api): clarify session delete and quote expiresAt behavior

openapi

feat(api): add 429 error to auth credentials verify, 501 error to cards endpoints

php

docs(spec): correct quote expiresAt window, document 501 on /cards, add 429 to verify

python

docs(api): expand sessions.revoke and Quote.expires_at descriptions

ruby

docs(api): update expires_at in quote, delete in sessions

typescript

docs(api): update auth.sessions.delete and Quote.expiresAt descriptions

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-openapi studio · code · diff

Your SDK build had at least one "error" diagnostic, but this did not represent a regression.
generate ❗

grid-ruby studio · code · diff

Your SDK build had at least one "error" diagnostic, but this did not represent a regression.
generate ❗build ✅lint ❗test ✅

grid-go studio · code · diff

Your SDK build had at least one "error" diagnostic, but this did not represent a regression.
generate ❗build ✅lint ❗test ❗

go get github.com/stainless-sdks/grid-go@01f0afc32a1f595b930193b7e5cd1b4274cae1f6
⚠️ grid-python studio · code · diff

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ❗build ✅lint ❗ (prev: lint ✅) → test ✅

pip install https://pkg.stainless.com/s/grid-python/a4011d5c54435a8242313d305caf3bd8360f964c/grid-0.0.1-py3-none-any.whl
grid-kotlin studio · code · diff

Your SDK build had at least one "error" diagnostic, but this did not represent a regression.
generate ❗build ✅lint ✅test ❗

grid-typescript studio · code · diff

Your SDK build had at least one "error" diagnostic, but this did not represent a regression.
generate ❗build ❗lint ❗test ❗

grid-csharp studio · code · diff

Your SDK build had at least one "error" diagnostic, but this did not represent a regression.
generate ❗build ❗lint ❗test ❗

⚠️ grid-php studio · code · diff

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ❗lint ❗ (prev: lint ✅) → test ✅

grid-cli studio · code · diff

Your SDK build had at least one "error" diagnostic, but this did not represent a regression.
generate ❗build ❗lint ❗test ❗


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-05-23 17:56:55 UTC

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 23, 2026

Greptile Summary

This PR makes accuracy fixes to the OpenAPI spec based on a Grid error audit — documenting previously-undocumented error responses and correcting the Quote.expiresAt description to be rail-aware.

  • 429 on verify: Adds the 429 RATE_LIMITED response (with Retry-After header) to POST /auth/credentials/{id}/verify, using the pre-existing Error429 schema which is also repositioned in the bundled YAML.
  • 501 on cards: Adds 501 NOT_IMPLEMENTED to POST /cards, GET /cards, GET /cards/{id}, and PATCH /cards/{id}, reflecting that card issuance is feature-flagged per deployment.
  • Quote expiry wording: Replaces the hard-coded "1–5 minutes" claim with rail-specific guidance, directing clients to always rely on the expiresAt timestamp.
  • Session 404 semantics: Extends the DELETE /auth/sessions/{id} description to explain that 404 on an already-revoked or expired session is safe and idempotent.

Confidence Score: 5/5

Pure documentation accuracy fixes — no logic changes, no schema structural changes, and all referenced schemas (Error429, Error501) already exist in the compiled bundle.

All changes are additive response-code documentation aligned with the deployed server's actual behavior. Both bundled files were regenerated via make build rather than edited directly. The Error429 schema repositioning is cosmetic and the definition is unchanged. No previous-thread issues remain unresolved in the current diff.

No files require special attention.

Important Files Changed

Filename Overview
openapi/paths/auth/auth_credentials_{id}_verify.yaml Adds 429 response with Retry-After header and $ref to existing Error429 schema — accurate and complete.
openapi/paths/auth/auth_sessions_{id}.yaml Adds 404 semantics paragraph to DELETE description; compound adjective "already-revoked" is on a single line so folded-scalar rendering is correct.
openapi/paths/cards/cards.yaml Adds 501 to both POST /cards and GET /cards with correct $ref to existing Error501 schema.
openapi/paths/cards/cards_{id}.yaml Adds 501 to both GET /cards/{id} and PATCH /cards/{id} — covers all card endpoints on this path.
openapi/components/schemas/quotes/Quote.yaml Replaces hard-coded "1-5 minutes" claim with rail-aware description; wording is accurate and correctly instructs clients to rely on the timestamp.
openapi.yaml Generated bundle updated via make build — mirrors all source changes and repositions Error429 schema (cosmetic reordering, schema definition unchanged).
mintlify/openapi.yaml Mintlify bundle updated via make build — identical semantic changes to openapi.yaml, including Error429 schema reorder.

Sequence Diagram

sequenceDiagram
    participant C as Client
    participant G as Grid API

    Note over C,G: POST /auth/credentials/{id}/verify — now documents 429
    C->>G: "POST /auth/credentials/{id}/verify"
    alt too many attempts
        G-->>C: 429 RATE_LIMITED + Retry-After: N
        C->>C: wait N seconds
        C->>G: retry POST
    end
    G-->>C: 200 OK

    Note over C,G: DELETE /auth/sessions/{id} — 404 semantics clarified
    C->>G: "DELETE /auth/sessions/{id}"
    alt session expired or already revoked
        G-->>C: 404 (resource not found — safe, idempotent)
    else active session
        G-->>C: 202 payloadToSign
        C->>G: DELETE (with Grid-Wallet-Signature)
        G-->>C: 204 No Content
    end

    Note over C,G: Card endpoints — now document 501
    C->>G: GET /cards
    alt card issuer not configured
        G-->>C: 501 NOT_IMPLEMENTED
    else cards enabled
        G-->>C: 200 OK
    end
Loading

Reviews (3): Last reviewed commit: "address greptile review feedback (greplo..." | Re-trigger Greptile

Comment thread openapi/paths/cards/cards_{id}.yaml
Comment thread openapi/paths/auth/auth_sessions_{id}.yaml Outdated
- Add 501 NOT_IMPLEMENTED response to PATCH /cards/{id} for parity with
  the GET endpoints (same card-issuer dependency).
- Reflow the auth_sessions_{id} DELETE description so the YAML folded
  scalar doesn't render 'already- revoked' with a space after the hyphen.
@jklein24
Copy link
Copy Markdown
Contributor Author

@greptile review

@jklein24 jklein24 marked this pull request as draft May 23, 2026 12:50
@jklein24 jklein24 marked this pull request as ready for review May 24, 2026 20:28
@jklein24 jklein24 requested a review from pengying May 24, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant