curl --request POST \
--url https://davinci-app.com/api/v2/projects/{projectId}/branches/{branch}/commits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
result = client.branches.commit(project_id, "main", message="Seed requirements")
print(result.commit.hash)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const { commit } = await client.branches.commit(projectId, 'main', {
message: 'Seed requirements',
});
console.log(commit.hash);
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>'})
};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/branches/{branch}/commits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"commit": {
"hash": "<string>",
"message": "<string>",
"author": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"branch": "<string>",
"stats": {
"additions": 123,
"modifications": 123,
"deletions": 123
}
}
}{
"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": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Commit a branch
Commits everything uncommitted on the branch. There is nothing to stage — the working state is the live project, not a checkout, so a commit is all of it or nothing.
Committing requires the branch to be loaded, which this does on the caller’s behalf. A commit of an untouched branch still produces a revision.
curl --request POST \
--url https://davinci-app.com/api/v2/projects/{projectId}/branches/{branch}/commits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
result = client.branches.commit(project_id, "main", message="Seed requirements")
print(result.commit.hash)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const { commit } = await client.branches.commit(projectId, 'main', {
message: 'Seed requirements',
});
console.log(commit.hash);
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>'})
};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/branches/{branch}/commits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"commit": {
"hash": "<string>",
"message": "<string>",
"author": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"branch": "<string>",
"stats": {
"additions": 123,
"modifications": 123,
"deletions": 123
}
}
}{
"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": {}
}
}{
"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}.
1Branch name.
1Body
Response
Commit created.