On this page
Sommatic Docs
Open portal

Git Sync Beta

Git repository connections, package browsing, preview, apply, link and export.

View as Markdown
Open in

Create a git repository connection.

POST /platform-infrastructure/git-repository/

Authentication: Bearer token

Request body

organization_id string Required

Organization that owns this connection.

name string Required

Human-readable name shown in the UI (e.g. "Acme · Support solutions").

description string

Optional description of what the repository contains.

provider PlatformInfrastructureGitRepositoryProvider Required

Git provider object { id, name, title } (github, gitlab, bitbucket, azure-devops).

id integer
name string
Allowed values githubgitlabbitbucketazure-devops
title string
base_url string

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).

repository string Required

Repository full name (owner/name).

branch string Required

Branch this installation reads (e.g. development for dev, main for prod).

credential_id string Required

Platform credential (api-key) holding the read token. Resolved only inside the backend.

environment string Required

Name of the environments/.json file used to resolve tokens (e.g. dev, prod).

root_path string

Optional folder inside the repository that contains the packages. Empty means the repository root.

tags array<string>

Optional free-form tags.

Responses

  • 200 OK.
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>"
  }'
Response 200
{
  "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_id string Required

Organization that owns this connection.

name string Required

Human-readable name shown in the UI (e.g. "Acme · Support solutions").

description string

Optional description of what the repository contains.

provider PlatformInfrastructureGitRepositoryProvider Required

Git provider object { id, name, title } (github, gitlab, bitbucket, azure-devops).

id integer
name string
Allowed values githubgitlabbitbucketazure-devops
title string
base_url string

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).

repository string Required

Repository full name (owner/name).

branch string Required

Branch this installation reads (e.g. development for dev, main for prod).

credential_id string Required

Platform credential (api-key) holding the read token. Resolved only inside the backend.

environment string Required

Name of the environments/.json file used to resolve tokens (e.g. dev, prod).

root_path string

Optional folder inside the repository that contains the packages. Empty means the repository root.

tags array<string>

Optional free-form tags.

Responses

  • 200 OK.
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>"
  }'
Response 200
{
  "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

id string

Responses

  • 200 OK.
curl -X DELETE https://api.sommatic.ai/platform-infrastructure/git-repository/ \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "<id>"
  }'

Read the sommatic.json manifest of a package and list its resources.

GET /platform-infrastructure/git-repository/{id}/package

Authentication: Bearer token

Parameters

id string path Required
path string query Required

Package folder (e.g. juridica).

ref string 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"

Test the connection (credential, branch, environment file) and list its packages.

GET /platform-infrastructure/git-repository/{id}/test

Authentication: Bearer token

Parameters

id string path Required
ref string 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"

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

id string path Required
path string query

Folder relative to the connection root. Empty for the root.

ref string 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"

Get git repository connections by query selector.

GET /platform-infrastructure/git-repository/{queryselector}

Authentication: Bearer token

Parameters

queryselector enum path Required

idorganization-idallcatalogsstatus

search string query

Id (queryselector id) or organization id (queryselector organization-id).

Responses

  • 200 OK.
curl -X GET https://api.sommatic.ai/platform-infrastructure/git-repository/id \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
Response 200
{
  "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_id string Required
expected_commit string Required

Commit returned by preview.

resource_id string
key string
path string
keys array<string>

With path, apply only these keys of the package.

publish boolean
description string

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>"
  }'
Response 200
{
  "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_id string Required
resource_id string Required
kind string
Allowed values workflowsknowledge
key string

Logical key; defaults to the declared key or ..

package_path string

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>"
  }'
Response 200
{
  "status": 200,
  "success": true,
  "message": "Operation completed successfully",
  "result": {
    "repository_id": "<repository_id>",
    "resource_id": "<resource_id>"
  }
}

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_id string Required
resource_id string

Physical id of a workflow or knowledge resource.

key string

Logical key (e.g. support.triage).

path string

Package folder; previews every resource of the package.

ref string

Optional branch, tag or commit.

include_content boolean

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>"
  }'
Response 200
{
  "status": 200,
  "success": true,
  "message": "Operation completed successfully",
  "result": {
    "repository_id": "<repository_id>"
  }
}

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs