Files
Files Bash makes, and files you hand it.
RoutesOpen one for every field it takes and answers.
POST/v1/filesUpload a file for Bash to use: multipart/form-data with one part named file.
user_id in the query names whose Bash it is for; without it, the company's own.
Request3 fields
Query
user_idstringWhose file it is, by your id for them. Absent: your company's own Bash's.
- Type
string
Headers
Idempotency-KeystringSend the same key to retry this call safely for 24 hours.
- Type
string
Body, as a form
filestringrequiredThe file, in a form field named file: 10 MB at most.
- Limits
- At most 10485760 characters.
Answers 20110 fields
idstringThe file (file_...): hand it to an ask as an attachment.
- Example
file_2nq
object"file"Always file.
- Type
"file"
user_idstring | nullYour id for its user; null on your company's own Bash.
- Type
string | null
filenamestring | nullThe file's name; null when it has none.
- Example
itinerary.pdf
mime_typestring | nullIts type, such as application/pdf; null when unknown.
- Type
string | null
size_bytesinteger | nullIts size, in bytes; null when unknown.
- Type
integer | null
source"upload" | "output"upload: a file you handed Bash. output: a file Bash made.
- Type
"upload" | "output"
task_idstring | nullThe task it belongs to (task_...): the one that made it, or used it; null when none did.
- Type
string | null
conversation_idstring | nullThe conversation of its task (conv_...); null for a file no task touched.
- Type
string | null
created_atstringWhen it was made or uploaded, as an ISO 8601 time.
- Type
string
const file = await vestra.user('traveller-42').files.upload('ticket.pdf');file = vestra.user("traveller-42").files.upload("ticket.pdf")vestra files add ticket.pdf --user traveller-42# Upload a file. Send it for one user as multipart form data, with one part named file, up to 10 MB.curl "$VESTRA_BASE_URL/v1/files?user_id=traveller-42" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -F "file=@ticket.pdf" # Download what Bash made. List one conversation's files (its tasks' outputs), or one task's.curl "$VESTRA_BASE_URL/v1/files?conversation_id=conv_8f2k" \ -H "Authorization: Bearer $VESTRA_API_KEY" # Get one file. The response has a download link that works for a short while.curl "$VESTRA_BASE_URL/v1/files/file_2kq" \ -H "Authorization: Bearer $VESTRA_API_KEY"{ "method": "tools/call", "params": { "name": "files", "arguments": { "user": "traveller-42", "conversation": "conv_8f2k" } }}GET/v1/filesFiles, each with its task and conversation: one user's (user_id) or the company's own Bash's, one task's outputs (task_id), or one conversation's, its tasks' outputs (conversation_id).
source picks what you handed Bash (upload) or what Bash made (output).