OneOS Docs
Genesis 0.3.1 Console

API reference

Loom

Git hosting: private repositories, branches and tags, clone access, protected branches, pull requests and checks.

Operations
30
Base path
https://os.one.ml/api/v1/loom
Scopes
loom:admin loom:read loom:write
API keys
—
SDK
genesis.call('loom_listRepos', …) · helpers under genesis.loom
CLI
genesis loom
MCP
28 tools; the other 2 through genesis_call

Operations

OperationEndpointAPI key
List reposGET/repos—
Create a private repoPOST/repos—
Get a repoGET/repos/{repo}—
Move a repo to trashDELETE/repos/{repo}—
Rename a repo, describe it or change its default branchPATCH/repos/{repo}—
Bring branches in from a git bundlePOST/repos/{repo}/bundles—
List the checks on a commitGET/repos/{repo}/checks—
Ask OneOS CI again for a branch's latest commitPOST/repos/{repo}/ci/runs—
What Loom asked of OneOS CI for this repo, newest firstGET/repos/{repo}/ci/triggers—
Mint a short-lived clone token for one repoPOST/repos/{repo}/clone-tokens—
Revoke every live clone token of a repoDELETE/repos/{repo}/clone-tokens—
Revoke one clone tokenDELETE/repos/{repo}/clone-tokens/{token_id}—
List a repo's protected-branch rulesGET/repos/{repo}/protections—
Protect branches (create or replace the rule for a pattern)PUT/repos/{repo}/protections—
Remove the protected-branch rule for a patternDELETE/repos/{repo}/protections—
List pull requestsGET/repos/{repo}/pulls—
Open a pull request (merge branch head into base)POST/repos/{repo}/pulls—
Get a pull request and what stands between it and a mergeGET/repos/{repo}/pulls/{number}—
Retitle, describe, close or reopen a pull requestPATCH/repos/{repo}/pulls/{number}—
List a pull request's commentsGET/repos/{repo}/pulls/{number}/comments—
Comment on a pull request, or on a line of a file in itPOST/repos/{repo}/pulls/{number}/comments—
The commits a pull request bringsGET/repos/{repo}/pulls/{number}/commits—
The diff a reviewer readsGET/repos/{repo}/pulls/{number}/diff—
Merge a pull request with a merge commitPOST/repos/{repo}/pulls/{number}/merge—
List a pull request's reviewsGET/repos/{repo}/pulls/{number}/reviews—
Review a pull request (approve, request changes or comment)POST/repos/{repo}/pulls/{number}/reviews—
List a repo's branches and tagsGET/repos/{repo}/refs—
Restore a trashed repoPOST/repos/{repo}/restore—
Report a check on a commit (any name but oneos-ci*)POST/repos/{repo}/statuses—
Show the identity, environment and selected project Loom sees for your credentialGET/whoami—

Repos

List repos

GET/v1/loom/repos

loom:readloom_listRepos

Scope loom:read. Newest first, at most 500. Trashed repos are listed only with deleted=true.

Parameters

  • project_idquery · string
  • namequery · string
  • deletedquery · boolean

