Add repository
curl --request POST \
--url https://api.replicas.dev/v1/repositories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<string>",
"provider": "github",
"default_branch": "<string>",
"github_installation_id": 123,
"github_repository_id": 123,
"gitlab_project_id": 123,
"gitlab_path_with_namespace": "<string>"
}
'import requests
url = "https://api.replicas.dev/v1/repositories"
payload = {
"name": "<string>",
"url": "<string>",
"provider": "github",
"default_branch": "<string>",
"github_installation_id": 123,
"github_repository_id": 123,
"gitlab_project_id": 123,
"gitlab_path_with_namespace": "<string>"
}
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({
name: '<string>',
url: '<string>',
provider: 'github',
default_branch: '<string>',
github_installation_id: 123,
github_repository_id: 123,
gitlab_project_id: 123,
gitlab_path_with_namespace: '<string>'
})
};
fetch('https://api.replicas.dev/v1/repositories', 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.replicas.dev/v1/repositories",
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([
'name' => '<string>',
'url' => '<string>',
'provider' => 'github',
'default_branch' => '<string>',
'github_installation_id' => 123,
'github_repository_id' => 123,
'gitlab_project_id' => 123,
'gitlab_path_with_namespace' => '<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://api.replicas.dev/v1/repositories"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"provider\": \"github\",\n \"default_branch\": \"<string>\",\n \"github_installation_id\": 123,\n \"github_repository_id\": 123,\n \"gitlab_project_id\": 123,\n \"gitlab_path_with_namespace\": \"<string>\"\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.replicas.dev/v1/repositories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"provider\": \"github\",\n \"default_branch\": \"<string>\",\n \"github_installation_id\": 123,\n \"github_repository_id\": 123,\n \"gitlab_project_id\": 123,\n \"gitlab_path_with_namespace\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replicas.dev/v1/repositories")
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 \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"provider\": \"github\",\n \"default_branch\": \"<string>\",\n \"github_installation_id\": 123,\n \"github_repository_id\": 123,\n \"gitlab_project_id\": 123,\n \"gitlab_path_with_namespace\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"repository": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"url": "<string>",
"default_branch": "<string>"
}
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}Repositories
Add repository
Connects a repository. GitHub repositories must come from List connectable GitHub repositories. Also creates a default environment for it. Requires an organization admin’s personal API key.
POST
/
v1
/
repositories
Add repository
curl --request POST \
--url https://api.replicas.dev/v1/repositories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<string>",
"provider": "github",
"default_branch": "<string>",
"github_installation_id": 123,
"github_repository_id": 123,
"gitlab_project_id": 123,
"gitlab_path_with_namespace": "<string>"
}
'import requests
url = "https://api.replicas.dev/v1/repositories"
payload = {
"name": "<string>",
"url": "<string>",
"provider": "github",
"default_branch": "<string>",
"github_installation_id": 123,
"github_repository_id": 123,
"gitlab_project_id": 123,
"gitlab_path_with_namespace": "<string>"
}
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({
name: '<string>',
url: '<string>',
provider: 'github',
default_branch: '<string>',
github_installation_id: 123,
github_repository_id: 123,
gitlab_project_id: 123,
gitlab_path_with_namespace: '<string>'
})
};
fetch('https://api.replicas.dev/v1/repositories', 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.replicas.dev/v1/repositories",
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([
'name' => '<string>',
'url' => '<string>',
'provider' => 'github',
'default_branch' => '<string>',
'github_installation_id' => 123,
'github_repository_id' => 123,
'gitlab_project_id' => 123,
'gitlab_path_with_namespace' => '<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://api.replicas.dev/v1/repositories"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"provider\": \"github\",\n \"default_branch\": \"<string>\",\n \"github_installation_id\": 123,\n \"github_repository_id\": 123,\n \"gitlab_project_id\": 123,\n \"gitlab_path_with_namespace\": \"<string>\"\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.replicas.dev/v1/repositories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"provider\": \"github\",\n \"default_branch\": \"<string>\",\n \"github_installation_id\": 123,\n \"github_repository_id\": 123,\n \"gitlab_project_id\": 123,\n \"gitlab_path_with_namespace\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replicas.dev/v1/repositories")
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 \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"provider\": \"github\",\n \"default_branch\": \"<string>\",\n \"github_installation_id\": 123,\n \"github_repository_id\": 123,\n \"gitlab_project_id\": 123,\n \"gitlab_path_with_namespace\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"repository": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"url": "<string>",
"default_branch": "<string>"
}
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}Authorizations
Organization or personal API key from Settings → API Keys.
Headers
API version. 2026-10-07 returns snake_case responses. See versioning.
Available options:
2026-10-07 Body
application/json
Response
Success
A repository available to the organization
Show child attributes
Show child attributes
⌘I