Add OTP email update endpoint to OpenAPI#450
Add OTP email update endpoint to OpenAPI#450DhruvPareek wants to merge 1 commit intoauth-passkey-challenge-credential-id-openapifrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-python studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-typescript 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. |
Greptile SummaryThis PR documents a new
Confidence Score: 5/5Safe to merge — this is a documentation-only change that correctly mirrors the established signed-retry flow pattern with no logic or runtime code affected. The new endpoint definition closely tracks the sibling export endpoint, all required response codes (including the previously requested 409) are present, the schema fields are correctly typed, and the bundled outputs match the source. The only finding is a cosmetic response-ordering inconsistency in the source YAML that the bundler already corrects in generated output. No files require special attention.
|
| Filename | Overview |
|---|---|
| openapi/paths/internal_accounts/internal_accounts_{id}_email.yaml | New PATCH endpoint for updating EMAIL_OTP email via the two-step signed-retry flow; closely mirrors the export endpoint pattern with correct responses (200, 202, 400, 401, 409, 404, 500), though 409 and 404 are listed out of ascending order in the source file. |
| openapi/components/schemas/internal_accounts/InternalAccountEmailUpdateRequest.yaml | New request schema with required email field (format: email), detailed description, and correct structure. |
| openapi/components/schemas/internal_accounts/InternalAccountEmailUpdateResponse.yaml | New response schema with required id, email, and updatedAt fields; missing top-level description (noted in previous thread). |
| openapi/components/schemas/errors/Error409.yaml | Adds EMAIL_OTP_EMAIL_ALREADY_EXISTS to the Error409 error code enum and description table. |
| openapi/openapi.yaml | Wires /internal-accounts/{id}/email path ref into the root spec alongside the existing export path. |
| openapi.yaml | Auto-generated bundle; correctly includes the new endpoint inline with all schema definitions. |
| mintlify/openapi.yaml | Auto-generated Mintlify bundle; identical new content to openapi.yaml; bundler correctly reorders 404 before 409 in the output. |
Sequence Diagram
sequenceDiagram
participant C as Client
participant G as Grid API
C->>G: "PATCH /internal-accounts/{id}/email<br/>Body: { email }"
G-->>C: "202 Accepted<br/>{ payloadToSign, requestId, expiresAt }"
Note over C: Sign payloadToSign with session API keypair
C->>G: "PATCH /internal-accounts/{id}/email<br/>Grid-Wallet-Signature: stamp<br/>Request-Id: requestId<br/>Body: { email }"
alt Email available
G-->>C: "200 OK { id, email, updatedAt }"
else Email already in use
G-->>C: 409 Conflict EMAIL_OTP_EMAIL_ALREADY_EXISTS
else Signature or challenge mismatch
G-->>C: 401 Unauthorized
end
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/internal_accounts/internal_accounts_{id}_email.yaml:103-118
The `409` response block is placed before `404`, breaking the ascending HTTP status-code order that every other endpoint in this repo follows (including the sibling export endpoint). OpenAPI parsers are order-agnostic so this is harmless at runtime, but the bundled output already reorders them correctly, which signals the mismatch with the source.
```suggestion
'404':
description: Internal account not found
content:
application/json:
schema:
$ref: ../../components/schemas/errors/Error404.yaml
'409':
description: >-
Conflict. Returned when the supplied email address is already
associated with an `EMAIL_OTP` credential on this or another
internal account.
content:
application/json:
schema:
$ref: ../../components/schemas/errors/Error409.yaml
'500':
```
Reviews (2): Last reviewed commit: "Add internal account email update endpoi..." | Re-trigger Greptile
e4c91f7 to
c2ec444
Compare

Summary:
PATCH /internal-accounts/{id}/emailOpenAPI path for updating the email address used by an Embedded Wallet account EMAIL_OTP credential.SignedRequestChallengeshape withpayloadToSign,requestId, andexpiresAt; signed retries return200with the updated account email resource.InternalAccountEmailUpdateRequestwith the requiredemailfield andInternalAccountEmailUpdateResponsewithid,email, andupdatedAt.409 Conflictfor duplicate EMAIL_OTP email addresses and adds theEMAIL_OTP_EMAIL_ALREADY_EXISTSerror code toError409.openapi/openapi.yamland regenerates the bundledopenapi.yamlandmintlify/openapi.yamlfiles.Files added:
openapi/paths/internal_accounts/internal_accounts_{id}_email.yamlopenapi/components/schemas/internal_accounts/InternalAccountEmailUpdateRequest.yamlopenapi/components/schemas/internal_accounts/InternalAccountEmailUpdateResponse.yamlFiles updated:
openapi/components/schemas/errors/Error409.yamlTesting:
npm run lint:openapi