Create Repository
curl --request POST \
--url https://api.lightsage.com/v2/repositories \
--header 'Content-Type: application/json' \
--header 'X-Lightsage-Api-Key: <api-key>' \
--data '
{
"name": "<string>",
"repo_url": "<string>",
"ref": "main",
"subdir": "",
"install_steps": [
"<string>"
],
"framework": "custom",
"enabled": true
}
'import requests
url = "https://api.lightsage.com/v2/repositories"
payload = {
"name": "<string>",
"repo_url": "<string>",
"ref": "main",
"subdir": "",
"install_steps": ["<string>"],
"framework": "custom",
"enabled": True
}
headers = {
"X-Lightsage-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-Lightsage-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
repo_url: '<string>',
ref: 'main',
subdir: '',
install_steps: ['<string>'],
framework: 'custom',
enabled: true
})
};
fetch('https://api.lightsage.com/v2/repositories', 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.lightsage.com/v2/repositories",
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>',
'repo_url' => '<string>',
'ref' => 'main',
'subdir' => '',
'install_steps' => [
'<string>'
],
'framework' => 'custom',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Lightsage-Api-Key: <api-key>"
],
]);
$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.lightsage.com/v2/repositories"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"repo_url\": \"<string>\",\n \"ref\": \"main\",\n \"subdir\": \"\",\n \"install_steps\": [\n \"<string>\"\n ],\n \"framework\": \"custom\",\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Lightsage-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.lightsage.com/v2/repositories")
.header("X-Lightsage-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"repo_url\": \"<string>\",\n \"ref\": \"main\",\n \"subdir\": \"\",\n \"install_steps\": [\n \"<string>\"\n ],\n \"framework\": \"custom\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/repositories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Lightsage-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"repo_url\": \"<string>\",\n \"ref\": \"main\",\n \"subdir\": \"\",\n \"install_steps\": [\n \"<string>\"\n ],\n \"framework\": \"custom\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"kind": "template",
"name": "<string>",
"repo_url": "<string>",
"ref": "<string>",
"enabled": true,
"subdir": "",
"install_steps": [
"<string>"
],
"framework": "custom",
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Repositories
Create Repository
Adds a reusable Git repository workspace for eval configurations.
POST
/
v2
/
repositories
Create Repository
curl --request POST \
--url https://api.lightsage.com/v2/repositories \
--header 'Content-Type: application/json' \
--header 'X-Lightsage-Api-Key: <api-key>' \
--data '
{
"name": "<string>",
"repo_url": "<string>",
"ref": "main",
"subdir": "",
"install_steps": [
"<string>"
],
"framework": "custom",
"enabled": true
}
'import requests
url = "https://api.lightsage.com/v2/repositories"
payload = {
"name": "<string>",
"repo_url": "<string>",
"ref": "main",
"subdir": "",
"install_steps": ["<string>"],
"framework": "custom",
"enabled": True
}
headers = {
"X-Lightsage-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-Lightsage-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
repo_url: '<string>',
ref: 'main',
subdir: '',
install_steps: ['<string>'],
framework: 'custom',
enabled: true
})
};
fetch('https://api.lightsage.com/v2/repositories', 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.lightsage.com/v2/repositories",
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>',
'repo_url' => '<string>',
'ref' => 'main',
'subdir' => '',
'install_steps' => [
'<string>'
],
'framework' => 'custom',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Lightsage-Api-Key: <api-key>"
],
]);
$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.lightsage.com/v2/repositories"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"repo_url\": \"<string>\",\n \"ref\": \"main\",\n \"subdir\": \"\",\n \"install_steps\": [\n \"<string>\"\n ],\n \"framework\": \"custom\",\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Lightsage-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.lightsage.com/v2/repositories")
.header("X-Lightsage-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"repo_url\": \"<string>\",\n \"ref\": \"main\",\n \"subdir\": \"\",\n \"install_steps\": [\n \"<string>\"\n ],\n \"framework\": \"custom\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/repositories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Lightsage-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"repo_url\": \"<string>\",\n \"ref\": \"main\",\n \"subdir\": \"\",\n \"install_steps\": [\n \"<string>\"\n ],\n \"framework\": \"custom\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"kind": "template",
"name": "<string>",
"repo_url": "<string>",
"ref": "<string>",
"enabled": true,
"subdir": "",
"install_steps": [
"<string>"
],
"framework": "custom",
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Minimum string length:
1Minimum string length:
1Branch, tag, or commit SHA.
Project root inside the repository.
Available options:
fastify, nuxt, express, spa-js, angular, react, fastapi, vite, nextjs, custom Response
Successful Response
Value to pass as repository in a direct eval run. Built-in templates use aliases such as nextjs-starter; saved repositories use their persisted IDs.
Whether the repository is a read-only built-in template or an organization-owned saved repository.
Available options:
template, saved Available options:
fastify, nuxt, express, spa-js, angular, react, fastapi, vite, nextjs, custom