Skip to main content

Users endpoints

Use the /users endpoint to manage user accounts in Langflow.

The user_id value is specifically for Langflow's user system, which is stored in the Langflow database and managed at the /users API endpoint. The user_id primary key in the Langflow database is mapped to the id value in the API.

Add user

Create a new user account with a username and password.

This creates a new UUID for the user's id, which is mapped to user_id in the Langflow database.


_10
curl -X POST \
_10
"$LANGFLOW_URL/api/v1/users/" \
_10
-H "Content-Type: application/json" \
_10
-d '{
_10
"username": "newuser2",
_10
"password": "securepassword123"
_10
}'

Get current user

Retrieve information about the currently authenticated user.


_10
curl -X GET \
_10
"$LANGFLOW_URL/api/v1/users/whoami" \
_10
-H "accept: application/json" \
_10
-H "x-api-key: $LANGFLOW_API_KEY"

List all users

Get a paginated list of all users in the system. Only superusers can use this endpoint (is_superuser: true).


_10
curl -X GET \
_10
"$LANGFLOW_URL/api/v1/users/?skip=0&limit=10" \
_10
-H "accept: application/json" \
_10
-H "x-api-key: $LANGFLOW_API_KEY"

Update user

Modify an existing user's information with a PATCH request.

This example makes the user 10c1c6a2-ab8a-4748-8700-0e4832fd5ce8 an active superuser.


_10
curl -X PATCH \
_10
"$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8" \
_10
-H "Content-Type: application/json" \
_10
-H "x-api-key: $LANGFLOW_API_KEY" \
_10
-d '{
_10
"is_active": true,
_10
"is_superuser": true
_10
}'

Reset password

Change a user's password to a new secure value.

You can't change another user's password.


_10
curl -X PATCH \
_10
"$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8/reset-password" \
_10
-H "Content-Type: application/json" \
_10
-H "x-api-key: $LANGFLOW_API_KEY" \
_10
-d '{
_10
"password": "newsecurepassword123"
_10
}'

Delete user

Remove a user account from the system.

Only superusers can use this endpoint (is_superuser: true).


_10
curl -X DELETE \
_10
"$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8" \
_10
-H "accept: application/json" \
_10
-H "x-api-key: $LANGFLOW_API_KEY"

Search