curl --request POST \
--url https://api.replicas.dev/v1/environments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"scope": "org",
"source_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"system_prompt": "<string>",
"mobile_testing_enabled": false
}
'import requests
url = "https://api.replicas.dev/v1/environments"
payload = {
"name": "<string>",
"description": "<string>",
"scope": "org",
"source_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"system_prompt": "<string>",
"mobile_testing_enabled": False
}
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>',
description: '<string>',
scope: 'org',
source_environment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
repository_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
repository_set_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
system_prompt: '<string>',
mobile_testing_enabled: false
})
};
fetch('https://api.replicas.dev/v1/environments', 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/environments",
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>',
'description' => '<string>',
'scope' => 'org',
'source_environment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'repository_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'repository_set_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'system_prompt' => '<string>',
'mobile_testing_enabled' => false
]),
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/environments"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"org\",\n \"source_environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_set_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"system_prompt\": \"<string>\",\n \"mobile_testing_enabled\": false\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/environments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"org\",\n \"source_environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_set_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"system_prompt\": \"<string>\",\n \"mobile_testing_enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replicas.dev/v1/environments")
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 \"description\": \"<string>\",\n \"scope\": \"org\",\n \"source_environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_set_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"system_prompt\": \"<string>\",\n \"mobile_testing_enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"is_global": true,
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"system_prompt": "<string>",
"mobile_testing_enabled": true,
"personal_preferences": "<string>",
"source_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"variable_count": 123,
"file_count": 123,
"skill_count": 123,
"mcp_count": 123,
"access": {
"can_write": true,
"can_read": true
}
}
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"error": "<string>",
"details": "<string>",
"code": "<string>"
}Create Environment
Creates a new shared or personal environment. Plain shared environments use the organization’s new-environment access default; a non-admin may create one only when that default grants Write. A shared copy requires Write on its shared source and inherits the source access policy. A personal overlay requires Read on its shared source, remains visible only to its owner, and keeps inherited configuration locked. repository_id and repository_set_id are mutually exclusive.
curl --request POST \
--url https://api.replicas.dev/v1/environments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"scope": "org",
"source_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"system_prompt": "<string>",
"mobile_testing_enabled": false
}
'import requests
url = "https://api.replicas.dev/v1/environments"
payload = {
"name": "<string>",
"description": "<string>",
"scope": "org",
"source_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"system_prompt": "<string>",
"mobile_testing_enabled": False
}
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>',
description: '<string>',
scope: 'org',
source_environment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
repository_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
repository_set_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
system_prompt: '<string>',
mobile_testing_enabled: false
})
};
fetch('https://api.replicas.dev/v1/environments', 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/environments",
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>',
'description' => '<string>',
'scope' => 'org',
'source_environment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'repository_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'repository_set_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'system_prompt' => '<string>',
'mobile_testing_enabled' => false
]),
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/environments"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"org\",\n \"source_environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_set_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"system_prompt\": \"<string>\",\n \"mobile_testing_enabled\": false\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/environments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"scope\": \"org\",\n \"source_environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_set_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"system_prompt\": \"<string>\",\n \"mobile_testing_enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.replicas.dev/v1/environments")
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 \"description\": \"<string>\",\n \"scope\": \"org\",\n \"source_environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repository_set_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"system_prompt\": \"<string>\",\n \"mobile_testing_enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"is_global": true,
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"system_prompt": "<string>",
"mobile_testing_enabled": true,
"personal_preferences": "<string>",
"source_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"variable_count": 123,
"file_count": 123,
"skill_count": 123,
"mcp_count": 123,
"access": {
"can_write": true,
"can_read": true
}
}
}{
"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
API key authentication. Obtain your API key from the Replicas dashboard under Organization → Settings → API Keys.
Body
Request body for creating a new environment.
Human-readable name (must be unique within the selected scope)
Optional description
org creates a team environment. user creates a personal environment visible only to the authenticated user.
org, user Optional shared source. Shared environments create an independent copy with the source access policy. Personal environments create a private overlay and keep inherited config locked.
Bind to this repository. Mutually exclusive with repository_set_id.
Bind to this repository set. Mutually exclusive with repository_id.
Optional system prompt prepended to the coding agent.
Enable mobile testing. Only valid for team environments on trial, Team, and Enterprise plans; otherwise returns PLAN_UPGRADE_REQUIRED.
Response
Environment created
An environment — the config bundle workspaces are created from. Holds an optional repository binding plus the runtime variables, files, skills, MCPs, and warm hook applied to every workspace built from it. Every organization has a singleton Global environment (is_global: true) whose values are layered onto every other environment. Personal environments have user_id set and are visible only to their owner. Source-backed personal environments expose source-derived repository binding and system prompt values while keeping the source link in source_environment_id.
Show child attributes
Show child attributes