Push file changes
Creates, updates, or deletes documentation files in a single Git commit. Supports up to 20 operations per request. Pushing to the deployment branch triggers a live deployment. Requires editor or admin role.
curl -X POST "https://api.documentationai.app/api/v1/push" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"commitMessage": "example_string",
"branch": "example_string",
"operations": [
{
"type": "create",
"path": "getting-started/quickstart.mdx",
"content": "example_string"
}
]
}'
import requests
import json
url = "https://api.documentationai.app/api/v1/push"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"commitMessage": "example_string",
"branch": "example_string",
"operations": [
{
"type": "create",
"path": "getting-started/quickstart.mdx",
"content": "example_string"
}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.documentationai.app/api/v1/push", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"commitMessage": "example_string",
"branch": "example_string",
"operations": [
{
"type": "create",
"path": "getting-started/quickstart.mdx",
"content": "example_string"
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"commitMessage": "example_string",
"branch": "example_string",
"operations": [
{
"type": "create",
"path": "getting-started/quickstart.mdx",
"content": "example_string"
}
]
}`)
req, err := http.NewRequest("POST", "https://api.documentationai.app/api/v1/push", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.documentationai.app/api/v1/push')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"commitMessage": "example_string",
"branch": "example_string",
"operations": [
{
"type": "create",
"path": "getting-started/quickstart.mdx",
"content": "example_string"
}
]
}'
response = http.request(request)
puts response.body
{
"commitSha": "example_string",
"branch": "example_string",
"isDeploymentBranch": true,
"operationsCompleted": 42
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
/push
API key generated from the Documentation.AI dashboard (Settings → API Keys). Pass as Authorization: Bearer dai_...
Authorization: Bearer dai_...The media type of the request body
Git commit message
Target branch. Defaults to the deployment branch.
File operations to perform in this commit
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. API key generated from the Documentation.AI dashboard (Settings → API Keys). Pass as Authorization: Bearer dai_...
Body
Git commit message
Target branch. Defaults to the deployment branch.
File operations to perform in this commit
File path relative to repository root
File content. Required for create and update operations. Omit for delete.
Responses
SHA of the created commit
Branch the changes were pushed to
Whether this push triggered a live deployment
Number of file operations completed
Last updated 2 days ago
Built with Documentation.AI