Files
Upload a file
Files are used to upload documents that can be used with features like Deployments.
POST
Core - Upload retrieval file
Related guide: Files guide. See the Files guide for a walkthrough with examples.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Name to store for the uploaded file, including extension when available.
Base64-encoded file contents.
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, FILE_PURPOSE_CODE_INTERPRETER MIME type of the uploaded content, for example application/pdf.
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
Newly created file.