Deployments
Start deployment
Start a new deployment for your application using this endpoint.
POST
/
applications
/
deployments
Start deployment
curl --request POST \
--url https://api.sevalla.com/v2/applications/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
"branch": "main",
"docker_image": "my-image:latest",
"is_restart": false
}
'import requests
url = "https://api.sevalla.com/v2/applications/deployments"
payload = {
"app_id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
"branch": "main",
"docker_image": "my-image:latest",
"is_restart": 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({
app_id: 'fb5e5168-4281-4bec-94c5-0d1584e9e657',
branch: 'main',
docker_image: 'my-image:latest',
is_restart: false
})
};
fetch('https://api.sevalla.com/v2/applications/deployments', 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.sevalla.com/v2/applications/deployments",
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([
'app_id' => 'fb5e5168-4281-4bec-94c5-0d1584e9e657',
'branch' => 'main',
'docker_image' => 'my-image:latest',
'is_restart' => 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.sevalla.com/v2/applications/deployments"
payload := strings.NewReader("{\n \"app_id\": \"fb5e5168-4281-4bec-94c5-0d1584e9e657\",\n \"branch\": \"main\",\n \"docker_image\": \"my-image:latest\",\n \"is_restart\": 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.sevalla.com/v2/applications/deployments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"app_id\": \"fb5e5168-4281-4bec-94c5-0d1584e9e657\",\n \"branch\": \"main\",\n \"docker_image\": \"my-image:latest\",\n \"is_restart\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sevalla.com/v2/applications/deployments")
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 \"app_id\": \"fb5e5168-4281-4bec-94c5-0d1584e9e657\",\n \"branch\": \"main\",\n \"docker_image\": \"my-image:latest\",\n \"is_restart\": false\n}"
response = http.request(request)
puts response.read_body{
"deployment": {
"id": "fb5e5168-4281-4bec-94c5-0d1584e9e657"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}Authorizations
API key authentication. Pass your API key as a Bearer token in the Authorization header.
Body
application/json
Application ID to deploy
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Example:
"fb5e5168-4281-4bec-94c5-0d1584e9e657"
Git branch to deploy
Example:
"main"
Docker image to deploy
Example:
"my-image:latest"
Whether this is a restart deployment
Example:
false
Response
Default Response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Start deployment
curl --request POST \
--url https://api.sevalla.com/v2/applications/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
"branch": "main",
"docker_image": "my-image:latest",
"is_restart": false
}
'import requests
url = "https://api.sevalla.com/v2/applications/deployments"
payload = {
"app_id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
"branch": "main",
"docker_image": "my-image:latest",
"is_restart": 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({
app_id: 'fb5e5168-4281-4bec-94c5-0d1584e9e657',
branch: 'main',
docker_image: 'my-image:latest',
is_restart: false
})
};
fetch('https://api.sevalla.com/v2/applications/deployments', 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.sevalla.com/v2/applications/deployments",
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([
'app_id' => 'fb5e5168-4281-4bec-94c5-0d1584e9e657',
'branch' => 'main',
'docker_image' => 'my-image:latest',
'is_restart' => 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.sevalla.com/v2/applications/deployments"
payload := strings.NewReader("{\n \"app_id\": \"fb5e5168-4281-4bec-94c5-0d1584e9e657\",\n \"branch\": \"main\",\n \"docker_image\": \"my-image:latest\",\n \"is_restart\": 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.sevalla.com/v2/applications/deployments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"app_id\": \"fb5e5168-4281-4bec-94c5-0d1584e9e657\",\n \"branch\": \"main\",\n \"docker_image\": \"my-image:latest\",\n \"is_restart\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sevalla.com/v2/applications/deployments")
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 \"app_id\": \"fb5e5168-4281-4bec-94c5-0d1584e9e657\",\n \"branch\": \"main\",\n \"docker_image\": \"my-image:latest\",\n \"is_restart\": false\n}"
response = http.request(request)
puts response.read_body{
"deployment": {
"id": "fb5e5168-4281-4bec-94c5-0d1584e9e657"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err_12345",
"message": "The requested resource was not found"
}
}