Stage bundled files for upload
curl --request POST \
--url https://www.asteragents.com/api/skills/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"skillId": 12,
"files": [
{
"fileName": "scripts/generate_report.py",
"contentType": "text/x-python"
}
]
}
'import requests
url = "https://www.asteragents.com/api/skills/upload"
payload = {
"skillId": 12,
"files": [
{
"fileName": "scripts/generate_report.py",
"contentType": "text/x-python"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
skillId: 12,
files: [{fileName: 'scripts/generate_report.py', contentType: 'text/x-python'}]
})
};
fetch('https://www.asteragents.com/api/skills/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.asteragents.com/api/skills/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'skillId' => 12,
'files' => [
[
'fileName' => 'scripts/generate_report.py',
'contentType' => 'text/x-python'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.asteragents.com/api/skills/upload"
payload := strings.NewReader("{\n \"skillId\": 12,\n \"files\": [\n {\n \"fileName\": \"scripts/generate_report.py\",\n \"contentType\": \"text/x-python\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.asteragents.com/api/skills/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"skillId\": 12,\n \"files\": [\n {\n \"fileName\": \"scripts/generate_report.py\",\n \"contentType\": \"text/x-python\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.asteragents.com/api/skills/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"skillId\": 12,\n \"files\": [\n {\n \"fileName\": \"scripts/generate_report.py\",\n \"contentType\": \"text/x-python\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"files": [
{
"fileName": "<string>",
"fileKey": "<string>",
"contentType": "<string>",
"uploadUrl": "<string>"
}
]
}{
"error": "Internal Server Error"
}Skills API
Stage bundled files for upload
Get a presigned upload URL for each file you want to add to or replace in a skill. This changes nothing on its own.
Three-step upload:
- Call this endpoint with the file names
- PUT each file’s bytes to its
uploadUrl(expires in 10 minutes), with the sameContent-Type - Call
PUT /skills/manage?id={skillId}with the returned files inaddto publish them as one new version
Files staged but never sent to PUT /skills/manage never go live.
Limits:
- Maximum 100 files per skill
- File names may include subdirectories (e.g.
scripts/setup.py) and are sanitized to prevent path traversal - SKILL.md can’t be staged here — send it as
skillMdContentonPUT /skills/manage
POST
/
skills
/
upload
Stage bundled files for upload
curl --request POST \
--url https://www.asteragents.com/api/skills/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"skillId": 12,
"files": [
{
"fileName": "scripts/generate_report.py",
"contentType": "text/x-python"
}
]
}
'import requests
url = "https://www.asteragents.com/api/skills/upload"
payload = {
"skillId": 12,
"files": [
{
"fileName": "scripts/generate_report.py",
"contentType": "text/x-python"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
skillId: 12,
files: [{fileName: 'scripts/generate_report.py', contentType: 'text/x-python'}]
})
};
fetch('https://www.asteragents.com/api/skills/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.asteragents.com/api/skills/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'skillId' => 12,
'files' => [
[
'fileName' => 'scripts/generate_report.py',
'contentType' => 'text/x-python'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.asteragents.com/api/skills/upload"
payload := strings.NewReader("{\n \"skillId\": 12,\n \"files\": [\n {\n \"fileName\": \"scripts/generate_report.py\",\n \"contentType\": \"text/x-python\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.asteragents.com/api/skills/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"skillId\": 12,\n \"files\": [\n {\n \"fileName\": \"scripts/generate_report.py\",\n \"contentType\": \"text/x-python\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.asteragents.com/api/skills/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"skillId\": 12,\n \"files\": [\n {\n \"fileName\": \"scripts/generate_report.py\",\n \"contentType\": \"text/x-python\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"files": [
{
"fileName": "<string>",
"fileKey": "<string>",
"contentType": "<string>",
"uploadUrl": "<string>"
}
]
}{
"error": "Internal Server Error"
}