curl --request POST \
--url https://api.rafftechnologies.com/api/v1/apps/services \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Project-ID: <x-project-id>' \
--data '
{
"name": "<string>",
"description": "<string>",
"image_ref": "<string>",
"repo_full_name": "<string>",
"github_installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"start_command": "<string>",
"tier_id": 123,
"replicas": 3,
"autoscaling_enabled": true,
"min_replicas": 123,
"max_replicas": 5,
"scale_to_zero": true,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"cron_concurrency": "forbid",
"region": "<string>",
"deploy_now": true,
"env_vars": [
{
"key": "<string>",
"value": "<string>",
"is_secret": true,
"scope": "runtime"
}
],
"link_database_id": "<string>"
}
'import requests
url = "https://api.rafftechnologies.com/api/v1/apps/services"
payload = {
"name": "<string>",
"description": "<string>",
"image_ref": "<string>",
"repo_full_name": "<string>",
"github_installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"start_command": "<string>",
"tier_id": 123,
"replicas": 3,
"autoscaling_enabled": True,
"min_replicas": 123,
"max_replicas": 5,
"scale_to_zero": True,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"cron_concurrency": "forbid",
"region": "<string>",
"deploy_now": True,
"env_vars": [
{
"key": "<string>",
"value": "<string>",
"is_secret": True,
"scope": "runtime"
}
],
"link_database_id": "<string>"
}
headers = {
"X-Project-ID": "<x-project-id>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Project-ID': '<x-project-id>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
image_ref: '<string>',
repo_full_name: '<string>',
github_installation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
repo_branch: '<string>',
repo_root_dir: '<string>',
dockerfile_path: '<string>',
start_command: '<string>',
tier_id: 123,
replicas: 3,
autoscaling_enabled: true,
min_replicas: 123,
max_replicas: 5,
scale_to_zero: true,
http_port: 123,
health_check_path: '<string>',
cron_schedule: '<string>',
cron_timezone: '<string>',
cron_concurrency: 'forbid',
region: '<string>',
deploy_now: true,
env_vars: [{key: '<string>', value: '<string>', is_secret: true, scope: 'runtime'}],
link_database_id: '<string>'
})
};
fetch('https://api.rafftechnologies.com/api/v1/apps/services', 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.rafftechnologies.com/api/v1/apps/services",
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>',
'image_ref' => '<string>',
'repo_full_name' => '<string>',
'github_installation_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'repo_branch' => '<string>',
'repo_root_dir' => '<string>',
'dockerfile_path' => '<string>',
'start_command' => '<string>',
'tier_id' => 123,
'replicas' => 3,
'autoscaling_enabled' => true,
'min_replicas' => 123,
'max_replicas' => 5,
'scale_to_zero' => true,
'http_port' => 123,
'health_check_path' => '<string>',
'cron_schedule' => '<string>',
'cron_timezone' => '<string>',
'cron_concurrency' => 'forbid',
'region' => '<string>',
'deploy_now' => true,
'env_vars' => [
[
'key' => '<string>',
'value' => '<string>',
'is_secret' => true,
'scope' => 'runtime'
]
],
'link_database_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Project-ID: <x-project-id>"
],
]);
$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.rafftechnologies.com/api/v1/apps/services"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image_ref\": \"<string>\",\n \"repo_full_name\": \"<string>\",\n \"github_installation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 3,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 5,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"cron_concurrency\": \"forbid\",\n \"region\": \"<string>\",\n \"deploy_now\": true,\n \"env_vars\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"is_secret\": true,\n \"scope\": \"runtime\"\n }\n ],\n \"link_database_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Project-ID", "<x-project-id>")
req.Header.Add("X-API-Key", "<api-key>")
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.rafftechnologies.com/api/v1/apps/services")
.header("X-Project-ID", "<x-project-id>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image_ref\": \"<string>\",\n \"repo_full_name\": \"<string>\",\n \"github_installation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 3,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 5,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"cron_concurrency\": \"forbid\",\n \"region\": \"<string>\",\n \"deploy_now\": true,\n \"env_vars\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"is_secret\": true,\n \"scope\": \"runtime\"\n }\n ],\n \"link_database_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/apps/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Project-ID"] = '<x-project-id>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image_ref\": \"<string>\",\n \"repo_full_name\": \"<string>\",\n \"github_installation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 3,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 5,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"cron_concurrency\": \"forbid\",\n \"region\": \"<string>\",\n \"deploy_now\": true,\n \"env_vars\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"is_secret\": true,\n \"scope\": \"runtime\"\n }\n ],\n \"link_database_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"service": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"service_type": "web",
"source_type": "git",
"builder": "buildpacks",
"repo_full_name": "<string>",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"image_ref": "<string>",
"start_command": "<string>",
"tier_id": 123,
"tier_name": "<string>",
"replicas": 123,
"autoscaling_enabled": true,
"min_replicas": 123,
"max_replicas": 123,
"autoscaling_metric": "<string>",
"autoscaling_target": 123,
"scale_to_zero": true,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"cron_concurrency": "forbid",
"region": "<string>",
"url": "<string>",
"internal_host": "<string>",
"primary_domain": "<string>",
"status": "pending",
"status_message": "<string>",
"paused_by_cap": true,
"billing_type": "payg",
"previews_enabled": true,
"preview_count": 123,
"max_previews": 123,
"waiting_for_database": true,
"github_status": "",
"github_login": "<string>",
"github_settings_url": "<string>",
"current_deployment_id": "<string>",
"current_deployment_number": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "Payment Required",
"message": "Insufficient balance for subscription"
}{
"error": "Billing validation failed",
"reason": "banned",
"message": "Payment failed. Please update your payment method."
}Create app service
Create an app service. Provisioning is asynchronous — the service is
created in status pending and moves through building and
deploying to live; poll GET /api/v1/apps/services/{service_id}
for progress.
Choose a service_type: web (public HTTPS URL), private
(in-cluster only), worker (long-running, no URL), cron
(scheduled), or job (one-off). Pick a source_type: git (a
connected GitHub repo), image (a prebuilt image), template (a
starter), or compose. Deploy code afterwards with a source upload
and a deployment, or set deploy_now for image sources.
curl --request POST \
--url https://api.rafftechnologies.com/api/v1/apps/services \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Project-ID: <x-project-id>' \
--data '
{
"name": "<string>",
"description": "<string>",
"image_ref": "<string>",
"repo_full_name": "<string>",
"github_installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"start_command": "<string>",
"tier_id": 123,
"replicas": 3,
"autoscaling_enabled": true,
"min_replicas": 123,
"max_replicas": 5,
"scale_to_zero": true,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"cron_concurrency": "forbid",
"region": "<string>",
"deploy_now": true,
"env_vars": [
{
"key": "<string>",
"value": "<string>",
"is_secret": true,
"scope": "runtime"
}
],
"link_database_id": "<string>"
}
'import requests
url = "https://api.rafftechnologies.com/api/v1/apps/services"
payload = {
"name": "<string>",
"description": "<string>",
"image_ref": "<string>",
"repo_full_name": "<string>",
"github_installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"start_command": "<string>",
"tier_id": 123,
"replicas": 3,
"autoscaling_enabled": True,
"min_replicas": 123,
"max_replicas": 5,
"scale_to_zero": True,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"cron_concurrency": "forbid",
"region": "<string>",
"deploy_now": True,
"env_vars": [
{
"key": "<string>",
"value": "<string>",
"is_secret": True,
"scope": "runtime"
}
],
"link_database_id": "<string>"
}
headers = {
"X-Project-ID": "<x-project-id>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Project-ID': '<x-project-id>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
image_ref: '<string>',
repo_full_name: '<string>',
github_installation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
repo_branch: '<string>',
repo_root_dir: '<string>',
dockerfile_path: '<string>',
start_command: '<string>',
tier_id: 123,
replicas: 3,
autoscaling_enabled: true,
min_replicas: 123,
max_replicas: 5,
scale_to_zero: true,
http_port: 123,
health_check_path: '<string>',
cron_schedule: '<string>',
cron_timezone: '<string>',
cron_concurrency: 'forbid',
region: '<string>',
deploy_now: true,
env_vars: [{key: '<string>', value: '<string>', is_secret: true, scope: 'runtime'}],
link_database_id: '<string>'
})
};
fetch('https://api.rafftechnologies.com/api/v1/apps/services', 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.rafftechnologies.com/api/v1/apps/services",
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>',
'image_ref' => '<string>',
'repo_full_name' => '<string>',
'github_installation_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'repo_branch' => '<string>',
'repo_root_dir' => '<string>',
'dockerfile_path' => '<string>',
'start_command' => '<string>',
'tier_id' => 123,
'replicas' => 3,
'autoscaling_enabled' => true,
'min_replicas' => 123,
'max_replicas' => 5,
'scale_to_zero' => true,
'http_port' => 123,
'health_check_path' => '<string>',
'cron_schedule' => '<string>',
'cron_timezone' => '<string>',
'cron_concurrency' => 'forbid',
'region' => '<string>',
'deploy_now' => true,
'env_vars' => [
[
'key' => '<string>',
'value' => '<string>',
'is_secret' => true,
'scope' => 'runtime'
]
],
'link_database_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Project-ID: <x-project-id>"
],
]);
$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.rafftechnologies.com/api/v1/apps/services"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image_ref\": \"<string>\",\n \"repo_full_name\": \"<string>\",\n \"github_installation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 3,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 5,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"cron_concurrency\": \"forbid\",\n \"region\": \"<string>\",\n \"deploy_now\": true,\n \"env_vars\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"is_secret\": true,\n \"scope\": \"runtime\"\n }\n ],\n \"link_database_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Project-ID", "<x-project-id>")
req.Header.Add("X-API-Key", "<api-key>")
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.rafftechnologies.com/api/v1/apps/services")
.header("X-Project-ID", "<x-project-id>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image_ref\": \"<string>\",\n \"repo_full_name\": \"<string>\",\n \"github_installation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 3,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 5,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"cron_concurrency\": \"forbid\",\n \"region\": \"<string>\",\n \"deploy_now\": true,\n \"env_vars\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"is_secret\": true,\n \"scope\": \"runtime\"\n }\n ],\n \"link_database_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/apps/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Project-ID"] = '<x-project-id>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image_ref\": \"<string>\",\n \"repo_full_name\": \"<string>\",\n \"github_installation_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 3,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 5,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"cron_concurrency\": \"forbid\",\n \"region\": \"<string>\",\n \"deploy_now\": true,\n \"env_vars\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"is_secret\": true,\n \"scope\": \"runtime\"\n }\n ],\n \"link_database_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"service": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"service_type": "web",
"source_type": "git",
"builder": "buildpacks",
"repo_full_name": "<string>",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"image_ref": "<string>",
"start_command": "<string>",
"tier_id": 123,
"tier_name": "<string>",
"replicas": 123,
"autoscaling_enabled": true,
"min_replicas": 123,
"max_replicas": 123,
"autoscaling_metric": "<string>",
"autoscaling_target": 123,
"scale_to_zero": true,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"cron_concurrency": "forbid",
"region": "<string>",
"url": "<string>",
"internal_host": "<string>",
"primary_domain": "<string>",
"status": "pending",
"status_message": "<string>",
"paused_by_cap": true,
"billing_type": "payg",
"previews_enabled": true,
"preview_count": 123,
"max_previews": 123,
"waiting_for_database": true,
"github_status": "",
"github_login": "<string>",
"github_settings_url": "<string>",
"current_deployment_id": "<string>",
"current_deployment_number": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "Payment Required",
"message": "Insufficient balance for subscription"
}{
"error": "Billing validation failed",
"reason": "banned",
"message": "Payment failed. Please update your payment method."
}Authorizations
Headers
Body
image runs image_ref (the builder is image); use it for a
Docker image and for a template, with the template's image_ref,
http_port, env and health_check_path from
List app templates.
git builds a GitHub repository. console builds source you
upload (Request source upload,
then create a deployment). template and compose are labels
only and build like console.
image, git, console, template, compose For source_type git: the id of a GitHub connection, from
List GitHub connections.
The API key's owner must have used Continue with GitHub on
the Raff create page in the last 7 days, and their GitHub account
must see the repository; otherwise the create is refused.