diff --git a/404.html b/404.html index 4453270ec2..182ccf96ab 100644 --- a/404.html +++ b/404.html @@ -21,7 +21,7 @@ - +
diff --git a/agents-overview.html b/agents-overview.html index 2b14cc6901..7d0d1d3ba9 100644 --- a/agents-overview.html +++ b/agents-overview.html @@ -21,7 +21,7 @@ - + diff --git a/agents-tool-calling-agent-component.html b/agents-tool-calling-agent-component.html index 2074e9a384..4d232b34d9 100644 --- a/agents-tool-calling-agent-component.html +++ b/agents-tool-calling-agent-component.html @@ -21,7 +21,7 @@ - + diff --git a/api-reference-api-examples.html b/api-reference-api-examples.html index 88d3c8e141..c35f49f8e3 100644 --- a/api-reference-api-examples.html +++ b/api-reference-api-examples.html @@ -21,7 +21,7 @@ - + @@ -203,25 +203,36 @@ Thev2 endpoints require authentication by an API key or JWT.
To create a Langflow API key and export it as an environment variable, see Export values.
Upload a file to your user account. The file can be used across multiple flows.
-The file is uploaded in the format USER_ID/FILE_ID.FILE_EXTENSION, such as 6f17a73e-97d7-4519-a8d9-8e4c0be411bb/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34.txt.
-Replace FILE_NAME.EXTENSION with the uploaded file name and its extension.
_10curl -X POST \_10 "$LANGFLOW_URL/api/v2/files" \_10 -H "accept: application/json" \_10 -H "Content-Type: multipart/form-data" \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -F "file=@FILE_NAME.EXTENSION"
_10{_10 "id": "c7b22c4c-d5e0-4ec9-af97-5d85b7657a34",_10 "name": "FILE_NAME.EXTENSION",_10 "path": "6f17a73e-97d7-4519-a8d9-8e4c0be411bb/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34.txt",_10 "size": 1234,_10 "provider": null_10}
The file is uploaded in the format USER_ID/FILE_ID.FILE_EXTENSION, such as 07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf.
To retrieve your current user_id, call the /whoami endpoint.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v1/users/whoami" \_10 -H "accept: application/json"
Result:
+
_10{"id":"07e5b864-e367-4f52-b647-a48035ae7e5e","username":"langflow","profile_image":null,"store_api_key":null,"is_active":true,"is_superuser":true,"create_at":"2025-05-08T17:59:07.855965","updated_at":"2025-05-28T19:00:42.556460","last_login_at":"2025-05-28T19:00:42.554338","optins":{"github_starred":false,"dialog_dismissed":true,"discord_clicked":false,"mcp_dialog_dismissed":true}}
In the POST request to v2/files, replace @FILE_NAME.EXTENSION with the uploaded file name and its extension.
+You must include the ampersand (@) in the request to instruct curl to upload the contents of the file, not the string FILE_NAME.EXTENSION.
_10curl -X POST \_10 "$LANGFLOW_URL/api/v2/files" \_10 -H "accept: application/json" \_10 -H "Content-Type: multipart/form-data" \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -F "file=@FILE_NAME.EXTENSION"
The file is uploaded in the format USER_ID/FILE_ID.FILE_EXTENSION, and the API returns metadata about the uploaded file:
_10{_10 "id":"d44dc2e1-9ae9-4cf6-9114-8d34a6126c94",_10 "name":"engine_manual",_10 "path":"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf",_10 "size":851160,_10 "provider":null_10}
Send a file to your flow for analysis using the File component.
+Send a file to your flow for analysis using the File component and the API. +Your flow must contain a File component to receive the file.
The default file limit is 100 MB. To configure this value, change the LANGFLOW_MAX_FILE_SIZE_UPLOAD environment variable.
For more information, see Supported environment variables.
/api/v2/files endpoint.
-Replace FILE_NAME with the uploaded file name.
_10curl -X POST "$LANGFLOW_URL/api/v2/files" \_10 -H "Content-Type: multipart/form-data" \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -F "file=@FILE_NAME.png"
_10curl -X POST \_10 "$LANGFLOW_URL/api/v2/files" \_10 -H "accept: application/json" \_10 -H "Content-Type: multipart/form-data" \_10 -H "x-api-key: $LANGFLOW_API_KEY" \_10 -F "file=@FILE_NAME.EXTENSION"
The file is uploaded in the format USER_ID/FILE_ID.FILE_EXTENSION, and the API returns metadata about the uploaded file:
_10{_10 "id": "5f829bc4-ac1e-4a80-b1d1-fedc03cd5b6e",_10 "name": "FILE_NAME",_10 "path": "232f54ba-dd54-4760-977e-ed637f83e785/5f829bc4-ac1e-4a80-b1d1-fedc03cd5b6e.png",_10 "size": 84408,_10 "provider": null_10}
_10{_10 "id":"d44dc2e1-9ae9-4cf6-9114-8d34a6126c94",_10 "name":"engine_manual",_10 "path":"07e5b864-e367-4f52-b647-a48035ae7e5e/d44dc2e1-9ae9-4cf6-9114-8d34a6126c94.pdf",_10 "size":851160,_10 "provider": null_10}
/v1/run POST request.
+In this example, the file uploaded to /v2/files is included with the /v1/run POST request.
_16curl --request POST \_16 --url '$LANGFLOW_URL/api/v1/run/$FLOW_ID' \_16 --header 'Content-Type: application/json' \_16 --header 'x-api-key: $LANGFLOW_API_KEY' \_16 --data '{_16 "input_value": "what do you see?",_16 "output_type": "chat",_16 "input_type": "text",_16 "tweaks": {_16 "File-t2Ngc": {_16 "path": [_16 "232f54ba-dd54-4760-977e-ed637f83e785/5f829bc4-ac1e-4a80-b1d1-fedc03cd5b6e.png"_16 ]_16 }_16 }_16}'
_15curl --request POST \_15 --url "$LANGFLOW_URL/api/v1/run/$FLOW_ID" \_15 --header "Content-Type: application/json" \_15 --data '{_15 "input_value": "what do you see?",_15 "output_type": "chat",_15 "input_type": "text",_15 "tweaks": {_15 "File-1olS3": {_15 "path": [_15 "07e5b864-e367-4f52-b647-a48035ae7e5e/3a290013-fe1e-4d3d-a454-cacae81288f3.pdf"_15 ]_15 }_15 }_15}'
Result:
+
_10"text":"This document provides important safety information and instructions for selecting, installing, and operating Briggs & Stratton engines. It includes warnings and guidelines to prevent injury, fire, or damage, such as choosing the correct engine model, proper installation procedures, safe fuel handling, and correct engine operation. The document emphasizes following all safety precautions and using authorized parts to ensure safe and effective engine use."
List all files associated with your user account.
_10curl -X GET \_10 "$LANGFLOW_URL/api/v2/files" \_10 -H "accept: application/json" \_10 -H "x-api-key: $LANGFLOW_API_KEY"
_10[_10 {_10 "id": "c7b22c4c-d5e0-4ec9-af97-5d85b7657a34",_10 "name": "your_file",_10 "path": "6f17a73e-97d7-4519-a8d9-8e4c0be411bb/c7b22c4c-d5e0-4ec9-af97-5d85b7657a34.txt",_10 "size": 1234,_10 "provider": null_10 }_10]
Update an existing flow by its ID.
This example changes the value for endpoint_name from a random UUID to my_new_endpoint_name.
_13curl -X PATCH \_13 "$LANGFLOW_URL/api/v1/flows/$FLOW_ID" \_13 -H "accept: application/json" \_13 -H "Content-Type: application/json" \_13 -d '{_13 "name": "string",_13 "description": "string",_13 "data": {},_13 "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_13 "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",_13 "endpoint_name": "my_new_endpoint_name",_13 "locked": true_13}'
_18{_18 "name": "string",_18 "description": "string",_18 "icon": "Braces",_18 "icon_bg_color": null,_18 "gradient": "2",_18 "data": {},_18 "is_component": false,_18 "updated_at": "2024-12-30T18:30:22+00:00",_18 "webhook": false,_18 "endpoint_name": "my_new_endpoint_name",_18 "tags": null,_18 "locked": true,_18 "id": "01ce083d-748b-4b8d-97b6-33adbb6a528a",_18 "user_id": "f58396d4-a387-4bb8-b749-f40825c3d9f3",_18 "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_18 "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"_18}