Projects
Create Project
Create a new Project.
POST
/
projects
JavaScript
import Scorecard from 'scorecard-ai';
const client = new Scorecard({
apiKey: process.env['SCORECARD_API_KEY'], // This is the default and can be omitted
});
const project = await client.projects.create({
description: 'This is a test project',
name: 'My Project',
});
console.log(project.id);import os
from scorecard_ai import Scorecard
client = Scorecard(
api_key=os.environ.get("SCORECARD_API_KEY"), # This is the default and can be omitted
)
project = client.projects.create(
description="This is a test project",
name="My Project",
)
print(project.id)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api2.scorecard.io/api/v2/projects"
payload := strings.NewReader("{\n \"name\": \"My Project\",\n \"description\": \"This is a test project\"\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))
}curl https://api2.scorecard.io/api/v2/projects \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $SCORECARD_API_KEY" \
-d '{
"description": "This is a test project",
"name": "My Project"
}'{
"id": "314",
"name": "My Project",
"description": "This is a test project"
}{
"code": "UNAUTHORIZED",
"message": "Invalid or missing authentication token",
"details": {}
}{
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred while processing your request.",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Was this page helpful?
⌘I
JavaScript
import Scorecard from 'scorecard-ai';
const client = new Scorecard({
apiKey: process.env['SCORECARD_API_KEY'], // This is the default and can be omitted
});
const project = await client.projects.create({
description: 'This is a test project',
name: 'My Project',
});
console.log(project.id);import os
from scorecard_ai import Scorecard
client = Scorecard(
api_key=os.environ.get("SCORECARD_API_KEY"), # This is the default and can be omitted
)
project = client.projects.create(
description="This is a test project",
name="My Project",
)
print(project.id)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api2.scorecard.io/api/v2/projects"
payload := strings.NewReader("{\n \"name\": \"My Project\",\n \"description\": \"This is a test project\"\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))
}curl https://api2.scorecard.io/api/v2/projects \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $SCORECARD_API_KEY" \
-d '{
"description": "This is a test project",
"name": "My Project"
}'{
"id": "314",
"name": "My Project",
"description": "This is a test project"
}{
"code": "UNAUTHORIZED",
"message": "Invalid or missing authentication token",
"details": {}
}{
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred while processing your request.",
"details": {}
}