Responses

  • 200Repos
    Response fields
    • dataobject[]required
    • data[].[].idstringrequired

      pattern ^lr_[a-z2-7]{26}$

    • data[].[].namestringrequired

      1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

    • data[].[].project_idstringrequired
    • data[].[].descriptionstring | null
    • data[].[].visibility"private"required
    • data[].[].default_branchstringrequired
    • data[].[].last_commitstring | null

      The default branch's commit

    • data[].[].size_bytesintegerrequired

      Size of the stored snapshot

    • data[].[].seqintegerrequired

      The repo version: 0 when empty, +1 on every change to its branches or tags

    • data[].[].created_byobjectrequired
    • data[].[].created_by.kindstring
    • data[].[].created_by.idstring
    • data[].[].sourceany
    • data[].[].clone_urlstring | null
    • data[].[].versionintegerrequired

      The metadata version, for If-Match

    • data[].[].created_atstring (date-time)required
    • data[].[].updated_atstring (date-time)required
    • data[].[].pushed_atstring | null (date-time)
    • data[].[].deleted_atstring | null (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 422The request is invalid or too large
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Create a private repo

POST/v1/loom/repos

loom:writeIdempotency-Key optionalloom_createRepo

Scope loom:write. The repo is made in your selected project (a project_id naming any other is a 403; with no selected project, a 403). An Idempotency-Key makes a retry return the same repo (200); the same key with another name is a 409 idempotency_mismatch. Names are unique in the org (409 name_taken); an org holds at most 200 repos (409 repo_limit). A new repo is empty (seq 0).

Parameters

  • Idempotency-Keyheader · string

Request body application/json

  • namestringrequired

    1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

  • project_idstring

    Optional; must be your selected project pattern ^pr_[A-Za-z0-9_-]{1,128}$

  • descriptionstring | null

    max length 1000

  • sourceobject

    Where the code came from, e.g. {"kind":"build","build_id":"…"} (at most 2000 bytes)

Responses

  • 200The repo this Idempotency-Key already created
    Response fields
    • idstringrequired

      pattern ^lr_[a-z2-7]{26}$

    • namestringrequired

      1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

    • project_idstringrequired
    • descriptionstring | null
    • visibility"private"required
    • default_branchstringrequired
    • last_commitstring | null

      The default branch's commit

    • size_bytesintegerrequired

      Size of the stored snapshot

    • seqintegerrequired

      The repo version: 0 when empty, +1 on every change to its branches or tags

    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • sourceany
    • clone_urlstring | null
    • versionintegerrequired

      The metadata version, for If-Match

    • created_atstring (date-time)required
    • updated_atstring (date-time)required
    • pushed_atstring | null (date-time)
    • deleted_atstring | null (date-time)
  • 201Repo created
    Response fields
    • idstringrequired

      pattern ^lr_[a-z2-7]{26}$

    • namestringrequired

      1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

    • project_idstringrequired
    • descriptionstring | null
    • visibility"private"required
    • default_branchstringrequired
    • last_commitstring | null

      The default branch's commit

    • size_bytesintegerrequired

      Size of the stored snapshot

    • seqintegerrequired

      The repo version: 0 when empty, +1 on every change to its branches or tags

    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • sourceany
    • clone_urlstring | null
    • versionintegerrequired

      The metadata version, for If-Match

    • created_atstring (date-time)required
    • updated_atstring (date-time)required
    • pushed_atstring | null (date-time)
    • deleted_atstring | null (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string"
  }'

Get a repo

GET/v1/loom/repos/{repo}

loom:readloom_getRepo

Scope loom:read. The ETag is the repo's version, for If-Match on update.

Parameters

  • repopath · stringrequired

Responses

  • 200The repo
    Response fields
    • idstringrequired

      pattern ^lr_[a-z2-7]{26}$

    • namestringrequired

      1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

    • project_idstringrequired
    • descriptionstring | null
    • visibility"private"required
    • default_branchstringrequired
    • last_commitstring | null

      The default branch's commit

    • size_bytesintegerrequired

      Size of the stored snapshot

    • seqintegerrequired

      The repo version: 0 when empty, +1 on every change to its branches or tags

    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • sourceany
    • clone_urlstring | null
    • versionintegerrequired

      The metadata version, for If-Match

    • created_atstring (date-time)required
    • updated_atstring (date-time)required
    • pushed_atstring | null (date-time)
    • deleted_atstring | null (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Move a repo to trash

DELETE/v1/loom/repos/{repo}

loom:adminloom_trashRepo

Scope loom:admin. The repo stops answering git and its name is free at once; restore it within 30 days.

Parameters

  • repopath · stringrequired

Responses

  • 200The trashed repo
    Response fields
    • idstringrequired

      pattern ^lr_[a-z2-7]{26}$

    • namestringrequired

      1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

    • project_idstringrequired
    • descriptionstring | null
    • visibility"private"required
    • default_branchstringrequired
    • last_commitstring | null

      The default branch's commit

    • size_bytesintegerrequired

      Size of the stored snapshot

    • seqintegerrequired

      The repo version: 0 when empty, +1 on every change to its branches or tags

    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • sourceany
    • clone_urlstring | null
    • versionintegerrequired

      The metadata version, for If-Match

    • created_atstring (date-time)required
    • updated_atstring (date-time)required
    • pushed_atstring | null (date-time)
    • deleted_atstring | null (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 4xx 5xxThe error envelope.
curl -X DELETE "https://os.one.ml/api/v1/loom/repos/$REPO" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Rename a repo, describe it or change its default branch

PATCH/v1/loom/repos/{repo}

loom:writeloom_updateRepo

Scope loom:write; a rename also needs loom:admin. Needs If-Match with the version you read (409 version_mismatch otherwise). Clone URLs use the repo id, so a rename never breaks them. The default branch must exist.

Parameters

  • repopath · stringrequired
  • If-Matchheader · stringrequired

Request body application/json

  • namestring

    1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

  • descriptionstring | null

    max length 1000

  • default_branchstring

    max length 200

Responses

  • 200The updated repo
    Response fields
    • idstringrequired

      pattern ^lr_[a-z2-7]{26}$

    • namestringrequired

      1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

    • project_idstringrequired
    • descriptionstring | null
    • visibility"private"required
    • default_branchstringrequired
    • last_commitstring | null

      The default branch's commit

    • size_bytesintegerrequired

      Size of the stored snapshot

    • seqintegerrequired

      The repo version: 0 when empty, +1 on every change to its branches or tags

    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • sourceany
    • clone_urlstring | null
    • versionintegerrequired

      The metadata version, for If-Match

    • created_atstring (date-time)required
    • updated_atstring (date-time)required
    • pushed_atstring | null (date-time)
    • deleted_atstring | null (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 4xx 5xxThe error envelope.
curl -X PATCH "https://os.one.ml/api/v1/loom/repos/$REPO" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Bundles

Bring branches in from a git bundle

POST/v1/loom/repos/{repo}/bundles

loom:writeloom_importBundle

Scope loom:write. The body is a git bundle (at most 100 MB) that is complete or builds on commits the repo has. New branches are created and branches only move forward. A branch that would lose commits is a 409 non_fast_forward (details.branches), or with mode=side-branch is kept beside it as one/rewrite-<time>/<branch>. Sending the same bundle again changes nothing. A file over 50 MB is a 413 file_too_large.

Request bodies sent through https://os.one.ml/api are limited to 2 MiB.

Parameters

  • repopath · stringrequired
  • modequery · "ff" | "side-branch"

Request body application/octet-stream

Type: string (binary)

Responses

  • 200What moved, and the repo at its new version
    Response fields
    • repoobjectrequired
    • repo.idstringrequired

      pattern ^lr_[a-z2-7]{26}$

    • repo.namestringrequired

      1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

    • repo.project_idstringrequired
    • repo.descriptionstring | null
    • repo.visibility"private"required
    • repo.default_branchstringrequired
    • repo.last_commitstring | null

      The default branch's commit

    • repo.size_bytesintegerrequired

      Size of the stored snapshot

    • repo.seqintegerrequired

      The repo version: 0 when empty, +1 on every change to its branches or tags

    • repo.created_byobjectrequired
    • repo.created_by.kindstring
    • repo.created_by.idstring
    • repo.sourceany
    • repo.clone_urlstring | null
    • repo.versionintegerrequired

      The metadata version, for If-Match

    • repo.created_atstring (date-time)required
    • repo.updated_atstring (date-time)required
    • repo.pushed_atstring | null (date-time)
    • repo.deleted_atstring | null (date-time)
    • changedbooleanrequired
    • updatedobject[]required
    • updated[].[].branchstring
    • updated[].[].fromstring | null
    • updated[].[].tostring
    • side_branchesobject[]required
    • side_branches[].[].branchstring
    • side_branches[].[].kept_asstring
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 413The request is invalid or too large
  • 422The request is invalid or too large
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos/$REPO/bundles" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @body.bin

Checks

List the checks on a commit

GET/v1/loom/repos/{repo}/checks

loom:readloom_listChecks

Scope loom:read. oneos-ci and oneos-ci/<pipeline>/<job> come only from the OneOS CI runs Loom itself started for this repo (never another run of the same commit); other names are statuses posted with createStatus. oneos-ci is the whole: the latest push run and the latest change run of each pull request together (any failed: failure; any running: in progress; else success, or skipped when nothing ran). A required oneos-ci passes only on success; other required checks also on skipped or neutral.

Parameters

  • repopath · stringrequired
  • shaquery · stringrequired

Responses

  • 200Checks
    Response fields
    • shastringrequired
    • dataobject[]required
    • data[].[].namestringrequired
    • data[].[].shastringrequired
    • data[].[].source"oneos-ci" | "external"required
    • data[].[].status"queued" | "in_progress" | "completed"required
    • data[].[].conclusionstring | null
    • data[].[].summarystring | null
    • data[].[].details_urlstring | null
    • data[].[].ci_run_idstring | null
    • data[].[].created_bystring
    • data[].[].updated_atstring (date-time)required
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/checks?sha=$SHA" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Ci

Ask OneOS CI again for a branch's latest commit

POST/v1/loom/repos/{repo}/ci/runs

loom:writeloom_runCi

Scope loom:write. Every push already asks OneOS CI for a run of each updated branch whose commit has .oneos/ci.yml (and a change run for each open pull request on it); this starts new ones for the branch's tip. 409 no_ci_config when the commit has no .oneos/ci.yml.

Parameters

  • repopath · stringrequired

Request body application/json

  • branchstringrequired

    max length 200

Responses

  • 200What was asked of OneOS CI
    Response fields
    • branchstringrequired
    • shastringrequired
    • triggersobject[]required
    • triggers[].[].idstringrequired
    • triggers[].[].refstringrequired
    • triggers[].[].shastringrequired
    • triggers[].[].trigger"push" | "change"required
    • triggers[].[].pull_idstring | null
    • triggers[].[].idempotency_keystring

      The OneOS CI run key (loom-forge:…); only Loom creates runs under it

    • triggers[].[].outcome"sending" | "sent" | "failed"required

      failed: OneOS CI could not be reached; Loom asks again (same key) for 6 hours, up to 5 tries

    • triggers[].[].attemptsinteger
    • triggers[].[].run_idstring | null

      The OneOS CI run (ci_runs_get)

    • triggers[].[].run_status"queued" | "in_progress" | "completed" | null
    • triggers[].[].run_conclusionstring | null
    • triggers[].[].errorstring | null
    • triggers[].[].created_bystring
    • triggers[].[].created_atstring (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos/$REPO/ci/runs" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "branch": "string"
  }'

What Loom asked of OneOS CI for this repo, newest first

GET/v1/loom/repos/{repo}/ci/triggers

loom:readloom_listCiTriggers

Scope loom:read. Each push or pull request trigger, with the run id, or the error when OneOS CI could not be reached.

Parameters

  • repopath · stringrequired

Responses

  • 200Triggers
    Response fields
    • dataobject[]required
    • data[].[].idstringrequired
    • data[].[].refstringrequired
    • data[].[].shastringrequired
    • data[].[].trigger"push" | "change"required
    • data[].[].pull_idstring | null
    • data[].[].idempotency_keystring

      The OneOS CI run key (loom-forge:…); only Loom creates runs under it

    • data[].[].outcome"sending" | "sent" | "failed"required

      failed: OneOS CI could not be reached; Loom asks again (same key) for 6 hours, up to 5 tries

    • data[].[].attemptsinteger
    • data[].[].run_idstring | null

      The OneOS CI run (ci_runs_get)

    • data[].[].run_status"queued" | "in_progress" | "completed" | null
    • data[].[].run_conclusionstring | null
    • data[].[].errorstring | null
    • data[].[].created_bystring
    • data[].[].created_atstring (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/ci/triggers" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Clone tokens

Mint a short-lived clone token for one repo

POST/v1/loom/repos/{repo}/clone-tokens

loom:writeloom_createCloneToken

Scope loom:write (it hands out read access to the repo). The token can only clone and fetch this one repo, and it reads ALL of the repo's refs (branches and tags): sha is recorded for audit and does not narrow what the token can fetch. The repo, the lifetime (at most 2 hours) and revocation are its boundary; revoke one token with DELETE /v1/repos/{repo}/clone-tokens/{token_id} or every live token of the repo with DELETE /v1/repos/{repo}/clone-tokens. OneOS CI uses it on Loom's own Cloud Run URL: git over git_path with HTTP Basic auth, username x-token and the token as the password. The token is a secret: it is returned once, never stored in plain text, and must never be logged, put in a URL or given to a model.

Parameters

  • repopath · stringrequired

Request body application/json

  • shastring

    Optional; the commit the minter means to clone (recorded for audit; the token still reads all refs) pattern ^[0-9a-f]{40}$

  • ttl_sinteger

    Lifetime in seconds min 60 · max 7200 · default 3600

  • purposestring

    What the token is for, e.g. oneos-ci:run_123 (recorded, not secret) pattern ^[A-Za-z0-9:._@/-]{1,128}$

Responses

  • 201The clone token (secret; shown once)
    Response fields
    • tokenstringrequired

      Secret read token (lct1.…): the Basic auth password; never log it pattern ^lct1\.

    • token_idstringrequired

      The token's public id, for audit and revocation (not secret) pattern ^[A-Za-z0-9_-]{16}$

    • repostringrequired

      pattern ^lr_[a-z2-7]{26}$

    • shastring | null

      The commit the minter named (audit only; the token reads all refs), or null

    • expires_atstring (date-time)required
    • username"x-token"required

      The Basic auth username

    • git_pathstringrequired

      The git smart-HTTP path on Loom's Cloud Run URL, /v1/token-git/{repo}

    • clone_urlstring

      The full token-git URL on Loom's Cloud Run origin, when Loom knows it

  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 422The request is invalid or too large
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos/$REPO/clone-tokens" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Revoke every live clone token of a repo

DELETE/v1/loom/repos/{repo}/clone-tokens

loom:writeloom_revokeCloneTokens

Scope loom:write. Revokes every unexpired, unrevoked clone token of this repo at once (a leak, a finished build); revoked is how many, and may be 0. Returns no secret.

Parameters

  • repopath · stringrequired

Responses

  • 200How many tokens were revoked
    Response fields
    • repostringrequired

      pattern ^lr_[a-z2-7]{26}$

    • revokedintegerrequired

      How many live tokens were revoked min 0

  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 4xx 5xxThe error envelope.
curl -X DELETE "https://os.one.ml/api/v1/loom/repos/$REPO/clone-tokens" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Revoke one clone token

DELETE/v1/loom/repos/{repo}/clone-tokens/{token_id}

loom:writeloom_revokeCloneToken

Scope loom:write. Revokes the clone token with this token_id (the public id returned at mint, never the secret). A 404 when no live token of this repo has that id (unknown, expired or already revoked). Returns no secret.

Parameters

  • repopath · stringrequired
  • token_idpath · stringrequired

Responses

  • 200The token was revoked (revoked is 1)
    Response fields
    • repostringrequired

      pattern ^lr_[a-z2-7]{26}$

    • revokedintegerrequired

      How many live tokens were revoked min 0

  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 4xx 5xxThe error envelope.
curl -X DELETE "https://os.one.ml/api/v1/loom/repos/$REPO/clone-tokens/$TOKEN_ID" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Protections

List a repo's protected-branch rules

GET/v1/loom/repos/{repo}/protections

loom:readloom_listProtections

Scope loom:read. A rule names a branch pattern (* matches any characters, / included). Every matching rule applies and the strictest wins. Any rule refuses deleting or force-pushing a matching branch; a rule with required approvals or checks (merge_only) also refuses direct pushes to an existing branch, so changes land through a pull request merge. Nobody bypasses a rule, admins included.

Parameters

  • repopath · stringrequired

Responses

  • 200Rules
    Response fields
    • dataobject[]required
    • data[].[].patternstringrequired
    • data[].[].required_approvalsintegerrequired
    • data[].[].required_checksstring[]required
    • data[].[].allow_force_pushfalserequired
    • data[].[].allow_deletionfalserequired
    • data[].[].merge_onlybooleanrequired

      True when approvals or checks are required: no direct push to an existing matching branch, and only an admin creates a matching branch (except the first branches of an empty repo)

    • data[].[].approvals_from"people" | "anyone"

      people (default): only signed-in people's approvals count; anyone: keys and agents too

    • data[].[].created_bystring
    • data[].[].created_atstring (date-time)
    • data[].[].updated_atstring (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/protections" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Protect branches (create or replace the rule for a pattern)

PUT/v1/loom/repos/{repo}/protections

loom:adminloom_setProtection

Scope loom:admin. required_approvals (0-10) counts approvals at the pull request's latest commit, never the author's or those of anyone whose code the head branch carries (who pushed it, and the authors, pushers and mergers of pull requests merged into it), and by default only people's (approvals_from); required_checks lists check names that must pass at that commit (oneos-ci for the whole OneOS CI run, oneos-ci/<pipeline>/<job> for one job, or any status name). allow_force_push and allow_deletion may only be false. At most 50 rules per repo.

Parameters

  • repopath · stringrequired

Request body application/json

  • patternstringrequired

    A branch name; * matches any characters (e.g. main, release/*) pattern ^[A-Za-z0-9._/*-]{1,200}$

  • required_approvalsinteger

    min 0 · max 10

  • required_checksstring[]
  • allow_force_pushfalse
  • allow_deletionfalse
  • approvals_from"people" | "anyone"

    Whose approvals count (default people: signed-in people only, so nobody approves through their own key or agent)

Responses

  • 200The rule
    Response fields
    • patternstringrequired
    • required_approvalsintegerrequired
    • required_checksstring[]required
    • allow_force_pushfalserequired
    • allow_deletionfalserequired
    • merge_onlybooleanrequired

      True when approvals or checks are required: no direct push to an existing matching branch, and only an admin creates a matching branch (except the first branches of an empty repo)

    • approvals_from"people" | "anyone"

      people (default): only signed-in people's approvals count; anyone: keys and agents too

    • created_bystring
    • created_atstring (date-time)
    • updated_atstring (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl -X PUT "https://os.one.ml/api/v1/loom/repos/$REPO/protections" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pattern": "string"
  }'

Remove the protected-branch rule for a pattern

DELETE/v1/loom/repos/{repo}/protections

loom:adminloom_deleteProtection

Scope loom:admin.

Parameters

  • repopath · stringrequired
  • patternquery · stringrequired

Responses

  • 200Removed
    Response fields
    • patternstringrequired
    • deletedbooleanrequired
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl -X DELETE "https://os.one.ml/api/v1/loom/repos/$REPO/protections?pattern=$PATTERN" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Pulls

List pull requests

GET/v1/loom/repos/{repo}/pulls

loom:readloom_listPulls

Scope loom:read. Newest first, at most 200. state defaults to open.

Parameters

  • repopath · stringrequired
  • statequery · "open" | "closed" | "merged" | "all"

Responses

  • 200Pull requests
    Response fields
    • dataobject[]required
    • data[].[].idstringrequired

      pattern ^lp_[a-z2-7]{26}$

    • data[].[].numberintegerrequired

      min 1

    • data[].[].repo_idstringrequired
    • data[].[].titlestringrequired
    • data[].[].bodystring | null
    • data[].[].state"open" | "closed" | "merged"required
    • data[].[].headstringrequired
    • data[].[].basestringrequired
    • data[].[].head_shastringrequired

      The head's last seen commit

    • data[].[].base_shastringrequired

      The base's last seen commit (once merged: the base before the merge)

    • data[].[].merge_commitstring | null
    • data[].[].merged_bystring | null
    • data[].[].merged_atstring | null (date-time)
    • data[].[].closed_atstring | null (date-time)
    • data[].[].created_byobjectrequired
    • data[].[].created_by.kindstring
    • data[].[].created_by.idstring
    • data[].[].versionintegerrequired
    • data[].[].created_atstring (date-time)required
    • data[].[].updated_atstring (date-time)required
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/pulls" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Open a pull request (merge branch head into base)

POST/v1/loom/repos/{repo}/pulls

loom:writeloom_openPull

Scope loom:write. Both branches must exist in the repo; base defaults to the default branch. If a pull request with the same head and base is already open, that one is returned (200). When the head commit has .oneos/ci.yml, OneOS CI starts a change run for it.

Parameters

  • repopath · stringrequired

Request body application/json

  • titlestringrequired

    min length 1 · max length 256

  • bodystring | null

    max length 65536

  • headstringrequired

    The branch with the changes max length 200

  • basestring

    The branch to merge into (default: the repo's default branch) max length 200

Responses

  • 200The pull request already open for this head and base
    Response fields
    • idstringrequired

      pattern ^lp_[a-z2-7]{26}$

    • numberintegerrequired

      min 1

    • repo_idstringrequired
    • titlestringrequired
    • bodystring | null
    • state"open" | "closed" | "merged"required
    • headstringrequired
    • basestringrequired
    • head_shastringrequired

      The head's last seen commit

    • base_shastringrequired

      The base's last seen commit (once merged: the base before the merge)

    • merge_commitstring | null
    • merged_bystring | null
    • merged_atstring | null (date-time)
    • closed_atstring | null (date-time)
    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • versionintegerrequired
    • created_atstring (date-time)required
    • updated_atstring (date-time)required
  • 201Opened
    Response fields
    • idstringrequired

      pattern ^lp_[a-z2-7]{26}$

    • numberintegerrequired

      min 1

    • repo_idstringrequired
    • titlestringrequired
    • bodystring | null
    • state"open" | "closed" | "merged"required
    • headstringrequired
    • basestringrequired
    • head_shastringrequired

      The head's last seen commit

    • base_shastringrequired

      The base's last seen commit (once merged: the base before the merge)

    • merge_commitstring | null
    • merged_bystring | null
    • merged_atstring | null (date-time)
    • closed_atstring | null (date-time)
    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • versionintegerrequired
    • created_atstring (date-time)required
    • updated_atstring (date-time)required
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos/$REPO/pulls" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "string",
    "head": "string"
  }'

Get a pull request and what stands between it and a merge

GET/v1/loom/repos/{repo}/pulls/{number}

loom:readloom_getPull

Scope loom:read. While open, status reads the branches live: the head and base commits, whether they merge cleanly, the base's protection, approvals at the latest commit, the checks on it, and every blocker (approvals, changes_requested, check_missing, check_pending, check_failed, conflict, head_missing, base_missing, nothing_to_merge). can_merge is true when there is none.

Parameters

  • repopath · stringrequired
  • numberpath · integerrequired

Responses

  • 200The pull request
    Response fields
    • idstringrequired

      pattern ^lp_[a-z2-7]{26}$

    • numberintegerrequired

      min 1

    • repo_idstringrequired
    • titlestringrequired
    • bodystring | null
    • state"open" | "closed" | "merged"required
    • headstringrequired
    • basestringrequired
    • head_shastringrequired

      The head's last seen commit

    • base_shastringrequired

      The base's last seen commit (once merged: the base before the merge)

    • merge_commitstring | null
    • merged_bystring | null
    • merged_atstring | null (date-time)
    • closed_atstring | null (date-time)
    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • versionintegerrequired
    • created_atstring (date-time)required
    • updated_atstring (date-time)required
    • statusobject | null

      Null once merged or closed

    • status.head_shastring | null
    • status.base_shastring | null
    • status.mergeableboolean | null
    • status.can_mergeboolean
    • status.protectionobject | null
    • status.protection.patternsstring[]
    • status.protection.required_approvalsinteger
    • status.protection.required_checksstring[]
    • status.protection.approvals_from"people" | "anyone"
    • status.approvalsstring[]

      Principals whose approval counts at the latest commit

    • status.changes_requested_bystring[]
    • status.checksobject[]
    • status.checks[].[].namestringrequired
    • status.checks[].[].shastringrequired
    • status.checks[].[].source"oneos-ci" | "external"required
    • status.checks[].[].status"queued" | "in_progress" | "completed"required
    • status.checks[].[].conclusionstring | null
    • status.checks[].[].summarystring | null
    • status.checks[].[].details_urlstring | null
    • status.checks[].[].ci_run_idstring | null
    • status.checks[].[].created_bystring
    • status.checks[].[].updated_atstring (date-time)required
    • status.blockersobject[]
    • status.blockers[].[].code"approvals" | "changes_requested" | "check_missing" | "check_pending" | "check_failed" | "conflict" | "head_missing" | "base_missing" | "nothing_to_merge" | "not_open"required
    • status.blockers[].[].messagestringrequired
    • status.blockers[].[].checkstring
    • status.blockers[].[].pathsstring[]
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/pulls/$NUMBER" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Retitle, describe, close or reopen a pull request

PATCH/v1/loom/repos/{repo}/pulls/{number}

loom:writeloom_updatePull

Scope loom:write. state is open or closed (merging is mergePull). A merged pull request does not change. An optional If-Match with the version you read guards against a concurrent change.

Parameters

  • repopath · stringrequired
  • numberpath · integerrequired

Request body application/json

  • titlestring

    min length 1 · max length 256

  • bodystring | null

    max length 65536

  • state"open" | "closed"

Responses

  • 200The pull request
    Response fields
    • idstringrequired

      pattern ^lp_[a-z2-7]{26}$

    • numberintegerrequired

      min 1

    • repo_idstringrequired
    • titlestringrequired
    • bodystring | null
    • state"open" | "closed" | "merged"required
    • headstringrequired
    • basestringrequired
    • head_shastringrequired

      The head's last seen commit

    • base_shastringrequired

      The base's last seen commit (once merged: the base before the merge)

    • merge_commitstring | null
    • merged_bystring | null
    • merged_atstring | null (date-time)
    • closed_atstring | null (date-time)
    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • versionintegerrequired
    • created_atstring (date-time)required
    • updated_atstring (date-time)required
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl -X PATCH "https://os.one.ml/api/v1/loom/repos/$REPO/pulls/$NUMBER" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

List a pull request's comments

GET/v1/loom/repos/{repo}/pulls/{number}/comments

loom:readloom_listPullComments

Scope loom:read. Oldest first.

Parameters

  • repopath · stringrequired
  • numberpath · integerrequired

Responses

  • 200Comments
    Response fields
    • dataobject[]required
    • data[].[].idstringrequired
    • data[].[].bodystringrequired
    • data[].[].pathstring | null
    • data[].[].lineinteger | null
    • data[].[].shastring | null
    • data[].[].created_byobjectrequired
    • data[].[].created_by.kindstring
    • data[].[].created_by.idstring
    • data[].[].created_atstring (date-time)required
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/pulls/$NUMBER/comments" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Comment on a pull request, or on a line of a file in it

POST/v1/loom/repos/{repo}/pulls/{number}/comments

loom:writeloom_commentOnPull

Scope loom:write. A line needs a path; a file comment records the pull request's last seen head commit (sha).

Parameters

  • repopath · stringrequired
  • numberpath · integerrequired

Request body application/json

  • bodystringrequired

    min length 1 · max length 65536

  • pathstring | null

    max length 4096

  • lineinteger | null

    min 1

Responses

  • 201The comment
    Response fields
    • idstringrequired
    • bodystringrequired
    • pathstring | null
    • lineinteger | null
    • shastring | null
    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • created_atstring (date-time)required
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos/$REPO/pulls/$NUMBER/comments" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "string"
  }'

The commits a pull request brings

GET/v1/loom/repos/{repo}/pulls/{number}/commits

loom:readloom_listPullCommits

Scope loom:read. Newest first, at most 250.

Parameters

  • repopath · stringrequired
  • numberpath · integerrequired

Responses

  • 200Commits
    Response fields
    • dataobject[]required
    • data[].[].shastringrequired
    • data[].[].parentsstring[]required
    • data[].[].author_namestringrequired
    • data[].[].author_emailstringrequired
    • data[].[].authored_atstring (date-time)required
    • data[].[].messagestringrequired
    • truncatedbooleanrequired
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/pulls/$NUMBER/commits" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

The diff a reviewer reads

GET/v1/loom/repos/{repo}/pulls/{number}/diff

loom:readloom_getPullDiff

Scope loom:read. Files changed from the merge base to the head (renames found; line counts, null for binary files; at most 1000) and the unified patch, capped at 512 KB (patch_truncated). path limits the patch to one file.

Parameters

  • repopath · stringrequired
  • numberpath · integerrequired
  • pathquery · string

Responses

  • 200The diff
    Response fields
    • base_shastringrequired
    • head_shastringrequired
    • merge_basestringrequired
    • filesobject[]required
    • files[].[].pathstringrequired
    • files[].[].old_pathstring | null
    • files[].[].status"added" | "modified" | "deleted" | "renamed" | "copied" | "type_changed"required
    • files[].[].additionsinteger | null
    • files[].[].deletionsinteger | null
    • files[].[].binaryboolean
    • files_truncatedbooleanrequired
    • pathstring | null
    • patchstringrequired
    • patch_truncatedbooleanrequired
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/pulls/$NUMBER/diff" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Merge a pull request with a merge commit

POST/v1/loom/repos/{repo}/pulls/{number}/merge

loom:writeloom_mergePull

Scope loom:write. Always a merge commit whose parents are the base and the head (never a rebase or squash). Refused with 409 merge_blocked while any blocker stands (error.details.blockers, as in getPull), 409 head_changed when expected_head_sha is not the head. delete_branch removes the head branch afterwards unless it is protected, the default branch, or part of another open pull request. Merging moves the base, so OneOS CI starts a push run on the merge commit when it has .oneos/ci.yml.

Parameters

  • repopath · stringrequired
  • numberpath · integerrequired

Request body application/json

  • expected_head_shastring

    pattern ^[0-9a-f]{40}$

  • messagestring

    min length 1 · max length 65536

  • delete_branchboolean
  • method"merge"

Responses

  • 200Merged
    Response fields
    • pullobjectrequired
    • pull.idstringrequired

      pattern ^lp_[a-z2-7]{26}$

    • pull.numberintegerrequired

      min 1

    • pull.repo_idstringrequired
    • pull.titlestringrequired
    • pull.bodystring | null
    • pull.state"open" | "closed" | "merged"required
    • pull.headstringrequired
    • pull.basestringrequired
    • pull.head_shastringrequired

      The head's last seen commit

    • pull.base_shastringrequired

      The base's last seen commit (once merged: the base before the merge)

    • pull.merge_commitstring | null
    • pull.merged_bystring | null
    • pull.merged_atstring | null (date-time)
    • pull.closed_atstring | null (date-time)
    • pull.created_byobjectrequired
    • pull.created_by.kindstring
    • pull.created_by.idstring
    • pull.versionintegerrequired
    • pull.created_atstring (date-time)required
    • pull.updated_atstring (date-time)required
    • merge_commitstringrequired
    • head_branch_deletedbooleanrequired
    • repoobjectrequired
    • repo.idstringrequired

      pattern ^lr_[a-z2-7]{26}$

    • repo.namestringrequired

      1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

    • repo.project_idstringrequired
    • repo.descriptionstring | null
    • repo.visibility"private"required
    • repo.default_branchstringrequired
    • repo.last_commitstring | null

      The default branch's commit

    • repo.size_bytesintegerrequired

      Size of the stored snapshot

    • repo.seqintegerrequired

      The repo version: 0 when empty, +1 on every change to its branches or tags

    • repo.created_byobjectrequired
    • repo.created_by.kindstring
    • repo.created_by.idstring
    • repo.sourceany
    • repo.clone_urlstring | null
    • repo.versionintegerrequired

      The metadata version, for If-Match

    • repo.created_atstring (date-time)required
    • repo.updated_atstring (date-time)required
    • repo.pushed_atstring | null (date-time)
    • repo.deleted_atstring | null (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos/$REPO/pulls/$NUMBER/merge" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

List a pull request's reviews

GET/v1/loom/repos/{repo}/pulls/{number}/reviews

loom:readloom_listPullReviews

Scope loom:read. Oldest first.

Parameters

  • repopath · stringrequired
  • numberpath · integerrequired

Responses

  • 200Reviews
    Response fields
    • dataobject[]required
    • data[].[].idstringrequired
    • data[].[].state"approved" | "changes_requested" | "commented"required
    • data[].[].shastringrequired
    • data[].[].bodystring | null
    • data[].[].created_byobjectrequired
    • data[].[].created_by.kindstring
    • data[].[].created_by.idstring
    • data[].[].created_atstring (date-time)required
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/pulls/$NUMBER/reviews" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Review a pull request (approve, request changes or comment)

POST/v1/loom/repos/{repo}/pulls/{number}/reviews

loom:writeloom_reviewPull

Scope loom:write. The review is of the head's latest commit (sha, if given, must be it: 409 head_changed). An approval counts only while the head stays at that commit. The author may comment but not approve or request changes (403). A reviewer's latest request_changes blocks a protected merge until they approve.

Parameters

  • repopath · stringrequired
  • numberpath · integerrequired

Request body application/json

  • event"approve" | "request_changes" | "comment"required
  • bodystring | null

    Required for request_changes and comment max length 65536

  • shastring

    pattern ^[0-9a-f]{40}$

Responses

  • 201The review
    Response fields
    • idstringrequired
    • state"approved" | "changes_requested" | "commented"required
    • shastringrequired
    • bodystring | null
    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • created_atstring (date-time)required
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos/$REPO/pulls/$NUMBER/reviews" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "approve"
  }'

Refs

List a repo's branches and tags

GET/v1/loom/repos/{repo}/refs

loom:readloom_listRefs

Scope loom:read.

Parameters

  • repopath · stringrequired

Responses

  • 200Branches and tags at the repo's current version
    Response fields
    • default_branchstringrequired
    • seqintegerrequired
    • branchesobject[]required
    • branches[].[].namestringrequired
    • branches[].[].commitstringrequired
    • tagsobject[]required
    • tags[].[].namestringrequired
    • tags[].[].targetstringrequired
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/repos/$REPO/refs" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Restore

Restore a trashed repo

POST/v1/loom/repos/{repo}/restore

loom:adminloom_restoreRepo

Scope loom:admin. A 409 name_taken if another repo has taken its name; rename that one first.

Parameters

  • repopath · stringrequired

Responses

  • 200The restored repo
    Response fields
    • idstringrequired

      pattern ^lr_[a-z2-7]{26}$

    • namestringrequired

      1–64 of a-z, 0-9 and -, starting and ending with a letter or digit pattern ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$

    • project_idstringrequired
    • descriptionstring | null
    • visibility"private"required
    • default_branchstringrequired
    • last_commitstring | null

      The default branch's commit

    • size_bytesintegerrequired

      Size of the stored snapshot

    • seqintegerrequired

      The repo version: 0 when empty, +1 on every change to its branches or tags

    • created_byobjectrequired
    • created_by.kindstring
    • created_by.idstring
    • sourceany
    • clone_urlstring | null
    • versionintegerrequired

      The metadata version, for If-Match

    • created_atstring (date-time)required
    • updated_atstring (date-time)required
    • pushed_atstring | null (date-time)
    • deleted_atstring | null (date-time)
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 409name_taken, repo_limit, idempotency_mismatch, version_mismatch, non_fast_forward, retry, merge_blocked (details.blockers), head_changed, not_open, merged, pull_exists, pull_limit, protection_limit, comment_limit, gone, unrelated, no_ci_config or ci_unavailable; review_limit
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos/$REPO/restore" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

Statuses

Report a check on a commit (any name but oneos-ci*)

POST/v1/loom/repos/{repo}/statuses

loom:writeloom_createStatus

Scope loom:write. For any system that tests a commit: a Fleets task, an agent, an outside CI. The latest report for a (commit, name) replaces the one before. A protected branch can require the name.

Parameters

  • repopath · stringrequired

Request body application/json

  • shastringrequired

    pattern ^[0-9a-f]{40}$

  • namestringrequired

    pattern ^[A-Za-z0-9][A-Za-z0-9 ._:/-]{0,99}$

  • status"queued" | "in_progress" | "completed"required
  • conclusion"success" | "failure" | "cancelled" | "timed_out" | "skipped" | "neutral" | "action_required"

    Required when completed

  • summarystring | null

    max length 8000

  • details_urlstring | null

    pattern ^https://

Responses

  • 200The check
    Response fields
    • namestringrequired
    • shastringrequired
    • source"oneos-ci" | "external"required
    • status"queued" | "in_progress" | "completed"required
    • conclusionstring | null
    • summarystring | null
    • details_urlstring | null
    • ci_run_idstring | null
    • created_bystring
    • updated_atstring (date-time)required
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 404No such repo in this org and environment
  • 422The request is invalid or too large
  • 503Pull requests and CI are not available on this Loom
  • 4xx 5xxThe error envelope.
curl -X POST "https://os.one.ml/api/v1/loom/repos/$REPO/statuses" \
  -H "Authorization: Bearer $GENESIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sha": "string",
    "name": "string",
    "status": "queued"
  }'

Whoami

Show the identity, environment and selected project Loom sees for your credential

GET/v1/loom/whoami

loom:readloom_whoami

Scope loom:read.

Responses

  • 200Org, principal, kind, scopes, environment and the selected project
    Response fields
    • orgstringrequired
    • principalstringrequired
    • kindstringrequired
    • scopesstring[]required
    • tenant_environment"sandbox" | "live"required
    • project_idstring | nullrequired
  • 403The credential lacks the scope, or a delegated agent tried to write
  • 4xx 5xxThe error envelope.
curl "https://os.one.ml/api/v1/loom/whoami" \
  -H "Authorization: Bearer $GENESIS_API_KEY"

L1fe AI Inc. · Built from Genesis 0.3.1 and the live gateway on 2026-10-25. Support