Create a new project
POST
https://api.ridgeline.run /v11/projects Creates a project with the provided configuration. Only the project name is required; everything else overrides a default.
Parameters
teamIdstringqueryThe team identifier to perform the request on behalf of.
slugstringqueryThe team slug to perform the request on behalf of.
Request body application/json
namestringrequiredThe project name. Lowercase, up to 100 characters.
frameworkstringThe framework preset, or null for other.
buildCommandstringOverrides the detected build command.
rootDirectorystringThe folder inside the repository that holds the app.
environmentVariablesobject[]Variables to create with the project.
{
"name": "string",
"framework": "nextjs",
"buildCommand": "string",
"rootDirectory": "string",
"environmentVariables": [
{
"key": "string",
"value": "string",
"target": "production"
}
]
}Code samples
cURL
curl -X POST "https://api.ridgeline.run/v11/projects?teamId=&slug=" \
-H "Content-Type: application/json" \
-d '{"name":"string","framework":"nextjs","buildCommand":"string","rootDirectory":"string","environmentVariables":[{"key":"string","value":"string","target":"production"}]}'TypeScript
const res = await fetch('https://api.ridgeline.run/v11/projects?teamId=&slug=', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({"name":"string","framework":"nextjs","buildCommand":"string","rootDirectory":"string","environmentVariables":[{"key":"string","value":"string","target":"production"}]}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.ridgeline.run/v11/projects?teamId=&slug=",
headers={
"Content-Type": "application/json",
},
json={"name": "string", "framework": "nextjs", "buildCommand": "string", "rootDirectory": "string", "environmentVariables": [{"key": "string", "value": "string", "target": "production"}]},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.ridgeline.run/v11/projects?teamId=&slug=", strings.NewReader(`{"name":"string","framework":"nextjs","buildCommand":"string","rootDirectory":"string","environmentVariables":[{"key":"string","value":"string","target":"production"}]}`))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.ridgeline.run/v11/projects?teamId=&slug=');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name":"string","framework":"nextjs","buildCommand":"string","rootDirectory":"string","environmentVariables":[{"key":"string","value":"string","target":"production"}]}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.ridgeline.run/v11/projects?teamId=&slug=')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req.body = '{"name":"string","framework":"nextjs","buildCommand":"string","rootDirectory":"string","environmentVariables":[{"key":"string","value":"string","target":"production"}]}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ridgeline.run/v11/projects?teamId=&slug="))
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"name\":\"string\",\"framework\":\"nextjs\",\"buildCommand\":\"string\",\"rootDirectory\":\"string\",\"environmentVariables\":[{\"key\":\"string\",\"value\":\"string\",\"target\":\"production\"}]}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
200 OK
{
"id": "prj_8f3k2",
"name": "my-app",
"framework": "nextjs",
"createdAt": 1760000000000
}400 One of the provided values is invalid.
403 You do not have permission to access this resource.
Updated
Was this page helpful?