v172

OpenAPI 3.1.0raw.githubusercontent.com2026-08-0826148911.7 MB
Files

Upload a file

Files are used to upload documents that can be used with features like Deployments.

post/v2/files

Request body

filenamestring required

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

contentstring bytes required

Base64-encoded file contents.

purpose'FILE_PURPOSE_UNSPECIFIED' | 'FILE_PURPOSE_RETRIEVAL' | 'FILE_PURPOSE_KNOWLEDGE_DATASOURCE' | 'FILE_PURPOSE_BATCH' | 'FILE_PURPOSE_CODE_INTERPRETER'
content_typestring

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

project_idstring

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

OK