Record that a repo moved
curl --request PUT \
--url https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_id": "<string>"
}
'import requests
url = "https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to"
payload = { "target_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_id: '<string>'})
};
fetch('https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to', 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://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'target_id' => '<string>'
]),
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://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to"
payload := strings.NewReader("{\n \"target_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"url": "<string>",
"short_name": "<string>",
"provider": "github",
"repo_id": "<string>",
"vcs_instance": "<string>",
"namespace_path": [
"<string>"
],
"additional_info": {},
"description": "<string>",
"tags": {},
"_links": {},
"moved_to": "<string>",
"moved_at": 123,
"moved_by": "<string>",
"archived_at": 123,
"archived_by": "<string>",
"moved_from": [
"<string>"
]
}{
"message": "A repo cannot move to itself"
}{
"message": "Only an org admin can record repo moves"
}{
"message": "Repo not found"
}Record that a repo moved
Beta — the Repo moves feature is in beta. Requests from organizations without it enabled receive 403 Forbidden.
Record that the repo with internal id {repo} moved to the repo target_id, for example after moving it to a new VCS host. The target’s builds, deployments and live artifacts then include this repo’s. Nothing reported is changed.
The moved repo is left out of the repo list, its filter options and a lookup by name alone; a lookup by name and provider, or by id, still finds it. The repos that moved to this one move to the target too, so a move is never more than one hop; undoing this move later returns only this repo. Moving to a repo that has itself moved is refused. Undo with DELETE on the same path.
PUT
/
repos
/
{org}
/
{repo}
/
moved-to
Record that a repo moved
curl --request PUT \
--url https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_id": "<string>"
}
'import requests
url = "https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to"
payload = { "target_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_id: '<string>'})
};
fetch('https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to', 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://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'target_id' => '<string>'
]),
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://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to"
payload := strings.NewReader("{\n \"target_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.kosli.com/api/v2/repos/{org}/{repo}/moved-to")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"url": "<string>",
"short_name": "<string>",
"provider": "github",
"repo_id": "<string>",
"vcs_instance": "<string>",
"namespace_path": [
"<string>"
],
"additional_info": {},
"description": "<string>",
"tags": {},
"_links": {},
"moved_to": "<string>",
"moved_at": 123,
"moved_by": "<string>",
"archived_at": 123,
"archived_by": "<string>",
"moved_from": [
"<string>"
]
}{
"message": "A repo cannot move to itself"
}{
"message": "Only an org admin can record repo moves"
}{
"message": "Repo not found"
}Authorizations
Body
application/json
Response
Successful Response