Skip to main content
GET
https://davinci-app.com
/
api
/
v2
/
programmatic
/
projects
/
{projectId}
/
tree
cURL
curl --request GET \
  --url https://davinci-app.com/api/v2/programmatic/projects/{projectId}/tree \
  --header 'Authorization: Bearer <token>'
import os
from davinci_sdk import DavinciClient

with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
tree = client.projects.get_tree("project-id", branch="main")
print(len(tree.tree))
import { DavinciClient } from '@celedon/davinci-sdk';

const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});

const tree = await client.projects.getTree('project-id', { branch: 'main' });
console.log(tree.tree.length);
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://davinci-app.com/api/v2/programmatic/projects/{projectId}/tree', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "success": true,
  "data": {
    "tree": [
      {
        "id": "<string>",
        "name": "<string>",
        "type": "<string>",
        "parent": "<string>",
        "childrenCount": 1
      }
    ],
    "objectCount": 1
  }
}
{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}
{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}
{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}
{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}
{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}
{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}

Authorizations

Authorization
string
header
default:dav_ak_live_your_token
required

Personal access token. Programmatic reads require the projects:read scope.

Path Parameters

projectId
string
required

Project id. May be compound in the form {projectId}--{branchName}.

Minimum string length: 1

Query Parameters

branch
string
default:main

Response

Project tree.

success
boolean
required
data
object
required