Save a task to GitHub
curl --request POST \
--url https://api.runaether.dev/tasks/{taskID}/repository \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"installation_id": 2,
"kind": "create",
"name": "<string>",
"private": true
}
'import requests
url = "https://api.runaether.dev/tasks/{taskID}/repository"
payload = {
"installation_id": 2,
"kind": "create",
"name": "<string>",
"private": True
}
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({installation_id: 2, kind: 'create', name: '<string>', private: true})
};
fetch('https://api.runaether.dev/tasks/{taskID}/repository', 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://api.runaether.dev/tasks/{taskID}/repository",
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([
'installation_id' => 2,
'kind' => 'create',
'name' => '<string>',
'private' => true
]),
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://api.runaether.dev/tasks/{taskID}/repository"
payload := strings.NewReader("{\n \"installation_id\": 2,\n \"kind\": \"create\",\n \"name\": \"<string>\",\n \"private\": true\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://api.runaether.dev/tasks/{taskID}/repository")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"installation_id\": 2,\n \"kind\": \"create\",\n \"name\": \"<string>\",\n \"private\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/tasks/{taskID}/repository")
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 \"installation_id\": 2,\n \"kind\": \"create\",\n \"name\": \"<string>\",\n \"private\": true\n}"
response = http.request(request)
puts response.read_body{
"binding": {
"base_branch": "<string>",
"bound_at": "2023-11-07T05:31:56Z"
},
"outcome": {
"head_sha": "<string>",
"kind": "published",
"rebased": true,
"uncommitted_changes": true
},
"repository": {
"default_branch": "<string>",
"github_repo_id": 4503599627370496,
"link": {
"installation_id": 4503599627370496,
"state": "connected"
},
"name": "<string>",
"owner": "<string>",
"url": "<string>"
}
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Tasks
Save a task to GitHub
Gives a task with no repository one: the project gains the repository the body names (created under an installation's account, picked, or the project's own), the task is bound to it, and its workspace gives the task's history a home there: as the repository's first history when it has none, else replayed onto its default branch, with a conflict left to the agent (the outcome says which). A step a previous save completed is skipped; a retry resumes at the one that failed.
Use this tool when you need to:
- Give the work of a task in a project with no repository a GitHub repository
Examples:
- POST /tasks/{taskID}/repository {"kind": "create", "installation_id": 12345678, "name": "weather-app", "private": true}
Hints:
- taskID is the task's uuid.
- Use downloadTask instead to take the work out as a zip without GitHub.
- Restricted to the task's creator or an admin or owner of its organization, through a web session, an API key or an agent host's grant, each acting as its user: another member is refused with 403 control_forbidden, a viewer or billing member with 403 org_role_insufficient, and a task the caller cannot see is 404.
- Only the task's creator saves with kind create or pick, since the save reaches GitHub as them; anyone else saves with kind project into the project's repository, and a create or pick is refused with 409 save_requires_task_creator, naming the creator.
- Refused for the task with 409 task_is_child (a child leaves through downloadTask), task_bound_at_creation, task_already_saved, task_not_started, task_creator_deleted, project_archived or workspace_gone, and then task_executing (save once the agent's turn ends) or save_in_progress (another save of the task is running).
- Refused for the workspace's history before anything is created or linked with 409 task_has_no_commits, task_branch_mismatch, task_rebase_in_progress (the agent finishes the rebase first) or task_file_too_large (a file over GitHub's 100 MB limit, named).
- Refused for the repository with 409 project_repository_differs or project_has_no_repository when the body does not match the project's repository, 409 repository_administration_not_granted, repository_owner_not_caller, repository_create_rejected or repository_create_forbidden for GitHub's refusals of the create, 409 repository_created_not_linked, naming the repository, when the project's link to the repository the save created fails (pick it to finish), 409 repository_already_connected for a repository another project holds, 409 project_repo_disconnected for a project whose GitHub link is disconnected, 409 task_branch_is_default for a task branch named as the default branch, refused before a created or picked repository is linked (a repository the save created is named and left unlinked), 400 naming the default branch of a picked repository whose default branch has surrounding whitespace, 502 naming a repository GitHub created but answered with nothing the project can link (or saying its answer did not name the repository), 409 creator_github_access_missing when the creator's GitHub access does not reach the repository (or must be reconnected, for a saver who is not the creator), and 409 github_reconnect_required for a creator who must reconnect GitHub.
- Refused for the push or the replay with 409 working_tree_dirty (uncommitted changes a replay onto the repository's history would disturb), task_history_has_merges, task_branch_diverged, push_file_too_large, push_secret_detected or push_rejected, with GitHub's words; a step already done stays done.
- 502 when GitHub fails to answer and 503 when the workspace cannot be started.
POST
/
tasks
/
{taskID}
/
repository
Save a task to GitHub
curl --request POST \
--url https://api.runaether.dev/tasks/{taskID}/repository \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"installation_id": 2,
"kind": "create",
"name": "<string>",
"private": true
}
'import requests
url = "https://api.runaether.dev/tasks/{taskID}/repository"
payload = {
"installation_id": 2,
"kind": "create",
"name": "<string>",
"private": True
}
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({installation_id: 2, kind: 'create', name: '<string>', private: true})
};
fetch('https://api.runaether.dev/tasks/{taskID}/repository', 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://api.runaether.dev/tasks/{taskID}/repository",
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([
'installation_id' => 2,
'kind' => 'create',
'name' => '<string>',
'private' => true
]),
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://api.runaether.dev/tasks/{taskID}/repository"
payload := strings.NewReader("{\n \"installation_id\": 2,\n \"kind\": \"create\",\n \"name\": \"<string>\",\n \"private\": true\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://api.runaether.dev/tasks/{taskID}/repository")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"installation_id\": 2,\n \"kind\": \"create\",\n \"name\": \"<string>\",\n \"private\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/tasks/{taskID}/repository")
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 \"installation_id\": 2,\n \"kind\": \"create\",\n \"name\": \"<string>\",\n \"private\": true\n}"
response = http.request(request)
puts response.read_body{
"binding": {
"base_branch": "<string>",
"bound_at": "2023-11-07T05:31:56Z"
},
"outcome": {
"head_sha": "<string>",
"kind": "published",
"rebased": true,
"uncommitted_changes": true
},
"repository": {
"default_branch": "<string>",
"github_repo_id": 4503599627370496,
"link": {
"installation_id": 4503599627370496,
"state": "connected"
},
"name": "<string>",
"owner": "<string>",
"url": "<string>"
}
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "account_deleting",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Body
application/json