PINECONE_API_KEY="YOUR_API_KEY"
ASSISTANT_NAME="example-assistant"
FILE_ID="my-custom-file-id"
LOCAL_FILE_PATH="/Users/jdoe/Downloads/example_file.txt"
curl -X PUT "https://prod-1-data.ke.pinecone.io/assistant/files/$ASSISTANT_NAME/$FILE_ID" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2026-04" \
-F "file=@$LOCAL_FILE_PATH"
{
"id": "op-1234-abcd-5678",
"operation_type": "upsert_file",
"file_id": "my-custom-file-id",
"status": "Processing",
"created_on": "2025-10-01T12:30:00Z",
"percent_complete": 0
}
Upsert a file
Create or replace a file in the specified assistant. If a file with the given assistant_file_id already exists, it will be replaced with the new file. If it doesn’t exist, a new file will be created with that identifier.
This operation is asynchronous. The file processing will occur in the background.
For guidance and examples, see Manage files.
PINECONE_API_KEY="YOUR_API_KEY"
ASSISTANT_NAME="example-assistant"
FILE_ID="my-custom-file-id"
LOCAL_FILE_PATH="/Users/jdoe/Downloads/example_file.txt"
curl -X PUT "https://prod-1-data.ke.pinecone.io/assistant/files/$ASSISTANT_NAME/$FILE_ID" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2026-04" \
-F "file=@$LOCAL_FILE_PATH"
{
"id": "op-1234-abcd-5678",
"operation_type": "upsert_file",
"file_id": "my-custom-file-id",
"status": "Processing",
"created_on": "2025-10-01T12:30:00Z",
"percent_complete": 0
}
PINECONE_API_KEY="YOUR_API_KEY"
ASSISTANT_NAME="example-assistant"
FILE_ID="my-custom-file-id"
LOCAL_FILE_PATH="/Users/jdoe/Downloads/example_file.txt"
curl -X PUT "https://prod-1-data.ke.pinecone.io/assistant/files/$ASSISTANT_NAME/$FILE_ID" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2026-04" \
-F "file=@$LOCAL_FILE_PATH"
{
"id": "op-1234-abcd-5678",
"operation_type": "upsert_file",
"file_id": "my-custom-file-id",
"status": "Processing",
"created_on": "2025-10-01T12:30:00Z",
"percent_complete": 0
}
Processing operation. The error_message field is present only when the operation status is Failed.Path Parameters
Query Parameters
Body
The desired file to be uploaded and processed into the assistant.
Optional metadata associated with the file. This metadata can be used to filter files when listing them or to restrict search results when querying the assistant. Maximum size is 16KB.
{
"created_by": "Jane Doe",
"published": "2025-10-01T00:00:00.000Z",
"tags": ["report", "Q4", "analytics"]
}
Response
File upload has been accepted for processing. The file will be created if it doesn't exist, or replaced if it already exists. The operation will complete asynchronously.
Describes the status of an ongoing or completed server operation.
Was this page helpful?