Upload File
Requests to upload one or more files to be used in an eval run.
Args: upload_request (FileUploadRequest): Contains the files to upload and the workspace UUID.
Returns: FileUploadResponse: Contains presigned URLs and metadata to upload each file.
Raises: AymaraAPIError: If the organization is missing or file upload fails.
Example: POST /api/files { "workspace_uuid": "...", "files": [ {"local_file_path": "path/to/file1.csv"}, {"local_file_path": "path/to/file2.csv"} ] }
Body
Required
-
workspace_uuid
string | null -
files
array[object] Required List of files to upload.
Responses
-
200 application/json
OK
-
400 application/json
Bad Request
-
401 application/json
Unauthorized
-
403 application/json
Forbidden
-
404 application/json
Not Found
-
409 application/json
Conflict
-
422 application/json
Unprocessable Entity
-
429 application/json
Too Many Requests
-
500 application/json
Internal Server Error
-
503 application/json
Service Unavailable
POST
/v2/files
Python
import os
from aymara_ai import AymaraAI
client = AymaraAI(
api_key=os.environ.get("AYMARA_AI_API_KEY"), # This is the default and can be omitted
)
file = client.files.create(
files=[{}],
)
print(file.workspace_uuid)
curl \
--request POST 'https://api.aymara.ai/v2/files' \
--header "x-api-key: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"workspace_uuid":"string","files":[{"local_file_path":"string"}]}'
Request examples
{
"workspace_uuid": "string",
"files": [
{
"local_file_path": "string"
}
]
}
Response examples (200)
{
"workspace_uuid": "string",
"files": [
{
"local_file_path": "string",
"file_uuid": "string",
"file_url": "string",
"remote_file_path": "string"
}
]
}
Response examples (400)
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
Response examples (401)
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
Response examples (403)
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
Response examples (404)
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
Response examples (409)
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
Response examples (422)
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
Response examples (429)
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
Response examples (500)
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}
Response examples (503)
{
"error": {
"code": "auth.invalid_key",
"message": "string",
"details": {}
},
"request_id": ""
}