Create Preview
curl --request POST \
--url https://api.getfloo.com/v1/apps/{app_id}/previews \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>",
"commit_sha": "<string>",
"ref": "<string>",
"runtime": "<string>",
"framework": "<string>",
"data": {
"mode": "empty",
"seed_command": "<string>",
"sanitize_command": "<string>"
}
}
'import requests
url = "https://api.getfloo.com/v1/apps/{app_id}/previews"
payload = {
"branch": "<string>",
"commit_sha": "<string>",
"ref": "<string>",
"runtime": "<string>",
"framework": "<string>",
"data": {
"mode": "empty",
"seed_command": "<string>",
"sanitize_command": "<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({
branch: '<string>',
commit_sha: '<string>',
ref: '<string>',
runtime: '<string>',
framework: '<string>',
data: {mode: 'empty', seed_command: '<string>', sanitize_command: '<string>'}
})
};
fetch('https://api.getfloo.com/v1/apps/{app_id}/previews', 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.getfloo.com/v1/apps/{app_id}/previews",
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([
'branch' => '<string>',
'commit_sha' => '<string>',
'ref' => '<string>',
'runtime' => '<string>',
'framework' => '<string>',
'data' => [
'mode' => 'empty',
'seed_command' => '<string>',
'sanitize_command' => '<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.getfloo.com/v1/apps/{app_id}/previews"
payload := strings.NewReader("{\n \"branch\": \"<string>\",\n \"commit_sha\": \"<string>\",\n \"ref\": \"<string>\",\n \"runtime\": \"<string>\",\n \"framework\": \"<string>\",\n \"data\": {\n \"mode\": \"empty\",\n \"seed_command\": \"<string>\",\n \"sanitize_command\": \"<string>\"\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.getfloo.com/v1/apps/{app_id}/previews")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"<string>\",\n \"commit_sha\": \"<string>\",\n \"ref\": \"<string>\",\n \"runtime\": \"<string>\",\n \"framework\": \"<string>\",\n \"data\": {\n \"mode\": \"empty\",\n \"seed_command\": \"<string>\",\n \"sanitize_command\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getfloo.com/v1/apps/{app_id}/previews")
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 \"branch\": \"<string>\",\n \"commit_sha\": \"<string>\",\n \"ref\": \"<string>\",\n \"runtime\": \"<string>\",\n \"framework\": \"<string>\",\n \"data\": {\n \"mode\": \"empty\",\n \"seed_command\": \"<string>\",\n \"sanitize_command\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"source_branch": "<string>",
"pr_number": 123,
"url": "<string>",
"latest_deploy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"latest_deploy_status": "<string>",
"latest_commit_sha": "<string>",
"latest_cloud_run_service_names": [
"<string>"
],
"ttl_hours": 123,
"expires_at": "2023-11-07T05:31:56Z",
"resources": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"name": "<string>",
"status": "<string>",
"external_resource_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
],
"database_branches": [
{
"name": "<string>",
"source_env": "<string>",
"preview_slug": "<string>",
"resource_status": "<string>",
"hydration_mode": "<string>",
"reset_eligible": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"managed_service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schema_name": "<string>",
"role_name": "<string>",
"base_schema_name": "<string>",
"base_role_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"reset_blocked_reason": "<string>"
}
],
"managed_resource_branches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_type": "<string>",
"name": "<string>",
"resource_key": "<string>",
"source_env": "<string>",
"preview_slug": "<string>",
"resource_status": "<string>",
"hydration_mode": "<string>",
"reset_eligible": true,
"managed_service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schema_name": "<string>",
"role_name": "<string>",
"base_schema_name": "<string>",
"base_role_name": "<string>",
"database_id": "<string>",
"bucket_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"reset_blocked_reason": "<string>",
"dev_prod_untouched": true
}
]
}{
"detail": {
"code": "<string>",
"message": "<string>"
}
}previews
Create Preview
Create or refresh isolated preview infrastructure for a branch.
POST
/
v1
/
apps
/
{app_id}
/
previews
Create Preview
curl --request POST \
--url https://api.getfloo.com/v1/apps/{app_id}/previews \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>",
"commit_sha": "<string>",
"ref": "<string>",
"runtime": "<string>",
"framework": "<string>",
"data": {
"mode": "empty",
"seed_command": "<string>",
"sanitize_command": "<string>"
}
}
'import requests
url = "https://api.getfloo.com/v1/apps/{app_id}/previews"
payload = {
"branch": "<string>",
"commit_sha": "<string>",
"ref": "<string>",
"runtime": "<string>",
"framework": "<string>",
"data": {
"mode": "empty",
"seed_command": "<string>",
"sanitize_command": "<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({
branch: '<string>',
commit_sha: '<string>',
ref: '<string>',
runtime: '<string>',
framework: '<string>',
data: {mode: 'empty', seed_command: '<string>', sanitize_command: '<string>'}
})
};
fetch('https://api.getfloo.com/v1/apps/{app_id}/previews', 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.getfloo.com/v1/apps/{app_id}/previews",
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([
'branch' => '<string>',
'commit_sha' => '<string>',
'ref' => '<string>',
'runtime' => '<string>',
'framework' => '<string>',
'data' => [
'mode' => 'empty',
'seed_command' => '<string>',
'sanitize_command' => '<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.getfloo.com/v1/apps/{app_id}/previews"
payload := strings.NewReader("{\n \"branch\": \"<string>\",\n \"commit_sha\": \"<string>\",\n \"ref\": \"<string>\",\n \"runtime\": \"<string>\",\n \"framework\": \"<string>\",\n \"data\": {\n \"mode\": \"empty\",\n \"seed_command\": \"<string>\",\n \"sanitize_command\": \"<string>\"\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.getfloo.com/v1/apps/{app_id}/previews")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branch\": \"<string>\",\n \"commit_sha\": \"<string>\",\n \"ref\": \"<string>\",\n \"runtime\": \"<string>\",\n \"framework\": \"<string>\",\n \"data\": {\n \"mode\": \"empty\",\n \"seed_command\": \"<string>\",\n \"sanitize_command\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getfloo.com/v1/apps/{app_id}/previews")
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 \"branch\": \"<string>\",\n \"commit_sha\": \"<string>\",\n \"ref\": \"<string>\",\n \"runtime\": \"<string>\",\n \"framework\": \"<string>\",\n \"data\": {\n \"mode\": \"empty\",\n \"seed_command\": \"<string>\",\n \"sanitize_command\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"source_branch": "<string>",
"pr_number": 123,
"url": "<string>",
"latest_deploy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"latest_deploy_status": "<string>",
"latest_commit_sha": "<string>",
"latest_cloud_run_service_names": [
"<string>"
],
"ttl_hours": 123,
"expires_at": "2023-11-07T05:31:56Z",
"resources": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"name": "<string>",
"status": "<string>",
"external_resource_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
],
"database_branches": [
{
"name": "<string>",
"source_env": "<string>",
"preview_slug": "<string>",
"resource_status": "<string>",
"hydration_mode": "<string>",
"reset_eligible": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"managed_service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schema_name": "<string>",
"role_name": "<string>",
"base_schema_name": "<string>",
"base_role_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"reset_blocked_reason": "<string>"
}
],
"managed_resource_branches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_type": "<string>",
"name": "<string>",
"resource_key": "<string>",
"source_env": "<string>",
"preview_slug": "<string>",
"resource_status": "<string>",
"hydration_mode": "<string>",
"reset_eligible": true,
"managed_service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schema_name": "<string>",
"role_name": "<string>",
"base_schema_name": "<string>",
"base_role_name": "<string>",
"database_id": "<string>",
"bucket_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"reset_blocked_reason": "<string>",
"dev_prod_untouched": true
}
]
}{
"detail": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
A floo_ API key.
Headers
Organization to act in; defaults to the one joined most recently.
Path Parameters
Body
application/json
Response
Successful Response
Preview environment detail.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes