SDK reference

Repositories

Each route's function in the SDK, its call beside the same request in cURL.
orgGitCredentials

GET/v1/orgs/:orgId/git-credentials

The caller's machine keys in the org (names, scopes, expiry; never secrets).

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/git-credentials' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgGitCredentials

POST/v1/orgs/:orgId/git-credentials

Creates a key with the caller's git scopes in the org (git:read, and git:write when they hold it) for one machine, replacing the machine's previous key. The key is returned once; it expires after 90 days. Needs a second factor confirmed in the last 10 minutes (403 code: "step_up": the CLI runs ID's step-up sign-in and asks again), and tells the org's owners (security.git_key).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/git-credentials' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "machineId": "<machineId>",
    "machine": "example"
  }'
deleteOrgGitCredentialsByKeyId

DELETE/v1/orgs/:orgId/git-credentials/:keyId

Revokes one of the caller's machine keys.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/git-credentials/{keyId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposBranches

GET/v1/orgs/:orgId/repos/:name/branches

Branches with their last commit.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/branches' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposBranchesDivergence

GET/v1/orgs/:orgId/repos/:name/branches/divergence

Commits ahead of / behind the default branch, per name (repeatable), bounded.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/branches/divergence' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgReposBranches

POST/v1/orgs/:orgId/repos/:name/branches

Creates a branch from a branch, tag or commit.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/branches' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example",
    "from": "example"
  }'
deleteOrgReposBranches

DELETE/v1/orgs/:orgId/repos/:name/branches

Deletes the branch name. The default branch and branches whose rule blocks deletion can't be deleted.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/branches?name=Example' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposTags

GET/v1/orgs/:orgId/repos/:name/tags

Tags and their commits. Create tags by pushing them with git.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/tags' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgReposContents

POST/v1/orgs/:orgId/repos/:name/contents

Commits file changes from the web: add or replace (base64 content), move or delete files, on branch or a newBranch. Fails if the branch moved since parentCommitId, 403 where a branch rule needs a pull request (unless you're on its bypass list), and 422 secret_detected with the findings when secret scanning finds something nobody allowed.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/contents' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "branch": "example",
    "message": "example",
    "changes": [
      {}
    ]
  }'
postOrgReposContentsUploads

POST/v1/orgs/:orgId/repos/:name/contents/uploads

Presigned upload URLs for a large web commit, one per file (sizes in bytes); the commit then names uploadId and each file's upload index. Uploads not committed are removed after a day.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/contents/uploads' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "files": [
      {
        "size": 1
      }
    ]
  }'
postOrgReposContentsArchive

POST/v1/orgs/:orgId/repos/:name/contents/archive

ZIP of a branch, tag or commit built in the background (for archives too large for the portal): pending until it exists, then a download link valid for 15 minutes.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/contents/archive' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "ref": "example"
  }'
orgReposContentsRaw

GET/v1/orgs/:orgId/repos/:name/contents/raw

File bytes; the portal's /raw route serves them with the right type. Files over 4 MB (a Lambda response's limit, base64) answer JSON with x-si-raw: large instead: a download link from the staging bucket (ready), pending while the archiver fetches it, or failed.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/contents/raw?ref=example&path=example' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposContentsFiles

GET/v1/orgs/:orgId/repos/:name/contents/files

Every file path at a ref (for the file finder and archives), bounded.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/contents/files?ref=example' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgReposContentsBlobs

POST/v1/orgs/:orgId/repos/:name/contents/blobs

Blob contents (base64) in request order, as many as fit in one response; the caller asks again for the rest. Blobs too large for a response are marked tooLarge.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/contents/blobs' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "ids": [
      "example"
    ]
  }'
orgReposCompare

GET/v1/orgs/:orgId/repos/:name/compare

Commits and changed files on head since it diverged from base, whether it merges cleanly, and any open pull request between them.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/compare?base=example&head=example' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposLabels

GET/v1/orgs/:orgId/repos/:name/labels

The repository's labels.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/labels' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putOrgReposLabels

PUT/v1/orgs/:orgId/repos/:name/labels

Creates or updates a label by name.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/labels' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example",
    "color": "chart-1"
  }'
deleteOrgReposLabels

DELETE/v1/orgs/:orgId/repos/:name/labels

Deletes the label name and removes it from issues and pull requests.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/labels?name=Example' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposNotifications

GET/v1/orgs/:orgId/repos/-/notifications

Your email settings for issues and pull requests in the organization: all off, and the repositories you muted. People only.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/-/notifications' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putOrgReposNotifications

PUT/v1/orgs/:orgId/repos/-/notifications

Turns your email about issues and pull requests in the organization off (off: true) or back on. Muted repositories stay muted.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/-/notifications' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "off": true
  }'
putOrgReposByNameNotifications

PUT/v1/orgs/:orgId/repos/:name/notifications

Mutes (or unmutes) one repository for the person.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/notifications' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "muted": true
  }'
orgRepos

GET/v1/orgs/:orgId/repos

The organization's repositories with their default branch, language and last update.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposAvailable

GET/v1/orgs/:orgId/repos/-/available

Whether name can be used for a new repository, and why not.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/-/available?name=Example' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposPeople

GET/v1/orgs/:orgId/repos/-/people

Org members, for assignees and @mentions; with repo, only those who can read that repository.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/-/people' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgRepos

POST/v1/orgs/:orgId/repos

Creates a repository, optionally with a first commit holding a README, a .gitignore template (Node, Next.js, Python, Go or Rust) and a license (MIT or Apache 2.0).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example"
  }'
postOrgReposRename

POST/v1/orgs/:orgId/repos/:name/rename

Renames a repository. Clone URLs change with it.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/rename' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Example"
  }'
deleteOrgReposByName

DELETE/v1/orgs/:orgId/repos/:name

Deletes a repository with its history. confirm must be the repository name.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}?confirm=example' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposProtection

GET/v1/orgs/:orgId/repos/:name/protection

The default branch's protection: how many approvals pull requests into it need. The full rules are at branch-rules.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/protection' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putOrgReposProtection

PUT/v1/orgs/:orgId/repos/:name/protection

Sets how many approvals (0–10) pull requests into the default branch need before they can be merged, as the default branch's rule (which also blocks force pushes and deletion; its bypass list stays). 0 lets direct pushes in again. Needs git:admin.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/protection' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "requiredApprovals": 1
  }'
orgReposAccess

GET/v1/orgs/:orgId/repos/:name/access

Who can reach the repository: its mode, the people, groups and machines on its list with names for them, and the last change. For those who can read the repository, and for owners (who manage the list without seeing the code).

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/access' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putOrgReposAccess

PUT/v1/orgs/:orgId/repos/:name/access

Changes who can reach the repository: org owners only (a break-glass, audited), never through a key or an assistant.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/access' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "mode": "org",
    "users": [
      {
        "userId": "<userId>",
        "level": "read"
      }
    ],
    "teams": [
      {
        "teamId": "<teamId>",
        "level": "read"
      }
    ],
    "machines": [
      {
        "id": "<id>",
        "level": "read"
      }
    ]
  }'
postOrgReposChecks

POST/v1/orgs/:orgId/repos/:name/checks

Starts checks of a branch in a sandbox: install, then the typecheck, lint, test and build scripts (or cactive.json checks). Nothing is deployed. Returns checkId (202). Needs git:write.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/checks' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "branch": "example"
  }'
orgReposChecksByCheckId

GET/v1/orgs/:orgId/repos/:name/checks/:checkId

