curl --request POST \
--url https://davinci-app.com/api/v2/projects/{projectId}/open \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "main",
"oldProjectId": "<string>",
"initialPrompt": "<string>"
}
'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
opened = client.projects.open(project_id, branch="main")
print(opened.branch_name, opened.already_loaded)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const opened = await client.projects.open(projectId, { branch: 'main' });
console.log(opened.branchName, opened.alreadyLoaded);
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({branch: 'main', oldProjectId: '<string>', initialPrompt: '<string>'})
};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/open', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"projectId": "<string>",
"branchName": "<string>",
"alreadyLoaded": true,
"permissions": [
"<string>"
],
"metadata": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"owner": "<string>",
"createdBy": "<string>",
"visibility": "<string>",
"version": "<string>",
"created": "2023-11-07T05:31:56Z",
"lastModified": "2023-11-07T05:31:56Z",
"storageUsedBytes": 1,
"transferState": "<string>",
"collaborators": [
"<string>"
],
"pendingCollaborators": [
"<string>"
]
},
"url": "<string>",
"serverToken": "<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": {}
}
}Open a project
Loads the project onto a Design Engine replica, or returns the already-running
instance. alreadyLoaded distinguishes the two.
API-key callers receive lifecycle confirmation only. The url and
serverToken fields that a browser receives are omitted, because
serverToken is minted per project rather than per user and would let its
holder act as any collaborator. Programmatic access to live project data will
use short-lived project-scoped grants instead.
curl --request POST \
--url https://davinci-app.com/api/v2/projects/{projectId}/open \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "main",
"oldProjectId": "<string>",
"initialPrompt": "<string>"
}
'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
opened = client.projects.open(project_id, branch="main")
print(opened.branch_name, opened.already_loaded)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const opened = await client.projects.open(projectId, { branch: 'main' });
console.log(opened.branchName, opened.alreadyLoaded);
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({branch: 'main', oldProjectId: '<string>', initialPrompt: '<string>'})
};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/open', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"projectId": "<string>",
"branchName": "<string>",
"alreadyLoaded": true,
"permissions": [
"<string>"
],
"metadata": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"owner": "<string>",
"createdBy": "<string>",
"visibility": "<string>",
"version": "<string>",
"created": "2023-11-07T05:31:56Z",
"lastModified": "2023-11-07T05:31:56Z",
"storageUsedBytes": 1,
"transferState": "<string>",
"collaborators": [
"<string>"
],
"pendingCollaborators": [
"<string>"
]
},
"url": "<string>",
"serverToken": "<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.
Path Parameters
Project id. May be compound in the form {projectId}--{branchName}.
1Body
Response
Project is loaded and ready.
True when the project was already running and this call reused the instance.
Stored project metadata. ProjectSummary is this plus the live inUse
and activeBranch fields that only the list endpoint computes.
Hide child attributes
Hide child attributes
User id or organization id that owns the project.
x >= 0User ids with effective access, including access inherited from an organization.
Design Engine replica URL. Present only for browser access-token callers; omitted for API keys.
Project instance credential. Present only for browser access-token callers; omitted for API keys.