Git Sync Beta
Git repository connections, package browsing, preview, apply, link and export.
Create a git repository connection.
POST /platform-infrastructure/git-repository/
Authentication: Bearer token
Request body
-
organization_idstring Required -
Organization that owns this connection.
-
namestring Required -
Human-readable name shown in the UI (e.g. "Acme · Support solutions").
-
descriptionstring -
Optional description of what the repository contains.
-
providerPlatformInfrastructureGitRepositoryProvider Required -
Git provider object { id, name, title } (github, gitlab, bitbucket, azure-devops).
-
idinteger -
namestring - Allowed values
githubgitlabbitbucketazure-devops -
titlestring
-
-
base_urlstring -
API base URL for self-hosted or enterprise servers (e.g. https://github.example.com/api/v3). Empty means the provider's public API (https://api.github.com for GitHub).
-
repositorystring Required -
Repository full name (owner/name).
-
branchstring Required -
Branch this installation reads (e.g. development for dev, main for prod).
-
credential_idstring Required -
Platform credential (api-key) holding the read token. Resolved only inside the backend.
-
environmentstring Required -
Name of the environments/
.json file used to resolve tokens (e.g. dev, prod). -
root_pathstring -
Optional folder inside the repository that contains the packages. Empty means the repository root.
-
tagsarray<string> -
Optional free-form tags.
Responses
-
200OK.
curl -X POST https://api.sommatic.ai/platform-infrastructure/git-repository/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"organization_id": "<organization_id>",
"name": "<name>",
"provider": {
"id": 0,
"name": "github",
"title": "<title>"
},
"repository": "<repository>",
"branch": "<branch>",
"credential_id": "<credential_id>",
"environment": "<environment>"
}'const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-repository/', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"organization_id": "<organization_id>",
"name": "<name>",
"provider": {
"id": 0,
"name": "github",
"title": "<title>"
},
"repository": "<repository>",
"branch": "<branch>",
"credential_id": "<credential_id>",
"environment": "<environment>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/platform-infrastructure/git-repository/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"organization_id": "<organization_id>",
"name": "<name>",
"provider": {
"id": 0,
"name": "github",
"title": "<title>"
},
"repository": "<repository>",
"branch": "<branch>",
"credential_id": "<credential_id>",
"environment": "<environment>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {}
}Update a git repository connection.
PATCH /platform-infrastructure/git-repository/
Authentication: Bearer token
Request body
-
organization_idstring Required -
Organization that owns this connection.
-
namestring Required -
Human-readable name shown in the UI (e.g. "Acme · Support solutions").
-
descriptionstring -
Optional description of what the repository contains.
-
providerPlatformInfrastructureGitRepositoryProvider Required -
Git provider object { id, name, title } (github, gitlab, bitbucket, azure-devops).
-
idinteger -
namestring - Allowed values
githubgitlabbitbucketazure-devops -
titlestring
-
-
base_urlstring -
API base URL for self-hosted or enterprise servers (e.g. https://github.example.com/api/v3). Empty means the provider's public API (https://api.github.com for GitHub).
-
repositorystring Required -
Repository full name (owner/name).
-
branchstring Required -
Branch this installation reads (e.g. development for dev, main for prod).
-
credential_idstring Required -
Platform credential (api-key) holding the read token. Resolved only inside the backend.
-
environmentstring Required -
Name of the environments/
.json file used to resolve tokens (e.g. dev, prod). -
root_pathstring -
Optional folder inside the repository that contains the packages. Empty means the repository root.
-
tagsarray<string> -
Optional free-form tags.
Responses
-
200OK.
curl -X PATCH https://api.sommatic.ai/platform-infrastructure/git-repository/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"organization_id": "<organization_id>",
"name": "<name>",
"provider": {
"id": 0,
"name": "github",
"title": "<title>"
},
"repository": "<repository>",
"branch": "<branch>",
"credential_id": "<credential_id>",
"environment": "<environment>"
}'const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-repository/', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"organization_id": "<organization_id>",
"name": "<name>",
"provider": {
"id": 0,
"name": "github",
"title": "<title>"
},
"repository": "<repository>",
"branch": "<branch>",
"credential_id": "<credential_id>",
"environment": "<environment>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.patch(
"https://api.sommatic.ai/platform-infrastructure/git-repository/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"organization_id": "<organization_id>",
"name": "<name>",
"provider": {
"id": 0,
"name": "github",
"title": "<title>"
},
"repository": "<repository>",
"branch": "<branch>",
"credential_id": "<credential_id>",
"environment": "<environment>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"organization_id": "<organization_id>",
"name": "<name>",
"provider": {
"id": 0,
"name": "github",
"title": "<title>"
},
"repository": "<repository>",
"branch": "<branch>",
"credential_id": "<credential_id>",
"environment": "<environment>"
}
}Soft-delete a git repository connection.
DELETE /platform-infrastructure/git-repository/
Authentication: Bearer token
Request body
-
idstring
Responses
-
200OK.
curl -X DELETE https://api.sommatic.ai/platform-infrastructure/git-repository/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>"
}'const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-repository/', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"id": "<id>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.delete(
"https://api.sommatic.ai/platform-infrastructure/git-repository/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"id": "<id>"
},
)
data = response.json()Read the sommatic.json manifest of a package and list its resources.
GET /platform-infrastructure/git-repository/{id}/package
Authentication: Bearer token
Parameters
-
idstring path Required -
pathstring query Required -
Package folder (e.g. juridica).
-
refstring query
Responses
-
200{ head, path, manifest, resources: [{ kind, key, path }] }
curl -X GET https://api.sommatic.ai/platform-infrastructure/git-repository/<id>/package?path=<path> \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-repository/<id>/package?path=<path>', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/platform-infrastructure/git-repository/<id>/package?path=<path>",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json()Test the connection (credential, branch, environment file) and list its packages.
GET /platform-infrastructure/git-repository/{id}/test
Authentication: Bearer token
Parameters
-
idstring path Required -
refstring query -
Optional branch, tag or commit. Defaults to the configured branch.
Responses
-
200{ repository, branch, environment, head: { sha, message, date }, packages: [path] }
curl -X GET https://api.sommatic.ai/platform-infrastructure/git-repository/<id>/test \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-repository/<id>/test', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/platform-infrastructure/git-repository/<id>/test",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json()List the folders and files under a path of the repository, flagging Sommatic AI packages.
GET /platform-infrastructure/git-repository/{id}/tree
Authentication: Bearer token
Parameters
-
idstring path Required -
pathstring query -
Folder relative to the connection root. Empty for the root.
-
refstring query
Responses
-
200{ head, path, is_package, children: [{ name, path, type, is_package }], packages }
curl -X GET https://api.sommatic.ai/platform-infrastructure/git-repository/<id>/tree \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-repository/<id>/tree', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/platform-infrastructure/git-repository/<id>/tree",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json()Get git repository connections by query selector.
GET /platform-infrastructure/git-repository/{queryselector}
Authentication: Bearer token
Parameters
-
queryselectorenum path Required -
idorganization-idallcatalogsstatus -
searchstring query -
Id (queryselector id) or organization id (queryselector organization-id).
Responses
-
200OK.
curl -X GET https://api.sommatic.ai/platform-infrastructure/git-repository/id \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-repository/id', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/platform-infrastructure/git-repository/id",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {}
}Apply a reviewed commit to Sommatic AI and optionally publish the version.
POST /platform-infrastructure/git-sync/apply
Writes the resolved content of expected_commit into the workflow draft / knowledge resource content and records git_binding. With publish: true it also creates the version (workflow) or snapshot (knowledge resource). Unchanged resources are skipped, and published only when their deployed version does not come from this commit yet. Only the head of the connection branch can be applied. In installations whose webhooks run in test mode the workflow draft is live: applying is deploying.
Authentication: Bearer token
Request body
-
repository_idstring Required -
expected_commitstring Required -
Commit returned by preview.
-
resource_idstring -
keystring -
pathstring -
keysarray<string> -
With path, apply only these keys of the package.
-
publishboolean -
descriptionstring -
Note stored in the published version.
Responses
-
200{ commit, published, applied, unchanged, failed, items: [{ key, result, reason?, version? }] }
curl -X POST https://api.sommatic.ai/platform-infrastructure/git-sync/apply \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"repository_id": "<repository_id>",
"expected_commit": "<expected_commit>"
}'const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-sync/apply', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"repository_id": "<repository_id>",
"expected_commit": "<expected_commit>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/platform-infrastructure/git-sync/apply",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"repository_id": "<repository_id>",
"expected_commit": "<expected_commit>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"repository_id": "<repository_id>",
"expected_commit": "<expected_commit>"
}
}Convert a Sommatic AI resource into a repository file (template for a new or updated resource).
POST /platform-infrastructure/git-sync/export
Returns the file text in the repository format (header sommatic, stable key order), with environment values replaced by @@env.X@@, declared resource ids by @@ref.key@@ and detected secrets by @@secret.REPLACE_ME@@, plus the manifest entry and the environment entry to add. Writes nothing.
Authentication: Bearer token
Request body
-
repository_idstring Required -
resource_idstring Required -
kindstring - Allowed values
workflowsknowledge -
keystring -
Logical key; defaults to the declared key or
. . -
package_pathstring -
Package folder where the file will live.
Responses
-
200{ key, file_path, manifest_entry, environment_entry, text, tokens, warnings }
curl -X POST https://api.sommatic.ai/platform-infrastructure/git-sync/export \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"repository_id": "<repository_id>",
"resource_id": "<resource_id>"
}'const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-sync/export', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"repository_id": "<repository_id>",
"resource_id": "<resource_id>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/platform-infrastructure/git-sync/export",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"repository_id": "<repository_id>",
"resource_id": "<resource_id>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"repository_id": "<repository_id>",
"resource_id": "<resource_id>"
}
}Unlink or relink a resource from Git in this installation.
POST /platform-infrastructure/git-sync/link
The link is defined in the repository (environments/
Authentication: Bearer token
Request body
-
resource_idstring Required -
kindstring - Allowed values
workflowsknowledge -
linkedboolean Required
Responses
-
200{ resource_id, kind, git_binding }
curl -X POST https://api.sommatic.ai/platform-infrastructure/git-sync/link \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resource_id": "<resource_id>",
"linked": true
}'const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-sync/link', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"resource_id": "<resource_id>",
"linked": true
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/platform-infrastructure/git-sync/link",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"resource_id": "<resource_id>",
"linked": True
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"resource_id": "<resource_id>",
"linked": true
}
}Preview what a git sync would change. Writes nothing.
POST /platform-infrastructure/git-sync/preview
Resolves the selected resources at the connection branch (or ref) with the environment of the connection and compares them with Sommatic AI. Select one resource with resource_id or key, or a whole package with path. Returns the commit to pass as expected_commit to apply.
Authentication: Bearer token
Request body
-
repository_idstring Required -
resource_idstring -
Physical id of a workflow or knowledge resource.
-
keystring -
Logical key (e.g. support.triage).
-
pathstring -
Package folder; previews every resource of the package.
-
refstring -
Optional branch, tag or commit.
-
include_contentboolean -
Include the resolved content of each resource (default true).
Responses
-
200{ repository, branch, environment, commit, commit_message, items: [{ key, kind, path, resource_id, exists, unresolved, changes: { has_changes, nodes, edges, fields, ... }, content }] }
curl -X POST https://api.sommatic.ai/platform-infrastructure/git-sync/preview \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"repository_id": "<repository_id>"
}'const response = await fetch('https://api.sommatic.ai/platform-infrastructure/git-sync/preview', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"repository_id": "<repository_id>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/platform-infrastructure/git-sync/preview",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"repository_id": "<repository_id>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"repository_id": "<repository_id>"
}
}