curl --request POST \
--url https://davinci-app.com/api/v2/projects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"initialPrompt": "<string>",
"description": "<string>",
"orgId": "<string>",
"visibility": "private",
"autoName": false,
"skipInitialCommit": false
}
'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
project = client.projects.create(name="Spacecraft")
print(project.id)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const project = await client.projects.create({ name: 'Spacecraft' });
console.log(project.id);
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
initialPrompt: '<string>',
description: '<string>',
orgId: '<string>',
visibility: 'private',
autoName: false,
skipInitialCommit: false
})
};
fetch('https://davinci-app.com/api/v2/projects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"projectSlug": "<string>",
"ownerSlug": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Create a project
Creates a project owned by the caller, or by orgId when supplied. Either
name or initialPrompt is required. When autoName is set with an
initialPrompt, the name is derived from the prompt.
Send an Idempotency-Key header to make a retry safe. Creating a project
writes a repository and an initial commit, and a duplicate is not reclaimed,
so a request that times out after the server completed it would otherwise
leave you choosing between a leaked project and a lost one. A repeat of the
same key returns the project the first call created, with the same 201.
curl --request POST \
--url https://davinci-app.com/api/v2/projects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"initialPrompt": "<string>",
"description": "<string>",
"orgId": "<string>",
"visibility": "private",
"autoName": false,
"skipInitialCommit": false
}
'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
project = client.projects.create(name="Spacecraft")
print(project.id)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const project = await client.projects.create({ name: 'Spacecraft' });
console.log(project.id);
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
initialPrompt: '<string>',
description: '<string>',
orgId: '<string>',
visibility: 'private',
autoName: false,
skipInitialCommit: false
})
};
fetch('https://davinci-app.com/api/v2/projects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"projectSlug": "<string>",
"ownerSlug": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Personal access token. The scopes granted at issuance determine both which
operations the key may call and the ceiling on the resource permissions it
can exercise. Each scope family is a ladder: projects:manage implies
projects:write and projects:read; cards:manage implies cards:write
and cards:read; and teams:manage implies teams:write and teams:read.
These are named API capability bundles, not blanket domain roles:
manage exposes only the permissions enumerated for that scope and never
bypasses the acting user's current role-based access.
Headers
A value you choose to identify this request, so that retrying it does not
repeat its effect. Reuse the same key when retrying and the original result
is returned; use a fresh key when you mean to create something new. Keys are
scoped to the API key that sent them (or to the user for browser sessions).
Replayed responses include Idempotency-Replayed: true.
255Body
Required unless initialPrompt is supplied.
Staged as the creator's first agent message when a client connects.
4000Create the project under an organization instead of the calling user.
private, internal, public Derive the project name from initialPrompt.