Repository navigation
feat(agents): agents read and edit their customer's identity and start verification - #1186
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
3468d18 to
3eb56eb
Compare
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas/customers/IndividualCustomerUpdateRequest.yaml |
There was a problem hiding this comment.
this reuses IndividualCustomerUpdateRequest, so email/phoneNumber/kycStatus/currencies all look settable and then 400. an AgentCustomerUpdateRequest like AgentQuoteRequest in 1183 would be cleaner. also the backend ignores unknown keys instead of 400ing (quotes reject them)
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas/customers/KycLinkCreateRequest.yaml |
There was a problem hiding this comment.
backend only accepts redirectUri if it exactly matches one global return URL (connect.lightspark.com in prod, nothing elsewhere), which makes sense for the leaked-token case. but the spec reuses KycLinkCreateRequest, which says any https uri works. maybe drop the body here? and since it's one global URL, another platform's customers would land on connect. probably wants to be a platform setting before anyone else uses this
|
🦣 Congratulations @k15z - your substantive review earned a Giant short-faced kangaroo! (rare)
View your Frost-dex: https://zeus.dev.dev.sparkinfra.net/#/dinodex/k15z?section=ice-age |
3eb56eb to
d028cfa
Compare
d028cfa to
2e74999
Compare
2cffddb to
ba3ae44
Compare
[High impact] The PR gives authorized agents new access to customer identity and KYC workflows. Fix the identity update request schema before merging; the hosted KYC description also needs a small clarification. FindingsFix with agent prompt### Issue 1
openapi/paths/agents/agents_me_customer.yaml:59
`PATCH /agents/me/customer` uses `IndividualCustomerUpdateRequest`, which requires `customerType` and offers fields such as `email`, `phoneNumber`, and `currencies`. But this operation says any field outside its identity allowlist returns 400. Generated clients therefore require an unlisted field and advertise updates the endpoint rejects. Use an agent-specific request schema containing only the allowed identity fields.
### Issue 2
openapi/paths/agents/agents_me_kyc-link.yaml:46
The new hosted KYC endpoint describes 409 only as customer not ready. The existing customer endpoint explains the prerequisite: when the provider requires contact checks, both email and phone must be `VERIFIED` first. Carry that condition into this endpoint and explain that the platform must complete the contact checks before the agent retries. Otherwise, developers cannot tell which step is missing.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds four agent operations for reading and updating customer identity, submitting verification, and generating a hosted KYC link.
|
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas/customers/IndividualCustomerUpdateRequest.yaml |
There was a problem hiding this comment.
Update fields contradict endpoint rules
PATCH /agents/me/customer uses IndividualCustomerUpdateRequest, which requires customerType and offers fields such as email, phoneNumber, and currencies. But this operation says any field outside its identity allowlist returns 400. Generated clients therefore require an unlisted field and advertise updates the endpoint rejects. Use an agent-specific request schema containing only the allowed identity fields.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/agents/agents_me_customer.yaml
Line: 59
Comment:
**Update fields contradict endpoint rules**
`PATCH /agents/me/customer` uses `IndividualCustomerUpdateRequest`, which requires `customerType` and offers fields such as `email`, `phoneNumber`, and `currencies`. But this operation says any field outside its identity allowlist returns 400. Generated clients therefore require an unlisted field and advertise updates the endpoint rejects. Use an agent-specific request schema containing only the allowed identity fields.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Good catch. The operation now takes a new AgentCustomerUpdateRequest with only the identity fields an agent may change (fullName, birthDate, nationality, address, idType, identifier, countryOfIssuance and the EDD fields), and no customerType. Anything else, including email, phoneNumber and currencies, is still documented as a 400.
| schema: | ||
| $ref: ../../components/schemas/errors/Error403.yaml | ||
| '409': | ||
| description: Customer is not ready to begin hosted KYC |
There was a problem hiding this comment.
KYC prerequisite is unexplained
The new hosted KYC endpoint describes 409 only as customer not ready. The existing customer endpoint explains the prerequisite: when the provider requires contact checks, both email and phone must be VERIFIED first. Carry that condition into this endpoint and explain that the platform must complete the contact checks before the agent retries. Otherwise, developers cannot tell which step is missing.
Knowledge Base Used: Customers and accounts API
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/agents/agents_me_kyc-link.yaml
Line: 46
Comment:
**KYC prerequisite is unexplained**
The new hosted KYC endpoint describes 409 only as customer not ready. The existing customer endpoint explains the prerequisite: when the provider requires contact checks, both email and phone must be `VERIFIED` first. Carry that condition into this endpoint and explain that the platform must complete the contact checks before the agent retries. Otherwise, developers cannot tell which step is missing.
**Knowledge Base Used:** [Customers and accounts API](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/customers-and-accounts-api.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Updated. The 409 now matches the customer KYC-link endpoint: when the provider requires contact verification, the customer's email and phone must both be VERIFIED, and the platform must finish verify-email and verify-phone before the agent retries.
ba3ae44 to
215ec56
Compare
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
215ec56 to
2b86b0b
Compare
2b86b0b to
09230c3
Compare
…t verification GET/PATCH /agents/me/customer, POST /agents/me/verifications and POST /agents/me/kyc-link let an agent with the new MANAGE_IDENTITY permission read and correct its own individual customer's identity, submit it for verification and mint a hosted KYC link, so a consumer agent can finish KYC for its user. The PATCH takes AgentCustomerUpdateRequest, which holds only the identity fields an agent may change, and the KYC link's 409 states the contact-verification prerequisite. Stainless maps the three operations under agents.me. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GwZPrRKwG5naDdwrPjXyQJ
09230c3 to
a26acea
Compare
Agents read and edit their customer's identity and start verification.
GET/PATCH /agents/me/customer,POST /agents/me/verificationsandPOST /agents/me/kyc-link, using the existingIndividualCustomer,Verificationand KYC-link schemas.MANAGE_IDENTITY.agents.me.