Skip to content

docs: add examples for users endpoints#8273

Merged
mendonk merged 9 commits into
mainfrom
docs-users-api-endpoints
Jun 17, 2025
Merged

docs: add examples for users endpoints#8273
mendonk merged 9 commits into
mainfrom
docs-users-api-endpoints

Conversation

@mendonk
Copy link
Copy Markdown
Collaborator

@mendonk mendonk commented May 29, 2025

Preview build

Add examples for the /users API endpoint in Langflow, detailing various user management operations.

Added more information on what user_id is to address some feedback.

Summary by CodeRabbit

  • Documentation
    • Added a detailed section to the API reference covering all operations for the /users endpoint, including example commands, responses, permission notes, and field behavior explanations.

@mendonk mendonk self-assigned this May 29, 2025
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. documentation Improvements or additions to documentation labels May 29, 2025
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels May 29, 2025
@mendonk mendonk requested a review from ogabrielluiz May 29, 2025 16:41
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels May 29, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels May 29, 2025
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels May 29, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2025

"""

Walkthrough

A new section has been added to the API reference documentation, detailing the /users endpoint for user account management in Langflow. The update provides example commands, JSON responses, permission requirements, and explanations for all user-related operations, structured with tabs for clarity.

Changes

File(s) Change Summary
docs/docs/API-Reference/api-reference-api-examples.md Added comprehensive documentation for the /users endpoint, including usage examples and details on permissions, fields, and responses.

Poem

In the docs a new tale appears,
Of users, commands, and API frontiers.
With curl in paw and JSON in sight,
Rabbits hop through endpoints, day and night.
Permissions explained, responses shown—
Now user management is clearly known!
🐇✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3cda321 and 297ab7f.

📒 Files selected for processing (1)
  • docs/docs/API-Reference/api-reference-api-examples.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/docs/API-Reference/api-reference-api-examples.md
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test Docs Build / Test Docs Build
  • GitHub Check: build-and-deploy

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels May 30, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (2)
docs/docs/API-Reference/api-reference-api-examples.md (2)

2390-2433: Grammar refinement: user’s id
In the Add user description, “users id” 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

📥 Commits

Reviewing files that changed from the base of the PR and between aff3829 and 25f71d9.

📒 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

Comment thread docs/docs/API-Reference/api-reference-api-examples.md
Comment thread docs/docs/API-Reference/api-reference-api-examples.md
Comment thread docs/docs/API-Reference/api-reference-api-examples.md
Comment thread docs/docs/API-Reference/api-reference-api-examples.md
Comment thread docs/docs/API-Reference/api-reference-api-examples.md
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels May 30, 2025
@mendonk mendonk requested a review from KimberlyFields May 30, 2025 16:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

Copy link
Copy Markdown
Collaborator

@KimberlyFields KimberlyFields left a comment

Choose a reason for hiding this comment

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

Left a few suggestions, but approving.

Comment thread docs/docs/API-Reference/api-reference-api-examples.md Outdated
Comment thread docs/docs/API-Reference/api-reference-api-examples.md Outdated
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 2, 2025
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Jun 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 protected curl examples.


2465-2468: 🛠️ Refactor suggestion

Include 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 suggestion

Include 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 suggestion

Include 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 suggestion

Include 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 suggestion

Include 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1e915d8 and b23af9e.

📒 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 the POST /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>
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Jun 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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
The whoami example 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 the x-api-key header 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

📥 Commits

Reviewing files that changed from the base of the PR and between b23af9e and 3cda321.

📒 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

Comment thread docs/docs/API-Reference/api-reference-api-examples.md
Comment thread docs/docs/API-Reference/api-reference-api-examples.md
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Jun 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@aimurphy
Copy link
Copy Markdown
Collaborator

@mendonk Can this be merged or is it waiting? There will be MC when I break up the examples page.

@mendonk
Copy link
Copy Markdown
Collaborator Author

mendonk commented Jun 16, 2025

@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

Copy link
Copy Markdown
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

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

LGTM

@mendonk mendonk added this pull request to the merge queue Jun 17, 2025
Merged via the queue into main with commit 1fcb500 Jun 17, 2025
13 checks passed
@mendonk mendonk deleted the docs-users-api-endpoints branch June 17, 2025 17:42
jordanrfrazier pushed a commit that referenced this pull request Jun 17, 2025
* 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>
ogabrielluiz pushed a commit to bkatya2001/langflow that referenced this pull request Jun 24, 2025
* 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>
@dosubot dosubot Bot mentioned this pull request Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants