Databases
Create database
Create a new database with the specified configuration.
POST
/
databases
Create database
curl --request POST \
--url https://api.sevalla.com/v2/databases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"location": "europe-west1",
"resource_type": "db-standard-1",
"display_name": "My Database",
"db_name": "mydb",
"db_password": "securepassword123",
"type": "postgresql",
"version": "16",
"db_user": "dbuser"
}
'import requests
url = "https://api.sevalla.com/v2/databases"
payload = {
"location": "europe-west1",
"resource_type": "db-standard-1",
"display_name": "My Database",
"db_name": "mydb",
"db_password": "securepassword123",
"type": "postgresql",
"version": "16",
"db_user": "dbuser"
}
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({
location: 'europe-west1',
resource_type: 'db-standard-1',
display_name: 'My Database',
db_name: 'mydb',
db_password: 'securepassword123',
type: 'postgresql',
version: '16',
db_user: 'dbuser'
})
};
fetch('https://api.sevalla.com/v2/databases', 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/databases",
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([
'location' => 'europe-west1',
'resource_type' => 'db-standard-1',
'display_name' => 'My Database',
'db_name' => 'mydb',
'db_password' => 'securepassword123',
'type' => 'postgresql',
'version' => '16',
'db_user' => 'dbuser'
]),
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/databases"
payload := strings.NewReader("{\n \"location\": \"europe-west1\",\n \"resource_type\": \"db-standard-1\",\n \"display_name\": \"My Database\",\n \"db_name\": \"mydb\",\n \"db_password\": \"securepassword123\",\n \"type\": \"postgresql\",\n \"version\": \"16\",\n \"db_user\": \"dbuser\"\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/databases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location\": \"europe-west1\",\n \"resource_type\": \"db-standard-1\",\n \"display_name\": \"My Database\",\n \"db_name\": \"mydb\",\n \"db_password\": \"securepassword123\",\n \"type\": \"postgresql\",\n \"version\": \"16\",\n \"db_user\": \"dbuser\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sevalla.com/v2/databases")
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 \"location\": \"europe-west1\",\n \"resource_type\": \"db-standard-1\",\n \"display_name\": \"My Database\",\n \"db_name\": \"mydb\",\n \"db_password\": \"securepassword123\",\n \"type\": \"postgresql\",\n \"version\": \"16\",\n \"db_user\": \"dbuser\"\n}"
response = http.request(request)
puts response.read_body{
"database": {
"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
Cluster location identifier
Example:
"europe-west1"
Resource type name
Example:
"db-standard-1"
Display name for the database
Required string length:
2 - 64Example:
"My Database"
Database name
Required string length:
2 - 100Example:
"mydb"
Database password
Required string length:
4 - 100Example:
"securepassword123"
Database engine type
Available options:
postgresql, mariadb, mysql, mongodb, redis, valkey Example:
"postgresql"
Database engine version
Example:
"16"
Database user (required for non-Redis/Valkey)
Required string length:
2 - 32Pattern:
^[a-zA-Z0-9_\-+]+$Example:
"dbuser"
Response
Default Response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Create database
curl --request POST \
--url https://api.sevalla.com/v2/databases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"location": "europe-west1",
"resource_type": "db-standard-1",
"display_name": "My Database",
"db_name": "mydb",
"db_password": "securepassword123",
"type": "postgresql",
"version": "16",
"db_user": "dbuser"
}
'import requests
url = "https://api.sevalla.com/v2/databases"
payload = {
"location": "europe-west1",
"resource_type": "db-standard-1",
"display_name": "My Database",
"db_name": "mydb",
"db_password": "securepassword123",
"type": "postgresql",
"version": "16",
"db_user": "dbuser"
}
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({
location: 'europe-west1',
resource_type: 'db-standard-1',
display_name: 'My Database',
db_name: 'mydb',
db_password: 'securepassword123',
type: 'postgresql',
version: '16',
db_user: 'dbuser'
})
};
fetch('https://api.sevalla.com/v2/databases', 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/databases",
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([
'location' => 'europe-west1',
'resource_type' => 'db-standard-1',
'display_name' => 'My Database',
'db_name' => 'mydb',
'db_password' => 'securepassword123',
'type' => 'postgresql',
'version' => '16',
'db_user' => 'dbuser'
]),
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/databases"
payload := strings.NewReader("{\n \"location\": \"europe-west1\",\n \"resource_type\": \"db-standard-1\",\n \"display_name\": \"My Database\",\n \"db_name\": \"mydb\",\n \"db_password\": \"securepassword123\",\n \"type\": \"postgresql\",\n \"version\": \"16\",\n \"db_user\": \"dbuser\"\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/databases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location\": \"europe-west1\",\n \"resource_type\": \"db-standard-1\",\n \"display_name\": \"My Database\",\n \"db_name\": \"mydb\",\n \"db_password\": \"securepassword123\",\n \"type\": \"postgresql\",\n \"version\": \"16\",\n \"db_user\": \"dbuser\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sevalla.com/v2/databases")
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 \"location\": \"europe-west1\",\n \"resource_type\": \"db-standard-1\",\n \"display_name\": \"My Database\",\n \"db_name\": \"mydb\",\n \"db_password\": \"securepassword123\",\n \"type\": \"postgresql\",\n \"version\": \"16\",\n \"db_user\": \"dbuser\"\n}"
response = http.request(request)
puts response.read_body{
"database": {
"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"
}
}