Skip to content

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

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

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 corrects documentation accuracy issues surfaced by the Grid error audit. All changes are spec/doc only — no server logic is modified.

  • Quote.expiresAt: replaces the hardcoded "1–5 minutes" claim with rail-aware wording that lists specific instant-rail corridors and notes that longer-settlement corridors may have wider windows.
  • Card endpoints: adds 501 NOT_IMPLEMENTED to POST /cards, GET /cards, GET /cards/{id}, and PATCH /cards/{id}, aligning the spec with deployed server behavior for environments without a configured card issuer.
  • POST /auth/credentials/{id}/verify: documents the 429 response and Retry-After header, giving integrators the backoff guidance they were previously missing.
  • DELETE /auth/sessions/{id}: adds an operation-level paragraph clarifying that 404 covers expired and already-revoked sessions, not just "never issued" IDs.

Confidence Score: 5/5

Safe to merge — all changes are spec documentation only with no server logic modifications.

Every changed file is an OpenAPI YAML spec or its bundled derivative. The additions (501 on card endpoints, 429 on verify, 404 semantics on session delete, rail-aware quote expiry) match the described deployed server behavior. The bundled openapi.yaml and mintlify/openapi.yaml are consistent with the modular source files.

No files require special attention.

Important Files Changed

Filename Overview
openapi/components/schemas/quotes/Quote.yaml Updated expiresAt description to rail-aware wording, replacing the inaccurate "1-5 minutes" claim with a timestamp-first approach that lists rail-specific windows.
openapi/paths/auth/auth_credentials_{id}_verify.yaml Added 429 response with Retry-After header documentation; Retry-After header is not marked required:true, which understates server behavior on 429 responses.
openapi/paths/auth/auth_sessions_{id}.yaml Added operation-level description clarifying 404 semantics to cover expired and previously-revoked sessions, not just "not found".
openapi/paths/cards/cards.yaml Added 501 NOT_IMPLEMENTED to both POST /cards and GET /cards responses; correct and consistent with deployed server behavior.
openapi/paths/cards/cards_{id}.yaml Added 501 NOT_IMPLEMENTED to both GET /cards/{id} and PATCH /cards/{id}; all card endpoint operations now have 501 coverage.
openapi.yaml Bundled spec updated with all modular changes; Error429 schema moved earlier in components (reorder only, content identical).
mintlify/openapi.yaml Mintlify copy of bundled spec updated in lockstep with openapi.yaml; changes are identical.

Sequence Diagram

sequenceDiagram
    participant C as Client
    participant G as Grid API

    Note over C,G: POST /auth/credentials/{id}/verify (with 429 now documented)
    C->>G: "POST /auth/credentials/{id}/verify"
    alt Success
        G-->>C: 200 OK (AuthSession + encryptedSessionSigningKey)
    else Too many attempts
        G-->>C: 429 RATE_LIMITED + Retry-After: N
        Note over C: Back off N seconds
        C->>G: "POST /auth/credentials/{id}/verify (retry)"
        G-->>C: 200 OK
    end

    Note over C,G: DELETE /auth/sessions/{id} - 404 semantics clarified
    C->>G: "DELETE /auth/sessions/{id} (no headers)"
    G-->>C: 202 (payloadToSign + requestId)
    C->>G: "DELETE /auth/sessions/{id} (Grid-Wallet-Signature + Request-Id)"
    alt Session still active
        G-->>C: 204 No Content
    else Session expired or already revoked
        G-->>C: 404 (resource state, not a client error)
    end

    Note over C,G: GET /cards or GET /cards/{id} - 501 now documented
    C->>G: GET /cards
    alt Cards enabled
        G-->>C: 200 OK
    else No card issuer configured
        G-->>C: 501 NOT_IMPLEMENTED
    end
Loading

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
openapi/paths/auth/auth_credentials_{id}_verify.yaml:118-122
The `Retry-After` header is documented here but not marked as `required: true`. Since the 429 description explicitly tells clients to "back off and retry after the interval indicated by the `Retry-After` response header," the spec implies the header is always present on a 429. Omitting `required: true` means generated SDK clients and validators may treat the header as optional and skip implementing the backoff, defeating the purpose of documenting it.

```suggestion
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          required: true
          schema:
            type: integer
```

Reviews (2): 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
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