Skip to main content
POST
Core - Upload retrieval file

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
filename
string
required

Name to store for the uploaded file, including extension when available.

content
string<bytes>
required

Base64-encoded file contents.

purpose
enum<string>

Intended usage category for the uploaded file. Defaults to retrieval when omitted.

Available options:
FILE_PURPOSE_UNSPECIFIED,
FILE_PURPOSE_RETRIEVAL,
FILE_PURPOSE_KNOWLEDGE_DATASOURCE,
FILE_PURPOSE_BATCH
content_type
string

MIME type of the uploaded content, for example application/pdf.

project_id
string

Project the file is created in. Optional: project-scoped API keys default to the key's bound project; workspace-scoped callers default to the workspace's default project.

Response

200 - application/json

OK

file
object
required

Newly created file.