Skip to content

[grid] clarify email OTP registration bundle docs#562

Merged
DhruvPareek merged 1 commit into
mainfrom
dp/clarify-email-otp-registration-bundle-docs
Jun 10, 2026
Merged

[grid] clarify email OTP registration bundle docs#562
DhruvPareek merged 1 commit into
mainfrom
dp/clarify-email-otp-registration-bundle-docs

Conversation

@DhruvPareek

Copy link
Copy Markdown
Contributor

Clarifies the Global Accounts EMAIL_OTP docs source to match backend behavior. Registration may include otpEncryptionTargetBundle when adding EMAIL_OTP back through the signed-retry flow, but first-time EMAIL_OTP wallet bootstrap can omit it. Clients should call POST /auth/credentials/{id}/challenge when the bundle is absent before building encryptedOtpBundle.

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jun 9, 2026 7:55pm

Request Review

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

✱ 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 otpEncryptionTargetBundle behavior in EMAIL_OTP flow

go

docs(api): clarify otpEncryptionTargetBundle availability in EMAIL_OTP flow

kotlin

docs(api): clarify otpEncryptionTargetBundle optionality in EMAIL_OTP credential flow

openapi

docs(api): clarify otpEncryptionTargetBundle presence in EMAIL_OTP auth flows

php

docs(api): clarify otpEncryptionTargetBundle behavior in EMAIL_OTP auth flow

python

docs(api): update EMAIL_OTP verification flow descriptions in auth/credentials

ruby

docs(api): clarify otp_encryption_target_bundle optionality in auth credential responses

typescript

docs(api): clarify otpEncryptionTargetBundle behavior in auth credentials EMAIL_OTP flow
grid-openapi studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅

grid-ruby studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

⚠️ grid-go studio · code

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

go get github.com/stainless-sdks/grid-go@28d68ec0639f157c605b8436ee2960919096ba20
grid-kotlin studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

⚠️ grid-python studio · code

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

pip install https://pkg.stainless.com/s/grid-python/e7545b44da28c74214dab7e40435cde38e61490b/grid-0.0.1-py3-none-any.whl
⚠️ grid-csharp studio · code

Your SDK build had a failure in the build CI job, which is a regression from the base state.
generate ⚠️build ❗lint ✅test ❗

grid-php studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅lint ✅test ✅

grid-typescript studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/0695f3c3f7ba16e5d0e6fb982eec07e7731178d9/dist.tar.gz
⚠️ grid-cli studio · code

Your SDK build had a failure in the test CI job, which is a regression from the base state.
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-06-10 17:14:06 UTC

@DhruvPareek DhruvPareek marked this pull request as ready for review June 9, 2026 19:00
@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR clarifies the EMAIL_OTP registration documentation to accurately reflect that otpEncryptionTargetBundle is not always present in POST /auth/credentials responses — it is included when adding EMAIL_OTP back through the signed-retry flow, but may be omitted on first-time wallet bootstrap, in which case clients must call POST /auth/credentials/{id}/challenge to obtain it before verifying.

  • All source files updated: openapi/paths/auth/auth_credentials.yaml, auth_credentials_{id}_verify.yaml, AuthMethodResponse.yaml, and EmailOtpCredentialVerifyRequestFields.yaml are all updated alongside the generated openapi.yaml and mintlify/openapi.yaml, addressing the concern raised in the previous review thread.
  • MDX guides updated: authentication.mdx and client-keys.mdx both add clear guidance to call /challenge when the bundle is absent from the registration response.
  • One inconsistency to resolve: auth_credentials.yaml says the signed-retry response unconditionally "carries" the bundle, while authentication.mdx adds "when present, or call challenge if absent" — these need to be aligned on whether the bundle is guaranteed or conditional in the signed-retry path.

Confidence Score: 4/5

Documentation-only change; safe to merge after resolving the inconsistency between the API spec and the MDX walkthrough on whether the bundle is guaranteed in the signed-retry path.

The API spec (auth_credentials.yaml) unconditionally states the signed-retry response carries otpEncryptionTargetBundle, while the MDX add-credential walkthrough says when present, or call /challenge if absent — a developer following one source will write different client logic than one following the other.

mintlify/snippets/global-accounts/authentication.mdx — the add-credential activation step needs its when present wording reconciled with the unconditional language in openapi/paths/auth/auth_credentials.yaml.

Important Files Changed

