docs: add examples for users endpoints#8273
Conversation
|
Build successful! ✅ |
|
Build successful! ✅ |
|
""" WalkthroughA new section has been added to the API reference documentation, detailing the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Build successful! ✅ |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
docs/docs/API-Reference/api-reference-api-examples.md (2)
2390-2433: Grammar refinement: user’sid
In the Add user description, “usersid” should be possessive. Change to:- This creates a new UUID for the users `id`, which is the same as `user_id`. + This creates a new UUID for the user’s `id`, which is the same as `user_id`.
2631-2656: Rephrase style & include auth header
For Delete user, add the header:curl -X DELETE \ "$LANGFLOW_URL/api/v1/users/10c1..." \ -H "accept: application/json" + -H "x-api-key: $LANGFLOW_API_KEY"And rephrase “This can only be used by superusers” to “This operation is restricted to superusers.”
🧰 Tools
🪛 LanguageTool
[style] ~2635-~2635: Consider replacing ‘only’ with a different word to let your writing stand out.
Context: ...user account from the system. This can only be used by superusers (`is_superuser: t...(ONLY_EXCLUSIVELY_STYLE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/docs/API-Reference/api-reference-api-examples.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/docs/API-Reference/api-reference-api-examples.md
[style] ~2470-~2470: Consider replacing ‘only’ with a different word to let your writing stand out.
Context: ... users in the system. This endpoint can only be used by superusers (`is_superuser: t...
(ONLY_EXCLUSIVELY_STYLE)
[style] ~2635-~2635: Consider replacing ‘only’ with a different word to let your writing stand out.
Context: ...user account from the system. This can only be used by superusers (`is_superuser: t...
(ONLY_EXCLUSIVELY_STYLE)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-and-deploy
|
Build successful! ✅ |
1 similar comment
|
Build successful! ✅ |
KimberlyFields
left a comment
There was a problem hiding this comment.
Left a few suggestions, but approving.
|
Build successful! ✅ |
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (6)
docs/docs/API-Reference/api-reference-api-examples.md (6)
2406-2412: Document authentication requirements for Users endpoints
The new Users section doesn’t specify which operations require an API key. Add an introductory note clarifying authentication requirements and include-H "x-api-key: $LANGFLOW_API_KEY"in all protectedcurlexamples.
2465-2468: 🛠️ Refactor suggestionInclude API key header for Get current user
Retrieving the current user requires authentication. Add the header and update the example:curl -X GET \ "$LANGFLOW_URL/api/v1/users/whoami" \ -H "accept: application/json" + -H "x-api-key: $LANGFLOW_API_KEY"
2493-2502: 🛠️ Refactor suggestionInclude API key header and rephrase “only” for List all users
Listing users is restricted to superusers. Add the authentication header and refine the description:-This endpoint can only be used by superusers (`is_superuser: true`). +This endpoint is restricted to superusers (`is_superuser: true`).curl -X GET \ "$LANGFLOW_URL/api/v1/users/?skip=0&limit=10" \ -H "accept: application/json" + -H "x-api-key: $LANGFLOW_API_KEY"🧰 Tools
🪛 LanguageTool
[style] ~2493-~2493: Consider replacing ‘only’ with a different word to let your writing stand out.
Context: ... users in the system. This endpoint can only be used by superusers (`is_superuser: t...(ONLY_EXCLUSIVELY_STYLE)
2577-2580: 🛠️ Refactor suggestionInclude API key header for Update user
Updating a user requires superuser privileges. Add the authentication header:curl -X PATCH \ "$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8" \ -H "Content-Type: application/json" + -H "x-api-key: $LANGFLOW_API_KEY"
2621-2627: 🛠️ Refactor suggestionInclude API key header and clarify scope for Reset password
Password resets require authentication and are self-service. Update the snippet:curl -X PATCH \ "$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8/reset-password" \ -H "Content-Type: application/json" + -H "x-api-key: $LANGFLOW_API_KEY"Add a note that users cannot reset other users’ passwords.
2664-2667: 🛠️ Refactor suggestionInclude API key header for Delete user
Deleting a user requires superuser authentication. Add:curl -X DELETE \ "$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8" \ -H "accept: application/json" + -H "x-api-key: $LANGFLOW_API_KEY"
🧹 Nitpick comments (1)
docs/docs/API-Reference/api-reference-api-examples.md (1)
2658-2658: Rephrase for clarity
Replace “This can only be used by superusers” with “This endpoint is restricted to superusers” to improve style.🧰 Tools
🪛 LanguageTool
[style] ~2658-~2658: Consider replacing ‘only’ with a different word to let your writing stand out.
Context: ...user account from the system. This can only be used by superusers (`is_superuser: t...(ONLY_EXCLUSIVELY_STYLE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/docs/API-Reference/api-reference-api-examples.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/docs/API-Reference/api-reference-api-examples.md
[style] ~2493-~2493: Consider replacing ‘only’ with a different word to let your writing stand out.
Context: ... users in the system. This endpoint can only be used by superusers (`is_superuser: t...
(ONLY_EXCLUSIVELY_STYLE)
[style] ~2658-~2658: Consider replacing ‘only’ with a different word to let your writing stand out.
Context: ...user account from the system. This can only be used by superusers (`is_superuser: t...
(ONLY_EXCLUSIVELY_STYLE)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Test Docs Build / Test Docs Build
- GitHub Check: build-and-deploy
🔇 Additional comments (1)
docs/docs/API-Reference/api-reference-api-examples.md (1)
2423-2430: Clarify auth for Add user
It’s unclear whether user creation is public or requires authentication. Please verify if thePOST /api/v1/users/endpoint needs an API key and update the example or note accordingly.
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
|
Build successful! ✅ |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (5)
docs/docs/API-Reference/api-reference-api-examples.md (5)
2406-2412: Duplicate: Document authentication requirements
The new Users section does not specify which endpoints require authentication nor how to include the API key header. Please add guidance in the introductory text.Proposed diff:
## Users +<!-- Note: Except for **Add user** (registration), all `/users` endpoints require authentication. Include: --> +<!-- -H "x-api-key: $LANGFLOW_API_KEY" --> Use the `/users` endpoint to manage user accounts in Langflow.
2465-2468: Duplicate: Require API key header for Get current user
Thewhoamiexample lacks-H "x-api-key: $LANGFLOW_API_KEY"and does not note that authentication is required.Suggested diff:
curl -X GET \ "$LANGFLOW_URL/api/v1/users/whoami" \ - -H "accept: application/json" + -H "accept: application/json" \ + -H "x-api-key: $LANGFLOW_API_KEY"Also update description to:
Retrieve information about the currently authenticated user (requires API key).
2499-2502: Duplicate: Include API key header for List all users
The List all users example is missing thex-api-keyheader and should rephrase the permission note for style.Suggested diff:
curl -X GET \ "$LANGFLOW_URL/api/v1/users/?skip=0&limit=10" \ - -H "accept: application/json" + -H "accept: application/json" \ + -H "x-api-key: $LANGFLOW_API_KEY"And change:
-Only superusers can use this endpoint (`is_superuser: true`). +This endpoint is restricted to superusers (`is_superuser: true`).
2577-2584: Duplicate: Include API key header for Update user
The Update user curl snippet is missing authentication and does not clarify that only superusers may perform this.Suggested diff:
curl -X PATCH \ "$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json" \ + -H "x-api-key: $LANGFLOW_API_KEY" \ -d '{ "is_active": true, "is_superuser": true }'Also add above:
Only superusers may perform this operation.
2621-2627: Duplicate: Include API key header for Reset password
The Reset password example lacks the API key header and doesn’t note that users can only reset their own password.Suggested diff:
curl -X PATCH \ "$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8/reset-password" \ - -H "Content-Type: application/json" \ + -H "Content-Type: application/json" \ + -H "x-api-key: $LANGFLOW_API_KEY" \ -d '{ "password": "newsecurepassword123" }'And update description to:
Users can only reset their own password; superusers cannot reset another user’s password.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/docs/API-Reference/api-reference-api-examples.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Test Docs Build / Test Docs Build
- GitHub Check: build-and-deploy
|
Build successful! ✅ |
|
@mendonk Can this be merged or is it waiting? There will be MC when I break up the examples page. |
Waiting for @ogabrielluiz to approve |
* initial-content * sentence-case * user-id-clarification * apostrophe and clarity * Apply suggestions from code review Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com> * add-auth-to-requests-that-use-it --------- Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
* initial-content * sentence-case * user-id-clarification * apostrophe and clarity * Apply suggestions from code review Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com> * add-auth-to-requests-that-use-it --------- Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Preview build
Add examples for the
/usersAPI endpoint in Langflow, detailing various user management operations.Added more information on what
user_idis to address some feedback.Summary by CodeRabbit
/usersendpoint, including example commands, responses, permission notes, and field behavior explanations.