curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/files \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
result = client.projects.list_files(project_id)
for file in result.files:
print(file.filename, file.size)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const { files } = await client.projects.listFiles(projectId);
for (const file of files) {
console.log(file.filename, file.size ?? 'missing');
}
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"files": [
{
"objectId": "<string>",
"name": "<string>",
"filename": "<string>",
"fileType": "<string>",
"size": 1,
"parentId": "<string>"
}
],
"count": 1
}{
"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": {}
}
}List attached files
Returns the files attached to a branch from committed branch HEAD. Each
reference is joined to its assets.primary descriptor when present, so the
listed filename and size describe the immutable SHA-addressed blob. Older
snapshots without asset metadata retain the legacy files-prefix lookup.
Read from the branch’s saved snapshot rather than from the running project, so it works whether or not the project is open — and so a file attached since the last save is not listed yet.
A reference whose bytes are missing from storage is listed with a null
size, because the object exists and omitting it would hide a half-finished
upload. The reverse does not hold: stored bytes with no reference on this
branch are not listed, since storage is shared across branches and one
branch cannot tell an orphan from another branch’s file.
curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/files \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
result = client.projects.list_files(project_id)
for file in result.files:
print(file.filename, file.size)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const { files } = await client.projects.listFiles(projectId);
for (const file of files) {
console.log(file.filename, file.size ?? 'missing');
}
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"files": [
{
"objectId": "<string>",
"name": "<string>",
"filename": "<string>",
"fileType": "<string>",
"size": 1,
"parentId": "<string>"
}
],
"count": 1
}{
"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}.
1Query Parameters
Response
Files attached to the branch.
Hide child attributes
Hide child attributes
Id of the reference object. Pass as fileId to download or delete.
Display name of the object.
Stored name from assets.primary.fileName, or {objectId}{fileType} for
a legacy snapshot. This is the fileName the data-plane download takes.
Extension including the leading dot.
Byte size from assets.primary.byteSize, or the legacy stored-file size.
Null when the reference exists but no size metadata or legacy blob exists.
x >= 0Object the reference is attached under.
x >= 0