Users endpoints
Use the /users endpoint to manage user accounts in Langflow.
Add user
Create a new user account with a given username and password.
Requires authentication as a superuser if the Langflow server has authentication enabled.
- Python
- JavaScript
- curl
1import os
2import uuid
3
4import requests
5
6base = os.environ.get("LANGFLOW_URL", "")
7api_key = os.environ.get("LANGFLOW_API_KEY", "")
8
9headers = {"Content-Type": "application/json", "x-api-key": api_key}
10
11payload = {
12 "username": f"docsuser_{uuid.uuid4().hex[:12]}",
13 "password": "securepassword123",
14}
15
16response = requests.post(f"{base}/api/v1/users/", headers=headers, json=payload, timeout=30)
17response.raise_for_status()
18print(response.text)
19
1const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/users/`;
2
3const options = {
4 method: 'POST',
5 headers: {
6 "Content-Type": `application/json`,
7 "x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
8 },
9 body: JSON.stringify({
10 "username": "newuser2",
11 "password": "securepassword123"
12}),
13};
14
15fetch(url, options)
16 .then(async (response) => {
17 if (!response.ok) {
18 throw new Error(`HTTP ${response.status}`);
19 }
20 const text = await response.text();
21 console.log(text);
22 })
23 .catch((error) => console.error(error));
24
1curl -X POST \
2 "$LANGFLOW_URL/api/v1/users/" \
3 -H "Content-Type: application/json" \
4 -H "x-api-key: $LANGFLOW_API_KEY" \
5 -d '{
6 "username": "newuser2",
7 "password": "securepassword123"
8 }'
9
The request returns an object describing the new user.
The user's UUID is stored in user_id in the Langflow database, and returned as id in the /users API response.
This user_id key is specifically for Langflow user management.
Result
1{
2 "id": "10c1c6a2-ab8a-4748-8700-0e4832fd5ce8",
3 "username": "newuser2",
4 "profile_image": null,
5 "store_api_key": null,
6 "is_active": false,
7 "is_superuser": false,
8 "create_at": "2025-05-29T16:02:20.132436",
9 "updated_at": "2025-05-29T16:02:20.132442",
10 "last_login_at": null,
11 "optins": {
12 "github_starred": false,
13 "dialog_dismissed": false,
14 "discord_clicked": false
15 }
16}
17
Get current user
Retrieve information about the authenticated user.
- Python
- JavaScript
- curl
1import os
2
3import requests
4
5url = f"{os.getenv('LANGFLOW_URL', '')}/api/v1/users/whoami"
6
7headers = {
8 "accept": "application/json",
9 "x-api-key": f"{os.getenv('LANGFLOW_API_KEY', '')}",
10}
11
12response = requests.request("GET", url, headers=headers)
13response.raise_for_status()
14
15print(response.text)
16
1const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/users/whoami`;
2
3const options = {
4 method: 'GET',
5 headers: {
6 "accept": `application/json`,
7 "x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
8 },
9};
10
11fetch(url, options)
12 .then(async (response) => {
13 if (!response.ok) {
14 throw new Error(`HTTP ${response.status}`);
15 }
16 const text = await response.text();
17 console.log(text);
18 })
19 .catch((error) => console.error(error));
20
1curl -X GET \
2 "$LANGFLOW_URL/api/v1/users/whoami" \
3 -H "accept: application/json" \
4 -H "x-api-key: $LANGFLOW_API_KEY"
5
Result
1{
2 "id": "07e5b864-e367-4f52-b647-a48035ae7e5e",
3 "username": "langflow",
4 "profile_image": null,
5 "store_api_key": null,
6 "is_active": true,
7 "is_superuser": true,
8 "create_at": "2025-05-08T17:59:07.855965",
9 "updated_at": "2025-05-29T15:06:56.157860",
10 "last_login_at": "2025-05-29T15:06:56.157016",
11}
12
List all users
Get a paginated list of all users in the system.
Requires authentication as a superuser if the Langflow server has authentication enabled.
- Python
- JavaScript
- curl
1import os
2
3import requests
4
5url = f"{os.getenv('LANGFLOW_URL', '')}/api/v1/users/?skip=0&limit=10"
6
7headers = {
8 "accept": "application/json",
9 "x-api-key": f"{os.getenv('LANGFLOW_API_KEY', '')}",
10}
11
12response = requests.request("GET", url, headers=headers)
13response.raise_for_status()
14
15print(response.text)
16
1const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/users/?skip=0&limit=10`;
2
3const options = {
4 method: 'GET',
5 headers: {
6 "accept": `application/json`,
7 "x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
8 },
9};
10
11fetch(url, options)
12 .then(async (response) => {
13 if (!response.ok) {
14 throw new Error(`HTTP ${response.status}`);
15 }
16 const text = await response.text();
17 console.log(text);
18 })
19 .catch((error) => console.error(error));
20
1curl -X GET \
2 "$LANGFLOW_URL/api/v1/users/?skip=0&limit=10" \
3 -H "accept: application/json" \
4 -H "x-api-key: $LANGFLOW_API_KEY"
5
Result
1{
2 "total_count": 3,
3 "users": [
4 {
5 "id": "07e5b864-e367-4f52-b647-a48035ae7e5e",
6 "username": "langflow",
7 "profile_image": null,
8 "store_api_key": null,
9 "is_active": true,
10 "is_superuser": true,
11 "create_at": "2025-05-08T17:59:07.855965",
12 "updated_at": "2025-05-29T15:06:56.157860",
13 "last_login_at": "2025-05-29T15:06:56.157016",
14 "optins": {
15 "github_starred": false,
16 "dialog_dismissed": true,
17 "discord_clicked": false,
18 "mcp_dialog_dismissed": true
19 }
20 },
21 {
22 "id": "c48a1f68-cc7e-491a-a507-a1a627708470",
23 "username": "newuser",
24 "profile_image": null,
25 "store_api_key": null,
26 "is_active": false,
27 "is_superuser": false,
28 "create_at": "2025-05-29T16:00:33.483386",
29 "updated_at": "2025-05-29T16:00:33.483392",
30 "last_login_at": null,
31 "optins": {
32 "github_starred": false,
33 "dialog_dismissed": false,
34 "discord_clicked": false
35 }
36 },
37 {
38 "id": "10c1c6a2-ab8a-4748-8700-0e4832fd5ce8",
39 "username": "newuser2",
40 "profile_image": null,
41 "store_api_key": null,
42 "is_active": false,
43 "is_superuser": false,
44 "create_at": "2025-05-29T16:02:20.132436",
45 "updated_at": "2025-05-29T16:02:20.132442",
46 "last_login_at": null,
47 "optins": {
48 "github_starred": false,
49 "dialog_dismissed": false,
50 "discord_clicked": false
51 }
52 }
53 ]
54}
55
Update user
Modify an existing user's information with a PATCH request.
Requires authentication as a superuser if the Langflow server has authentication enabled.
This example activates the specified user's account and makes them a superuser:
- Python
- JavaScript
- curl
1import os
2
3import requests
4
5base = os.environ.get("LANGFLOW_URL", "")
6api_key = os.environ.get("LANGFLOW_API_KEY", "")
7
8headers = {"Content-Type": "application/json", "x-api-key": api_key}
9
10who = requests.get(f"{base}/api/v1/users/whoami", headers=headers, timeout=30)
11who.raise_for_status()
12user_id = who.json()["id"]
13
14payload = {"is_active": True}
15
16response = requests.patch(f"{base}/api/v1/users/{user_id}", headers=headers, json=payload, timeout=30)
17response.raise_for_status()
18print(response.text)
19
1const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8`;
2
3const options = {
4 method: 'PATCH',
5 headers: {
6 "Content-Type": `application/json`,
7 "x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
8 },
9 body: JSON.stringify({
10 "is_active": true,
11 "is_superuser": true
12}),
13};
14
15fetch(url, options)
16 .then(async (response) => {
17 if (!response.ok) {
18 throw new Error(`HTTP ${response.status}`);
19 }
20 const text = await response.text();
21 console.log(text);
22 })
23 .catch((error) => console.error(error));
24
1curl -X PATCH \
2 "$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8" \
3 -H "Content-Type: application/json" \
4 -H "x-api-key: $LANGFLOW_API_KEY" \
5 -d '{
6 "is_active": true,
7 "is_superuser": true
8 }'
9
Result
1{
2 "id": "10c1c6a2-ab8a-4748-8700-0e4832fd5ce8",
3 "username": "newuser2",
4 "profile_image": null,
5 "store_api_key": null,
6 "is_active": true,
7 "is_superuser": true,
8 "create_at": "2025-05-29T16:02:20.132436",
9 "updated_at": "2025-05-29T16:19:03.514527Z",
10 "last_login_at": null,
11 "optins": {
12 "github_starred": false,
13 "dialog_dismissed": false,
14 "discord_clicked": false
15 }
16}
17
Reset password
Change the specified user's password to a new secure value.
Requires authentication as the target user.
- Python
- JavaScript
- curl
1import os
2
3import requests
4
5base = os.environ.get("LANGFLOW_URL", "")
6api_key = os.environ.get("LANGFLOW_API_KEY", "")
7
8headers = {"Content-Type": "application/json", "x-api-key": api_key}
9
10who = requests.get(f"{base}/api/v1/users/whoami", headers=headers, timeout=30)
11who.raise_for_status()
12user_id = who.json()["id"]
13
14# Must differ from the current password (default superuser is often langflow/langflow).
15payload = {"password": "DocsExampleResetPass2025!"}
16
17response = requests.patch(
18 f"{base}/api/v1/users/{user_id}/reset-password",
19 headers=headers,
20 json=payload,
21 timeout=30,
22)
23response.raise_for_status()
24print(response.text)
25
1const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8/reset-password`;
2
3const options = {
4 method: 'PATCH',
5 headers: {
6 "Content-Type": `application/json`,
7 "x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
8 },
9 body: JSON.stringify({
10 "password": "newsecurepassword123"
11}),
12};
13
14fetch(url, options)
15 .then(async (response) => {
16 if (!response.ok) {
17 throw new Error(`HTTP ${response.status}`);
18 }
19 const text = await response.text();
20 console.log(text);
21 })
22 .catch((error) => console.error(error));
23
1curl -X PATCH \
2 "$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8/reset-password" \
3 -H "Content-Type: application/json" \
4 -H "x-api-key: $LANGFLOW_API_KEY" \
5 -d '{
6 "password": "newsecurepassword123"
7 }'
8
Result
1{
2 "id": "10c1c6a2-ab8a-4748-8700-0e4832fd5ce8",
3 "username": "langflow",
4 "profile_image": null,
5 "store_api_key": null,
6 "is_active": true,
7 "is_superuser": true,
8 "create_at": "2025-05-08T17:59:07.855965",
9 "updated_at": "2025-05-29T15:06:56.157860",
10 "last_login_at": "2025-05-29T15:06:56.157016",
11 "optins": {
12 "github_starred": false,
13 "dialog_dismissed": true,
14 "discord_clicked": false
15 }
16}
17
Delete user
Remove a user account from the system.
Requires authentication as a superuser if the Langflow server has authentication enabled.
- Python
- JavaScript
- curl
1import os
2import uuid
3
4import requests
5
6base = os.environ.get("LANGFLOW_URL", "")
7api_key = os.environ.get("LANGFLOW_API_KEY", "")
8
9headers = {"accept": "application/json", "Content-Type": "application/json", "x-api-key": api_key}
10
11create = requests.post(
12 f"{base}/api/v1/users/",
13 headers=headers,
14 json={"username": f"docsdel_{uuid.uuid4().hex[:12]}", "password": "securepassword123"},
15 timeout=30,
16)
17create.raise_for_status()
18user_id = create.json()["id"]
19
20delete = requests.delete(f"{base}/api/v1/users/{user_id}", headers=headers, timeout=30)
21delete.raise_for_status()
22print(delete.text)
23
1const url = `${process.env.LANGFLOW_URL ?? ""}/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8`;
2
3const options = {
4 method: 'DELETE',
5 headers: {
6 "accept": `application/json`,
7 "x-api-key": `${process.env.LANGFLOW_API_KEY ?? ""}`,
8 },
9};
10
11fetch(url, options)
12 .then(async (response) => {
13 if (!response.ok) {
14 throw new Error(`HTTP ${response.status}`);
15 }
16 const text = await response.text();
17 console.log(text);
18 })
19 .catch((error) => console.error(error));
20
1curl -X DELETE \
2 "$LANGFLOW_URL/api/v1/users/10c1c6a2-ab8a-4748-8700-0e4832fd5ce8" \
3 -H "accept: application/json" \
4 -H "x-api-key: $LANGFLOW_API_KEY"
5
Result
1{
2 "detail": "User deleted"
3}
4