curl --request POST \
--url https://app.langtrace.ai/api/project \
--header 'Content-Type: application/json' \
--header 'x-api-key: 6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5' \
--data '{
"name": "My Project",
"description": "Your Project Description",
"teamId": "clxw064em0004dpukky3d55lw",
"createDefaultTests": true
}'
import requests
url = 'https://app.langtrace.ai/api/project'
headers = {
'Content-Type': 'application/json',
'x-api-key': '6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5'
}
payload = {
'name': 'My Project',
'description': 'Your Project Description',
'teamId': 'clxw064em0004dpukky3d55lw',
'createDefaultTests': True
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
const url = "https://app.langtrace.ai/api/project";
const headers = {
"Content-Type": "application/json",
"x-api-key": "6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5"
};
const payload = {
name: "My Project",
description: "Your Project Description",
teamId: "clxw064em0004dpukky3d55lw",
createDefaultTests: true
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.langtrace.ai/api/project",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => 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' => 'My Project',
'description' => 'Your Project Description',
'teamId' => 'clxw064em0004dpukky3d55lw',
'createDefaultTests' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: 6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://app.langtrace.ai/api/project"
payload := map[string]interface{}{
"name": "My Project",
"description": "Your Project Description",
"teamId": "clxw064em0004dpukky3d55lw",
"createDefaultTests": true,
}
jsonData, err := json.Marshal(payload)
if err != nil {
fmt.Println("Error marshalling JSON:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", "6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error making request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Paths;
import java.nio.file.Files;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
String payload = "{"
+ "\"name\":\"My Project\","
+ "\"description\":\"Your Project Description\","
+ "\"teamId\":\"clxw064em0004dpukky3d55lw\","
+ "\"createDefaultTests\":true"
+ "}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.langtrace.ai/api/project"))
.header("Content-Type", "application/json")
.header("x-api-key", "6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
try {
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
}
{
"id": "clxyvlimf0001ig5bwss7qhrk",
"name": "My Project",
"description": "Your Project Description",
"teamId": "clxw064em0004dpukky3d55lw",
"createdAt": "2024-06-28T15:56:25.096Z",
"updatedAt": "2024-06-28T15:56:25.096Z",
}
{
"message": "Invalid api key unauthorized",
}
Project APIs
POST Project
This endpoint enables creation of a new project
curl --request POST \
--url https://app.langtrace.ai/api/project \
--header 'Content-Type: application/json' \
--header 'x-api-key: 6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5' \
--data '{
"name": "My Project",
"description": "Your Project Description",
"teamId": "clxw064em0004dpukky3d55lw",
"createDefaultTests": true
}'
import requests
url = 'https://app.langtrace.ai/api/project'
headers = {
'Content-Type': 'application/json',
'x-api-key': '6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5'
}
payload = {
'name': 'My Project',
'description': 'Your Project Description',
'teamId': 'clxw064em0004dpukky3d55lw',
'createDefaultTests': True
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
const url = "https://app.langtrace.ai/api/project";
const headers = {
"Content-Type": "application/json",
"x-api-key": "6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5"
};
const payload = {
name: "My Project",
description: "Your Project Description",
teamId: "clxw064em0004dpukky3d55lw",
createDefaultTests: true
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.langtrace.ai/api/project",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => 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' => 'My Project',
'description' => 'Your Project Description',
'teamId' => 'clxw064em0004dpukky3d55lw',
'createDefaultTests' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: 6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://app.langtrace.ai/api/project"
payload := map[string]interface{}{
"name": "My Project",
"description": "Your Project Description",
"teamId": "clxw064em0004dpukky3d55lw",
"createDefaultTests": true,
}
jsonData, err := json.Marshal(payload)
if err != nil {
fmt.Println("Error marshalling JSON:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", "6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error making request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Paths;
import java.nio.file.Files;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
String payload = "{"
+ "\"name\":\"My Project\","
+ "\"description\":\"Your Project Description\","
+ "\"teamId\":\"clxw064em0004dpukky3d55lw\","
+ "\"createDefaultTests\":true"
+ "}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.langtrace.ai/api/project"))
.header("Content-Type", "application/json")
.header("x-api-key", "6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
try {
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
}
{
"id": "clxyvlimf0001ig5bwss7qhrk",
"name": "My Project",
"description": "Your Project Description",
"teamId": "clxw064em0004dpukky3d55lw",
"createdAt": "2024-06-28T15:56:25.096Z",
"updatedAt": "2024-06-28T15:56:25.096Z",
}
{
"message": "Invalid api key unauthorized",
}
You can find the
teamId when you click on Settings -> Team. You will need a team level API key which can be generated on the same page by clicking Generate API Key.POST project endpoint is provided below.
ID of your team. This can be found on the langtrace ui.
Name of the project.
Descripton of the project you are creating.
If true, default tests will be created for the project.
200 (OK) Response Object Schema
200 (OK) Response Object Schema
Error Response Object Schema
Error Response Object Schema
curl --request POST \
--url https://app.langtrace.ai/api/project \
--header 'Content-Type: application/json' \
--header 'x-api-key: 6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5' \
--data '{
"name": "My Project",
"description": "Your Project Description",
"teamId": "clxw064em0004dpukky3d55lw",
"createDefaultTests": true
}'
import requests
url = 'https://app.langtrace.ai/api/project'
headers = {
'Content-Type': 'application/json',
'x-api-key': '6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5'
}
payload = {
'name': 'My Project',
'description': 'Your Project Description',
'teamId': 'clxw064em0004dpukky3d55lw',
'createDefaultTests': True
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
const url = "https://app.langtrace.ai/api/project";
const headers = {
"Content-Type": "application/json",
"x-api-key": "6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5"
};
const payload = {
name: "My Project",
description: "Your Project Description",
teamId: "clxw064em0004dpukky3d55lw",
createDefaultTests: true
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.langtrace.ai/api/project",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => 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' => 'My Project',
'description' => 'Your Project Description',
'teamId' => 'clxw064em0004dpukky3d55lw',
'createDefaultTests' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: 6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://app.langtrace.ai/api/project"
payload := map[string]interface{}{
"name": "My Project",
"description": "Your Project Description",
"teamId": "clxw064em0004dpukky3d55lw",
"createDefaultTests": true,
}
jsonData, err := json.Marshal(payload)
if err != nil {
fmt.Println("Error marshalling JSON:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", "6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error making request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Paths;
import java.nio.file.Files;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
String payload = "{"
+ "\"name\":\"My Project\","
+ "\"description\":\"Your Project Description\","
+ "\"teamId\":\"clxw064em0004dpukky3d55lw\","
+ "\"createDefaultTests\":true"
+ "}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.langtrace.ai/api/project"))
.header("Content-Type", "application/json")
.header("x-api-key", "6bd254a6615f48ea0da16823520db8efa4caa4186f62385fbd0f03324c7edcb5")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
try {
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
}
{
"id": "clxyvlimf0001ig5bwss7qhrk",
"name": "My Project",
"description": "Your Project Description",
"teamId": "clxw064em0004dpukky3d55lw",
"createdAt": "2024-06-28T15:56:25.096Z",
"updatedAt": "2024-06-28T15:56:25.096Z",
}
{
"message": "Invalid api key unauthorized",
}
⌘I