Filename Overview
openapi/paths/auth/auth_credentials.yaml 201 description updated to distinguish signed-retry (bundle always present) from first-time bootstrap (bundle may be absent); source change will survive make build.
openapi/paths/auth/auth_credentials_{id}_verify.yaml EMAIL_OTP verify description updated to say from registration when present, or from /challenge when registration omitted it; language is consistent with the other source files.
openapi/components/schemas/auth/AuthMethodResponse.yaml Schema description and otpEncryptionTargetBundle property description updated to reflect conditional bundle presence; wording is clear and internally consistent.
openapi/components/schemas/auth/EmailOtpCredentialVerifyRequestFields.yaml Verify-request description updated to state from registration when present, or from /challenge when omitted; consistent with peer schema files.
mintlify/snippets/global-accounts/authentication.mdx Add-credential step updated with defensive when present / if absent wording that conflicts with auth_credentials.yaml which unconditionally states the bundle is present in the signed-retry flow.
mintlify/snippets/global-accounts/client-keys.mdx Bundle-source explanation and inline comment updated to reflect first-time bootstrap may omit the bundle; clear and actionable guidance added.
openapi.yaml Generated file updated identically to the source files; changes will be preserved as long as make build is run from the updated source.
mintlify/openapi.yaml Generated Mintlify copy updated to mirror the main openapi.yaml changes; matches source changes exactly.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[POST /auth/credentials] --> B{Which flow?}
    B -->|First-time EMAIL_OTP bootstrap| C[201 AuthMethod response]
    B -->|Add EMAIL_OTP via signed-retry| D[201 AuthMethod + otpEncryptionTargetBundle]
    C --> E{otpEncryptionTargetBundle present?}
    E -->|Yes| F[HPKE-encrypt OTP with bundle]
    E -->|No| G[POST /auth/credentials/id/challenge]
    G --> H[Receive otpEncryptionTargetBundle]
    H --> F
    D --> F
    F --> I[POST /auth/credentials/id/verify with encryptedOtpBundle]
    I --> J[202 payloadToSign + verificationToken]
    J --> K[Sign verificationToken with TEK private key]
    K --> L[Retry POST /auth/credentials/id/verify with Grid-Wallet-Signature]
    L --> M[200 AuthSession issued]
Loading
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
mintlify/snippets/global-accounts/authentication.mdx:718
**Inconsistency between add-credential docs and the API spec description**

The updated step says `EMAIL_OTP` uses the `otpEncryptionTargetBundle` "from the signed-retry registration response **when present**, or first calls `POST /auth/credentials/{id}/challenge` if the bundle is absent." However, `openapi/paths/auth/auth_credentials.yaml` (also updated in this PR) says the signed-retry response unconditionally "also carries `otpEncryptionTargetBundle`" — making the bundle always present in that flow. A developer reading the MDX add-credential walkthrough would conclude the bundle is optional in the signed-retry case and defensively add a challenge call, while the API spec implies it is always delivered. If the backend truly can omit the bundle even on the signed-retry path, the spec language should be softened to "may carry"; if it is always present there, the MDX should say "use the bundle from the signed-retry response" without the "when present / if absent" hedge.

Reviews (3): Last reviewed commit: "[grid] clarify email OTP registration bu..." | Re-trigger Greptile

Comment thread openapi.yaml
@DhruvPareek DhruvPareek changed the base branch from dp/fix-passkey-challenge-docs to graphite-base/562 June 9, 2026 19:07
@DhruvPareek DhruvPareek force-pushed the dp/clarify-email-otp-registration-bundle-docs branch from ce529cd to 2509d31 Compare June 9, 2026 19:26
@graphite-app graphite-app Bot changed the base branch from graphite-base/562 to main June 9, 2026 19:26
@DhruvPareek DhruvPareek force-pushed the dp/clarify-email-otp-registration-bundle-docs branch from 2509d31 to c585b8e Compare June 9, 2026 19:26

pengying commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Valid comment about the edit to the merged openapi file instead of the source files

@pengying pengying left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the source openapi files vs the merged one

@pengying pengying left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably need to regenerate the openapi after the schema changes

Copy link
Copy Markdown
Contributor Author

already regenerated w 'make build' and it profuced no diff

Copy link
Copy Markdown
Contributor Author

so openapi.yaml and mintlify/openapi.yaml are up to date

@DhruvPareek DhruvPareek requested a review from pengying June 10, 2026 16:33
@DhruvPareek DhruvPareek merged commit 20eb971 into main Jun 10, 2026
9 checks passed

Copy link
Copy Markdown
Contributor Author

Merge activity

@DhruvPareek DhruvPareek deleted the dp/clarify-email-otp-registration-bundle-docs branch June 10, 2026 17:07
pengying pushed a commit that referenced this pull request Jun 15, 2026
## Summary
- Fixed `buildEurBeneficiary` in Kotlin sample to match the `EurBeneficiary` OpenAPI schema
- The schema requires `countryOfResidence` (not `address`) as a required field
- Made `address` optional since it's not required in the schema

## Context
This fix was identified during the documentation sync review of recent schema changes:
- `ca99dc5` - chore: Sync account schemas (#568)
- `20eb971` - [grid] clarify email OTP registration bundle docs (#562)

The `EurBeneficiary.yaml` schema has:
```yaml
required:
- beneficiaryType
- countryOfResidence
- fullName
```

But the Kotlin sample was:
1. Requiring `address` (which is optional in the schema)
2. Not setting `countryOfResidence` (which is required)

## Test plan
- [x] Run `make lint` - passes
- [ ] Verify Kotlin sample compiles with Grid SDK

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants