Skip to content

`POST /api/workspace/repo_sync/pull` — clone/pull repo + apply YAML files to DB with last-write-wins. Returns parse outcomes + the sync event id/timestamp.

POST
/api/workspace/repo_sync/pull
curl --request POST \
--url https://example.com/api/workspace/repo_sync/pull \
--header 'Content-Type: application/json' \
--data '{ "selected_sops_paths": [ "example" ] }'

ADR 0023 v4 S2d — ?import_secrets=false skips vault writes for secrets/*.sops.yaml files (the wizard preview pass). The default is ON.

import_secrets
boolean

ADR 0023 v4 S2d — when false, SOPS secrets are scanned + decrypted (so the preview is accurate) but not written to vault. Default: true.

Media typeapplication/json
object
selected_sops_paths

Repo-relative SOPS file paths selected in the preview step. Omitted means “all”; empty means “none”.

Array<string> | null

Example generated

{
"selected_sops_paths": [
"example"
]
}

OK

Media typeapplication/json

What a pull returns to the HTTP caller.

object
commit_sha
required

The commit sha the pull operated against (the new HEAD).

string
db_namespace
One of:

ADR 0057 — a shared db namespace (db/namespace.yaml + db/migrations/) carried in the synced repo and applied this pull. None when the repo ships none — the UI can hide the section.

object
applied
required

Migration names actually applied to the schema this run.

Array<string>
failed
required

Per-step failures (resource/namespace resolution, a bad migration, apply).

Array<object>

One migration (or resolution step) that failed during a namespace import.

object
name
required
string
reason
required
string
handle
required

The namespace handle from the manifest.

string
namespace_id
required

The namespace row id (nil if resolution failed before creation).

string format: uuid
recorded
required

Migration names recorded into db_namespace_migrations.

Array<string>
schema
required

The resolved schema name (the manifest’s schema, else the handle).

string
event
required

Sync-event shape with event_id + timestamp.

object
commit_sha

The git commit sha the sync attempt operated against — None when no commit was made (push with no diff).

string | null
event_id
required
string format: uuid
kind
required

repo_sync_push_completed / repo_sync_pull_completed.

string
timestamp
required

RFC3339 timestamp (UTC). The string form keeps the wire format language-agnostic; the web client parses it back to a Date.

string
files_parsed
required

The number of repo-side files parsed (every YAML the scanner found under workflows/ / scripts/ / apps/).

integer
outcomes
required

One row per entity the pull touched (created / updated / skipped / failed). The order matches the audit log writes.

Array<object>

One row per entity affected by a pull.

object
action
required
string
reason

Set for skipped / failed rows; absent for the happy path.

string | null
target_id
string | null format: uuid
target_kind
required

Closed catalogue of sync targets a log row can reference.

string
Allowed values: workflow script app resource memory code_lib
target_slug
required
string
sops
One of:

ADR 0023 v4 S2d — summary of secrets/*.sops.yaml discovery + decrypt. None when the workspace has no SOPS key bootstrapped yet AND the repo carried no secrets — the UI can hide the section in that case.

object
decrypted
required

Number of files that decrypted successfully with the workspace age key.

integer
encrypted_files
required

Number of secrets/*.sops.yaml files the scanner found.

integer
failed
required

Per-file failure list — path + one-line reason.

Array<object>

One SOPS-file failure entry — path inside the repo + a one-line safe-to-display reason.

object
error
required

One-line reason — safe to surface to the UI.

string
path
required

Path inside the repo (e.g. secrets/foo.sops.yaml).

string
import_secrets_enabled
required

True if the import-flow caller set import_secrets=false. Mirrored back so the UI can re-render the toggle without a follow-up GET. Defaults to true (the wizard ships with the toggle ON).

boolean
written_to_vault
required

Number of vault writes that completed (subset of decrypted when the import_secrets toggle is off, equal to decrypted when on).

integer

Example

{
"outcomes": [
{
"target_kind": "workflow"
}
]
}