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>",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"start_command": "<string>",
"tier_id": 123,
"replicas": 123,
"autoscaling_enabled": true,
"min_replicas": 123,
"max_replicas": 123,
"scale_to_zero": true,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"region": "<string>",
"deploy_now": true
}
'import requests
url = "https://api.rafftechnologies.com/api/v1/apps/services"
payload = {
"name": "<string>",
"description": "<string>",
"image_ref": "<string>",
"repo_full_name": "<string>",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"start_command": "<string>",
"tier_id": 123,
"replicas": 123,
"autoscaling_enabled": True,
"min_replicas": 123,
"max_replicas": 123,
"scale_to_zero": True,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"region": "<string>",
"deploy_now": True
}
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>',
repo_branch: '<string>',
repo_root_dir: '<string>',
dockerfile_path: '<string>',
start_command: '<string>',
tier_id: 123,
replicas: 123,
autoscaling_enabled: true,
min_replicas: 123,
max_replicas: 123,
scale_to_zero: true,
http_port: 123,
health_check_path: '<string>',
cron_schedule: '<string>',
cron_timezone: '<string>',
region: '<string>',
deploy_now: true
})
};
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>',
'repo_branch' => '<string>',
'repo_root_dir' => '<string>',
'dockerfile_path' => '<string>',
'start_command' => '<string>',
'tier_id' => 123,
'replicas' => 123,
'autoscaling_enabled' => true,
'min_replicas' => 123,
'max_replicas' => 123,
'scale_to_zero' => true,
'http_port' => 123,
'health_check_path' => '<string>',
'cron_schedule' => '<string>',
'cron_timezone' => '<string>',
'region' => '<string>',
'deploy_now' => true
]),
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 \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 123,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 123,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"region\": \"<string>\",\n \"deploy_now\": true\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 \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 123,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 123,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"region\": \"<string>\",\n \"deploy_now\": true\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 \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 123,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 123,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"region\": \"<string>\",\n \"deploy_now\": true\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>",
"region": "<string>",
"url": "<string>",
"internal_host": "<string>",
"status": "pending",
"status_message": "<string>",
"paused_by_cap": true,
"billing_type": "payg",
"current_deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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>",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"start_command": "<string>",
"tier_id": 123,
"replicas": 123,
"autoscaling_enabled": true,
"min_replicas": 123,
"max_replicas": 123,
"scale_to_zero": true,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"region": "<string>",
"deploy_now": true
}
'import requests
url = "https://api.rafftechnologies.com/api/v1/apps/services"
payload = {
"name": "<string>",
"description": "<string>",
"image_ref": "<string>",
"repo_full_name": "<string>",
"repo_branch": "<string>",
"repo_root_dir": "<string>",
"dockerfile_path": "<string>",
"start_command": "<string>",
"tier_id": 123,
"replicas": 123,
"autoscaling_enabled": True,
"min_replicas": 123,
"max_replicas": 123,
"scale_to_zero": True,
"http_port": 123,
"health_check_path": "<string>",
"cron_schedule": "<string>",
"cron_timezone": "<string>",
"region": "<string>",
"deploy_now": True
}
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>',
repo_branch: '<string>',
repo_root_dir: '<string>',
dockerfile_path: '<string>',
start_command: '<string>',
tier_id: 123,
replicas: 123,
autoscaling_enabled: true,
min_replicas: 123,
max_replicas: 123,
scale_to_zero: true,
http_port: 123,
health_check_path: '<string>',
cron_schedule: '<string>',
cron_timezone: '<string>',
region: '<string>',
deploy_now: true
})
};
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>',
'repo_branch' => '<string>',
'repo_root_dir' => '<string>',
'dockerfile_path' => '<string>',
'start_command' => '<string>',
'tier_id' => 123,
'replicas' => 123,
'autoscaling_enabled' => true,
'min_replicas' => 123,
'max_replicas' => 123,
'scale_to_zero' => true,
'http_port' => 123,
'health_check_path' => '<string>',
'cron_schedule' => '<string>',
'cron_timezone' => '<string>',
'region' => '<string>',
'deploy_now' => true
]),
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 \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 123,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 123,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"region\": \"<string>\",\n \"deploy_now\": true\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 \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 123,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 123,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"region\": \"<string>\",\n \"deploy_now\": true\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 \"repo_branch\": \"<string>\",\n \"repo_root_dir\": \"<string>\",\n \"dockerfile_path\": \"<string>\",\n \"start_command\": \"<string>\",\n \"tier_id\": 123,\n \"replicas\": 123,\n \"autoscaling_enabled\": true,\n \"min_replicas\": 123,\n \"max_replicas\": 123,\n \"scale_to_zero\": true,\n \"http_port\": 123,\n \"health_check_path\": \"<string>\",\n \"cron_schedule\": \"<string>\",\n \"cron_timezone\": \"<string>\",\n \"region\": \"<string>\",\n \"deploy_now\": true\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>",
"region": "<string>",
"url": "<string>",
"internal_host": "<string>",
"status": "pending",
"status_message": "<string>",
"paused_by_cap": true,
"billing_type": "payg",
"current_deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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
API key for authentication. Each key is bound to a specific account.
Headers
Project ID. Required for all mutating operations (create, delete, power actions, resize).
Body
web, private, worker, cron, job git, image, template, compose buildpacks, dockerfile, image Prebuilt image reference (for source_type image)
GitHub repo (owner/name) for source_type git
Queue a deployment immediately (prebuilt-image services)