POST
/
files
/
{assistant_name}
PINECONE_API_KEY="YOUR_API_KEY"
ASSISTANT_NAME="example-assistant"
ENCODED_METADATA="%7B%22published%22%3A%222024-01-01%22%2C%22document_type%22%3A%22script%22%7D" # URL encoded metadata - See w3schools.com/tags/ref_urlencode.ASP
LOCAL_FILE_PATH="/Users/jdoe/Downloads/example_file.txt"

curl -X "https://prod-1-data.ke.pinecone.io/assistant/files/$ASSISTANT_NAME?metadata=$ENCODED_METADATA" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -F "file=@$LOCAL_FILE_PATH"
{
  "name": "example-file.txt",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": "{ 'published': '2024-01-01', 'document_type': 'manuscript' }",
  "created_on": "2023-11-07T05:31:56Z",
  "updated_on": "2023-11-07T05:31:56Z",
  "status": "Processing",
  "percent_done": 50,
  "signed_url": "https://storage.googleapis.com/bucket/file.pdf",
  "error_message": "<string>"
}
PINECONE_API_KEY="YOUR_API_KEY"
ASSISTANT_NAME="example-assistant"
ENCODED_METADATA="%7B%22published%22%3A%222024-01-01%22%2C%22document_type%22%3A%22script%22%7D" # URL encoded metadata - See w3schools.com/tags/ref_urlencode.ASP
LOCAL_FILE_PATH="/Users/jdoe/Downloads/example_file.txt"

curl -X "https://prod-1-data.ke.pinecone.io/assistant/files/$ASSISTANT_NAME?metadata=$ENCODED_METADATA" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -F "file=@$LOCAL_FILE_PATH"
{
  "name": "example-file.txt",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": "{ 'published': '2024-01-01', 'document_type': 'manuscript' }",
  "created_on": "2023-11-07T05:31:56Z",
  "updated_on": "2023-11-07T05:31:56Z",
  "status": "Processing",
  "percent_done": 50,
  "signed_url": "https://storage.googleapis.com/bucket/file.pdf",
  "error_message": "<string>"
}

Authorizations

Api-Key
string
header
required

Pinecone API Key

Path Parameters

assistant_name
string
required

The name of the assistant to upload files to.

Query Parameters

metadata
string

Optional JSON-encoded metadata for files.

Body

multipart/form-data

The desired file to be uploaded and processed into the assistant.

The body is of type object.

Response

200
application/json

File upload has been accepted.

AssistantFileModel is the response format to a successful file upload request.