cURL
curl --request POST \ --url https://asteragents.com/api/skills/files \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "skillId": 123, "fileName": "scripts/generate_report.py", "contentType": "text/x-python", "fileSize": 123 } '
{ "success": true, "file": { "id": 5, "fileId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "fileName": "scripts/generate_report.py", "contentType": "text/x-python" }, "uploadUrl": "https://example.r2.cloudflarestorage.com/..." }
Create a file record and get a presigned URL for direct upload to cloud storage.
Two-step upload process:
uploadUrl
Limits:
JWT token from Clerk authentication.
Must be from a user with org:admin role.
org:admin
The skill to attach the file to
File name, may include subdirectory (e.g., scripts/setup.py)
scripts/setup.py
"scripts/generate_report.py"
MIME type of the file
"text/x-python"
File size in bytes (optional)
File record created with presigned upload URL
Show child attributes
Presigned URL for direct file upload (PUT). Expires in 10 minutes.