A check run's status (queued, running, passed, failed, stopped, timed_out), steps and the end of its output (tail lines, default 80).

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/checks/{checkId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
deleteOrgReposChecksByCheckId

DELETE/v1/orgs/:orgId/repos/:name/checks/:checkId

Stops a check run. Needs git:write.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/checks/{checkId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposBranchRules

GET/v1/orgs/:orgId/repos/:name/branch-rules

The branch rules in force (pull requests, approvals, code owners, force-push and deletion blocks, bypass list), whether they were saved or are the defaults, secret scanning (block or off), and the CODEOWNERS file found at the default branch with its errors.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/branch-rules' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putOrgReposBranchRules

PUT/v1/orgs/:orgId/repos/:name/branch-rules

Replaces the branch rules (up to 20; a name or a prefix ending in *) and optionally sets secret scanning. People on a bypass list must be able to write the repository. Open pull requests get the approval rules their target now asks for. Needs git:admin.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/branch-rules' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "rules": [
      {
        "branch": "example",
        "requirePullRequest": true,
        "requiredApprovals": 1,
        "requireCodeOwners": true,
        "blockForcePush": true,
        "blockDeletion": true
      }
    ]
  }'
postOrgReposSecretScanAllowances

POST/v1/orgs/:orgId/repos/:name/secret-scan/allowances

Says findings a push or commit was refused for aren't secrets: their fingerprints (1–20) with a reason. Covers your pushes and web commits in this repository for an hour; audited. People only, with git:write.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/secret-scan/allowances' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "fingerprints": [
      "example"
    ],
    "reason": "example"
  }'
postOrgReposBranchesPromote

POST/v1/orgs/:orgId/repos/:name/branches/promote

Fast-forwards a protected branch to the tip of from (for pushes too large for the git host to check), never forcing. Only where its rule lets you update it directly (you're on its bypass list, or it doesn't require pull requests), after a secret scan of the changes; audited.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/branches/promote' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "branch": "example",
    "from": "example"
  }'
orgReposBranchesPromoteByPromotionId

GET/v1/orgs/:orgId/repos/:name/branches/promote/:promotionId

A promotion that's still scanning: moves it on, then answers as POST …/branches/promote does. Only for whoever began it.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/branches/promote/{promotionId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposReadAudit

GET/v1/orgs/:orgId/repos/:name/read-audit

The repository's read auditing (all, clones or off) and whether owners get clone alerts, defaults filled in.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/read-audit' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putOrgReposReadAudit

PUT/v1/orgs/:orgId/repos/:name/read-audit

Changes which reads are recorded (readAudit) and clone alerts (cloneAlerts); audited as repo.read_audit_update.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/read-audit' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "readAudit": "all",
    "cloneAlerts": true
  }'
orgReposByName

GET/v1/orgs/:orgId/repos/:name

Repository details: description, default branch, branches and open issue and pull request counts.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
patchOrgReposByName

PATCH/v1/orgs/:orgId/repos/:name

Updates the description or the default branch.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "example",
    "defaultBranch": "example"
  }'
orgReposTree

GET/v1/orgs/:orgId/repos/:name/tree

Lists a directory at a branch or commit.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/tree' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposBlob

GET/v1/orgs/:orgId/repos/:name/blob

A file at a branch or commit. text is null for binary files and files over 1 MB. path is required.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/blob' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposCommits

GET/v1/orgs/:orgId/repos/:name/commits

First-parent history, newest first. With path, only commits that touch that file or folder (scanned reports how far the search went). Pass the returned next as cursor to continue.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/commits' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposLastCommits

GET/v1/orgs/:orgId/repos/:name/last-commits

The last commit that touched each entry of a folder. complete is false while more entries can be resolved by asking again (pending counts them, and their entries are null until then); once complete, null means older than the search reached. When the repository is busy the answer has head: null and nothing resolved; ask again.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/last-commits' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposLastCommit

GET/v1/orgs/:orgId/repos/:name/last-commit

The last commit that touched a file. complete is false while it can still be found by asking again; head: null means the repository was busy.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/last-commit?path=example' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposCommitsBySha

GET/v1/orgs/:orgId/repos/:name/commits/:sha

A commit and its changes against its first parent.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/commits/{sha}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
orgReposInsights

GET/v1/orgs/:orgId/repos/:name/insights

Contributors, weekly commit activity and languages for a branch (the default branch when ref is omitted).

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/insights' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"