Skip to main content
Synchronize pipeline definitions with a Git repository: configure remotes, push and pull changes, inspect sync status, validate credentials, and read commit history.
Use Authorization: Bearer <api_key>. See Authentication.

Base URL

https://api.planasonix.com

Get Git integration config

GET /api/git-integration
Response 200 OK
{
  "data": {
    "enabled": true,
    "provider": "github",
    "repository_url": "https://github.com/acme-analytics/planasonix-pipelines",
    "default_branch": "main",
    "path_prefix": "pipelines/",
    "ssh_key_id": "gitkey_01jq801",
    "author_name": "Planasonix Bot",
    "author_email": "bot@example.com",
    "last_sync_at": "2025-03-27T12:30:00Z"
  }
}
Response 200 OK (not configured)
{
  "data": {
    "enabled": false,
    "repository_url": null,
    "default_branch": null
  }
}

Save or update Git integration

POST /api/git-integration
Request body
{
  "enabled": true,
  "provider": "github",
  "repository_url": "https://github.com/acme-analytics/planasonix-pipelines",
  "default_branch": "main",
  "path_prefix": "pipelines/",
  "credentials": {
    "type": "github_app",
    "installation_id": "12345678"
  },
  "author_name": "Planasonix Bot",
  "author_email": "bot@example.com"
}
Response 200 OK
{
  "data": {
    "enabled": true,
    "provider": "github",
    "repository_url": "https://github.com/acme-analytics/planasonix-pipelines",
    "default_branch": "main",
    "path_prefix": "pipelines/",
    "updated_at": "2025-03-27T15:00:00Z"
  }
}

Remove Git integration

DELETE /api/git-integration
Disconnects the repository and clears stored credentials. Local pipeline drafts in Planasonix are unchanged. Response 204 No Content

Push pipeline to Git

POST /api/git-integration/push
Request body
{
  "branch": "feature/add-crm-sync",
  "message": "Add CRM incremental pipeline",
  "pipeline_ids": ["pl_01hqnew"],
  "create_pull_request": true,
  "pr_title": "Add CRM incremental pipeline",
  "pr_body": "Automated export from Planasonix."
}
Response 202 Accepted
{
  "data": {
    "operation_id": "gitop_01jq8push01",
    "status": "running",
    "branch": "feature/add-crm-sync"
  }
}

Pull pipeline from Git

POST /api/git-integration/pull
Request body
{
  "branch": "main",
  "strategy": "merge",
  "dry_run": false
}
Response 202 Accepted
{
  "data": {
    "operation_id": "gitop_01jq8pull01",
    "status": "running",
    "branch": "main"
  }
}

Get sync status

GET /api/git-integration/status
Response 200 OK
{
  "data": {
    "in_sync": false,
    "local_ahead_count": 2,
    "remote_ahead_count": 1,
    "last_successful_sync_at": "2025-03-26T18:00:00Z",
    "active_operation": {
      "id": "gitop_01jq8push01",
      "kind": "push",
      "status": "running",
      "started_at": "2025-03-27T15:02:00Z"
    },
    "conflicts": []
  }
}

Test Git connection

POST /api/git-integration/test
Request body (optional)
{
  "repository_url": "https://github.com/acme-analytics/planasonix-pipelines",
  "credentials": {
    "type": "token",
    "token": "ghp_xxxxxxxxxxxxxxxxxxxx"
  }
}
Omit repository_url and credentials to validate the saved integration. Response 200 OK
{
  "data": {
    "reachable": true,
    "permissions": ["read", "write"],
    "default_branch": "main",
    "latency_ms": 142
  }
}

Get commit history

GET /api/git-integration/history
Query parameters
ParameterDescription
branchBranch to read (defaults to configured default)
pathLimit to commits touching path_prefix subtree
limitMax commits (default 30)
Response 200 OK
{
  "data": [
    {
      "sha": "a1b2c3d4e5f6789012345678901234567890abcd",
      "message": "Fix orders dedupe keys",
      "author": "Alex Morgan <alex@example.com>",
      "committed_at": "2025-03-26T17:55:00Z",
      "pipeline_ids_touched": ["pl_01hqxyz"]
    },
    {
      "sha": "9f8e7d6c5b4a321098765432109876543210fedcb",
      "message": "Add staging models for Shopify",
      "author": "Planasonix Bot <bot@example.com>",
      "committed_at": "2025-03-25T09:12:00Z",
      "pipeline_ids_touched": ["pl_01hqabc", "pl_01hqdef"]
    }
  ]
}

Git integration

Branching model and UI workflows.

Import and convert

Bringing definitions from other tools.