curl --request POST \
--url https://api.tryreplicas.com/v1/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"repository_branches": {},
"config": {
"capabilities": {
"pr_followups": true,
"read_only_contents": true
},
"preferences": {
"keep_open_on_pr_merge": false,
"keep_open_on_pr_close": false
},
"provisioning_error": {
"message": "<string>"
}
}
}
'import requests
url = "https://api.tryreplicas.com/v1/workspaces"
payload = {
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"repository_branches": {},
"config": {
"capabilities": {
"pr_followups": True,
"read_only_contents": True
},
"preferences": {
"keep_open_on_pr_merge": False,
"keep_open_on_pr_close": False
},
"provisioning_error": { "message": "<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({
environment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
repository_branches: {},
config: {
capabilities: {pr_followups: true, read_only_contents: true},
preferences: {keep_open_on_pr_merge: false, keep_open_on_pr_close: false},
provisioning_error: {message: '<string>'}
}
})
};
fetch('https://api.tryreplicas.com/v1/workspaces', 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.tryreplicas.com/v1/workspaces",
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([
'environment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'repository_branches' => [
],
'config' => [
'capabilities' => [
'pr_followups' => true,
'read_only_contents' => true
],
'preferences' => [
'keep_open_on_pr_merge' => false,
'keep_open_on_pr_close' => false
],
'provisioning_error' => [
'message' => '<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.tryreplicas.com/v1/workspaces"
payload := strings.NewReader("{\n \"environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"repository_branches\": {},\n \"config\": {\n \"capabilities\": {\n \"pr_followups\": true,\n \"read_only_contents\": true\n },\n \"preferences\": {\n \"keep_open_on_pr_merge\": false,\n \"keep_open_on_pr_close\": false\n },\n \"provisioning_error\": {\n \"message\": \"<string>\"\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://api.tryreplicas.com/v1/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"repository_branches\": {},\n \"config\": {\n \"capabilities\": {\n \"pr_followups\": true,\n \"read_only_contents\": true\n },\n \"preferences\": {\n \"keep_open_on_pr_merge\": false,\n \"keep_open_on_pr_close\": false\n },\n \"provisioning_error\": {\n \"message\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryreplicas.com/v1/workspaces")
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 \"environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"repository_branches\": {},\n \"config\": {\n \"capabilities\": {\n \"pr_followups\": true,\n \"read_only_contents\": true\n },\n \"preferences\": {\n \"keep_open_on_pr_merge\": false,\n \"keep_open_on_pr_close\": false\n },\n \"provisioning_error\": {\n \"message\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"source_link": {
"url": "<string>",
"label": "<string>"
}
}
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}Create Dashboard Workspace
Creates a workspace from an environment for the authenticated dashboard user. repository_branches can override the starting branch for repositories in that environment; repositories without an override use their configured default branch.
curl --request POST \
--url https://api.tryreplicas.com/v1/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"repository_branches": {},
"config": {
"capabilities": {
"pr_followups": true,
"read_only_contents": true
},
"preferences": {
"keep_open_on_pr_merge": false,
"keep_open_on_pr_close": false
},
"provisioning_error": {
"message": "<string>"
}
}
}
'import requests
url = "https://api.tryreplicas.com/v1/workspaces"
payload = {
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"repository_branches": {},
"config": {
"capabilities": {
"pr_followups": True,
"read_only_contents": True
},
"preferences": {
"keep_open_on_pr_merge": False,
"keep_open_on_pr_close": False
},
"provisioning_error": { "message": "<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({
environment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
repository_branches: {},
config: {
capabilities: {pr_followups: true, read_only_contents: true},
preferences: {keep_open_on_pr_merge: false, keep_open_on_pr_close: false},
provisioning_error: {message: '<string>'}
}
})
};
fetch('https://api.tryreplicas.com/v1/workspaces', 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.tryreplicas.com/v1/workspaces",
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([
'environment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'repository_branches' => [
],
'config' => [
'capabilities' => [
'pr_followups' => true,
'read_only_contents' => true
],
'preferences' => [
'keep_open_on_pr_merge' => false,
'keep_open_on_pr_close' => false
],
'provisioning_error' => [
'message' => '<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.tryreplicas.com/v1/workspaces"
payload := strings.NewReader("{\n \"environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"repository_branches\": {},\n \"config\": {\n \"capabilities\": {\n \"pr_followups\": true,\n \"read_only_contents\": true\n },\n \"preferences\": {\n \"keep_open_on_pr_merge\": false,\n \"keep_open_on_pr_close\": false\n },\n \"provisioning_error\": {\n \"message\": \"<string>\"\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://api.tryreplicas.com/v1/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"repository_branches\": {},\n \"config\": {\n \"capabilities\": {\n \"pr_followups\": true,\n \"read_only_contents\": true\n },\n \"preferences\": {\n \"keep_open_on_pr_merge\": false,\n \"keep_open_on_pr_close\": false\n },\n \"provisioning_error\": {\n \"message\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryreplicas.com/v1/workspaces")
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 \"environment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"repository_branches\": {},\n \"config\": {\n \"capabilities\": {\n \"pr_followups\": true,\n \"read_only_contents\": true\n },\n \"preferences\": {\n \"keep_open_on_pr_merge\": false,\n \"keep_open_on_pr_close\": false\n },\n \"provisioning_error\": {\n \"message\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"source_link": {
"url": "<string>",
"label": "<string>"
}
}
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}Authorizations
Logged-in user-session JWT authentication for first-party clients. Org-scoped requests also require the Replicas-Org-Id header. User JWTs cannot create workspaces with POST /v1/replica.
Body
Dashboard workspace creation request.
Environment whose repository binding and configuration the workspace uses.
Optional workspace name. A placeholder is generated when omitted.
Optional starting-branch overrides keyed by repository UUID. Every repository must belong to the selected environment. Omitted repositories use their configured default branch.
Show child attributes
Show child attributes
Workspace behavior configuration. Missing capabilities and preferences default to disabled.
Show child attributes
Show child attributes
small, large Response
Workspace created
A workspace returned by the dashboard workspace list.
Show child attributes
Show child attributes