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:adminloom:readloom:write- API keys
- —
- SDK
genesis.call('loom_listRepos', …)· helpers undergenesis.loom- CLI
genesis loom- MCP
- 28 tools; the other 2 through
genesis_call
Operations
Repos
List repos
GET/v1/loom/repos
Scope loom:read. Newest first, at most 500. Trashed repos are listed only with deleted=true.
Parameters
project_idquery · stringnamequery · stringdeletedquery · boolean
Responses
- 200Repos
Response fields
dataobject[]requireddata[].[].idstringrequiredpattern
^lr_[a-z2-7]{26}$data[].[].namestringrequired1–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_idstringrequireddata[].[].descriptionstring | nulldata[].[].visibility"private"requireddata[].[].default_branchstringrequireddata[].[].last_commitstring | nullThe default branch's commit
data[].[].size_bytesintegerrequiredSize of the stored snapshot
data[].[].seqintegerrequiredThe repo version: 0 when empty, +1 on every change to its branches or tags
data[].[].created_byobjectrequireddata[].[].created_by.kindstringdata[].[].created_by.idstringdata[].[].sourceanydata[].[].clone_urlstring | nulldata[].[].versionintegerrequiredThe metadata version, for If-Match
data[].[].created_atstring (date-time)requireddata[].[].updated_atstring (date-time)requireddata[].[].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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_listRepos'){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_listRepos",
"arguments": {}
}
}Create a private repo
POST/v1/loom/repos
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
namestringrequired1–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_idstringOptional; must be your selected project pattern
^pr_[A-Za-z0-9_-]{1,128}$descriptionstring | nullmax length 1000
sourceobjectWhere the code came from, e.g. {"kind":"build","build_id":"…"} (at most 2000 bytes)
Responses
- 200The repo this Idempotency-Key already created
Response fields
idstringrequiredpattern
^lr_[a-z2-7]{26}$namestringrequired1–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_idstringrequireddescriptionstring | nullvisibility"private"requireddefault_branchstringrequiredlast_commitstring | nullThe default branch's commit
size_bytesintegerrequiredSize of the stored snapshot
seqintegerrequiredThe repo version: 0 when empty, +1 on every change to its branches or tags
created_byobjectrequiredcreated_by.kindstringcreated_by.idstringsourceanyclone_urlstring | nullversionintegerrequiredThe metadata version, for If-Match
created_atstring (date-time)requiredupdated_atstring (date-time)requiredpushed_atstring | null (date-time)deleted_atstring | null (date-time)
- 201Repo created
Response fields
idstringrequiredpattern
^lr_[a-z2-7]{26}$namestringrequired1–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_idstringrequireddescriptionstring | nullvisibility"private"requireddefault_branchstringrequiredlast_commitstring | nullThe default branch's commit
size_bytesintegerrequiredSize of the stored snapshot
seqintegerrequiredThe repo version: 0 when empty, +1 on every change to its branches or tags
created_byobjectrequiredcreated_by.kindstringcreated_by.idstringsourceanyclone_urlstring | nullversionintegerrequiredThe metadata version, for If-Match
created_atstring (date-time)requiredupdated_atstring (date-time)requiredpushed_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"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const idempotencyKey = '<a stable key per change>'
const result = await genesis.call('loom_createRepo', {
body: {
name: 'string',
},
}, {
headers: { 'Idempotency-Key': idempotencyKey }, // one key per change, reused on every retry
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_createRepo",
"arguments": {
"body": {
"name": "string"
},
"idempotency_key": "<a stable key per change>"
}
}
}Get a repo
GET/v1/loom/repos/{repo}
Scope loom:read. The ETag is the repo's version, for If-Match on update.
Parameters
repopath · stringrequired
Responses
- 200The repo
Response fields
idstringrequiredpattern
^lr_[a-z2-7]{26}$namestringrequired1–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_idstringrequireddescriptionstring | nullvisibility"private"requireddefault_branchstringrequiredlast_commitstring | nullThe default branch's commit
size_bytesintegerrequiredSize of the stored snapshot
seqintegerrequiredThe repo version: 0 when empty, +1 on every change to its branches or tags
created_byobjectrequiredcreated_by.kindstringcreated_by.idstringsourceanyclone_urlstring | nullversionintegerrequiredThe metadata version, for If-Match
created_atstring (date-time)requiredupdated_atstring (date-time)requiredpushed_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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_getRepo', {
repo: '<repo>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_getRepo",
"arguments": {
"repo": "<repo>"
}
}
}Move a repo to trash
DELETE/v1/loom/repos/{repo}
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
idstringrequiredpattern
^lr_[a-z2-7]{26}$namestringrequired1–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_idstringrequireddescriptionstring | nullvisibility"private"requireddefault_branchstringrequiredlast_commitstring | nullThe default branch's commit
size_bytesintegerrequiredSize of the stored snapshot
seqintegerrequiredThe repo version: 0 when empty, +1 on every change to its branches or tags
created_byobjectrequiredcreated_by.kindstringcreated_by.idstringsourceanyclone_urlstring | nullversionintegerrequiredThe metadata version, for If-Match
created_atstring (date-time)requiredupdated_atstring (date-time)requiredpushed_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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_trashRepo', {
repo: '<repo>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_trashRepo",
"arguments": {
"repo": "<repo>"
}
}
}Rename a repo, describe it or change its default branch
PATCH/v1/loom/repos/{repo}
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 · stringrequiredIf-Matchheader · stringrequired
Request body application/json
namestring1–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 | nullmax length 1000
default_branchstringmax length 200
Responses
- 200The updated repo
Response fields
idstringrequiredpattern
^lr_[a-z2-7]{26}$namestringrequired1–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_idstringrequireddescriptionstring | nullvisibility"private"requireddefault_branchstringrequiredlast_commitstring | nullThe default branch's commit
size_bytesintegerrequiredSize of the stored snapshot
seqintegerrequiredThe repo version: 0 when empty, +1 on every change to its branches or tags
created_byobjectrequiredcreated_by.kindstringcreated_by.idstringsourceanyclone_urlstring | nullversionintegerrequiredThe metadata version, for If-Match
created_atstring (date-time)requiredupdated_atstring (date-time)requiredpushed_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 '{}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_updateRepo', {
repo: '<repo>',
body: {},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_updateRepo",
"arguments": {
"repo": "<repo>",
"body": {}
}
}
}Bundles
Bring branches in from a git bundle
POST/v1/loom/repos/{repo}/bundles
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 · stringrequiredmodequery · "ff" | "side-branch"
Request body application/octet-stream
Type: string (binary)
Responses
- 200What moved, and the repo at its new version
Response fields
repoobjectrequiredrepo.idstringrequiredpattern
^lr_[a-z2-7]{26}$repo.namestringrequired1–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_idstringrequiredrepo.descriptionstring | nullrepo.visibility"private"requiredrepo.default_branchstringrequiredrepo.last_commitstring | nullThe default branch's commit
repo.size_bytesintegerrequiredSize of the stored snapshot
repo.seqintegerrequiredThe repo version: 0 when empty, +1 on every change to its branches or tags
repo.created_byobjectrequiredrepo.created_by.kindstringrepo.created_by.idstringrepo.sourceanyrepo.clone_urlstring | nullrepo.versionintegerrequiredThe metadata version, for If-Match
repo.created_atstring (date-time)requiredrepo.updated_atstring (date-time)requiredrepo.pushed_atstring | null (date-time)repo.deleted_atstring | null (date-time)changedbooleanrequiredupdatedobject[]requiredupdated[].[].branchstringupdated[].[].fromstring | nullupdated[].[].tostringside_branchesobject[]requiredside_branches[].[].branchstringside_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.binimport { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_importBundle', {
repo: '<repo>',
body: '<bytes>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "genesis_call",
"arguments": {
"operation": "loom_importBundle",
"arguments": {
"repo": "<repo>",
"body": "<bytes>"
}
}
}
}Checks
List the checks on a commit
GET/v1/loom/repos/{repo}/checks
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 · stringrequiredshaquery · stringrequired
Responses
- 200Checks
Response fields
shastringrequireddataobject[]requireddata[].[].namestringrequireddata[].[].shastringrequireddata[].[].source"oneos-ci" | "external"requireddata[].[].status"queued" | "in_progress" | "completed"requireddata[].[].conclusionstring | nulldata[].[].summarystring | nulldata[].[].details_urlstring | nulldata[].[].ci_run_idstring | nulldata[].[].created_bystringdata[].[].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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_listChecks', {
repo: '<repo>',
sha: '<sha>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_listChecks",
"arguments": {
"repo": "<repo>",
"sha": "<sha>"
}
}
}Ci
Ask OneOS CI again for a branch's latest commit
POST/v1/loom/repos/{repo}/ci/runs
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
branchstringrequiredmax length 200
Responses
- 200What was asked of OneOS CI
Response fields
branchstringrequiredshastringrequiredtriggersobject[]requiredtriggers[].[].idstringrequiredtriggers[].[].refstringrequiredtriggers[].[].shastringrequiredtriggers[].[].trigger"push" | "change"requiredtriggers[].[].pull_idstring | nulltriggers[].[].idempotency_keystringThe OneOS CI run key (loom-forge:…); only Loom creates runs under it
triggers[].[].outcome"sending" | "sent" | "failed"requiredfailed: OneOS CI could not be reached; Loom asks again (same key) for 6 hours, up to 5 tries
triggers[].[].attemptsintegertriggers[].[].run_idstring | nullThe OneOS CI run (ci_runs_get)
triggers[].[].run_status"queued" | "in_progress" | "completed" | nulltriggers[].[].run_conclusionstring | nulltriggers[].[].errorstring | nulltriggers[].[].created_bystringtriggers[].[].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"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_runCi', {
repo: '<repo>',
body: {
branch: 'string',
},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_runCi",
"arguments": {
"repo": "<repo>",
"body": {
"branch": "string"
}
}
}
}What Loom asked of OneOS CI for this repo, newest first
GET/v1/loom/repos/{repo}/ci/triggers
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[]requireddata[].[].idstringrequireddata[].[].refstringrequireddata[].[].shastringrequireddata[].[].trigger"push" | "change"requireddata[].[].pull_idstring | nulldata[].[].idempotency_keystringThe OneOS CI run key (loom-forge:…); only Loom creates runs under it
data[].[].outcome"sending" | "sent" | "failed"requiredfailed: OneOS CI could not be reached; Loom asks again (same key) for 6 hours, up to 5 tries
data[].[].attemptsintegerdata[].[].run_idstring | nullThe OneOS CI run (ci_runs_get)
data[].[].run_status"queued" | "in_progress" | "completed" | nulldata[].[].run_conclusionstring | nulldata[].[].errorstring | nulldata[].[].created_bystringdata[].[].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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_listCiTriggers', {
repo: '<repo>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_listCiTriggers",
"arguments": {
"repo": "<repo>"
}
}
}Clone tokens
Mint a short-lived clone token for one repo
POST/v1/loom/repos/{repo}/clone-tokens
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
shastringOptional; the commit the minter means to clone (recorded for audit; the token still reads all refs) pattern
^[0-9a-f]{40}$ttl_sintegerLifetime in seconds min 60 · max 7200 · default
3600purposestringWhat 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
tokenstringrequiredSecret read token (lct1.…): the Basic auth password; never log it pattern
^lct1\.token_idstringrequiredThe token's public id, for audit and revocation (not secret) pattern
^[A-Za-z0-9_-]{16}$repostringrequiredpattern
^lr_[a-z2-7]{26}$shastring | nullThe commit the minter named (audit only; the token reads all refs), or null
expires_atstring (date-time)requiredusername"x-token"requiredThe Basic auth username
git_pathstringrequiredThe git smart-HTTP path on Loom's Cloud Run URL, /v1/token-git/{repo}
clone_urlstringThe 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 '{}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_createCloneToken', {
repo: '<repo>',
body: {},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "genesis_call",
"arguments": {
"operation": "loom_createCloneToken",
"arguments": {
"repo": "<repo>",
"body": {}
}
}
}
}Revoke every live clone token of a repo
DELETE/v1/loom/repos/{repo}/clone-tokens
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
repostringrequiredpattern
^lr_[a-z2-7]{26}$revokedintegerrequiredHow 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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_revokeCloneTokens', {
repo: '<repo>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_revokeCloneTokens",
"arguments": {
"repo": "<repo>"
}
}
}Revoke one clone token
DELETE/v1/loom/repos/{repo}/clone-tokens/{token_id}
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 · stringrequiredtoken_idpath · stringrequired
Responses
- 200The token was revoked (
revokedis 1)Response fields
repostringrequiredpattern
^lr_[a-z2-7]{26}$revokedintegerrequiredHow 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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_revokeCloneToken', {
repo: '<repo>',
token_id: '<token_id>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_revokeCloneToken",
"arguments": {
"repo": "<repo>",
"token_id": "<token_id>"
}
}
}Protections
List a repo's protected-branch rules
GET/v1/loom/repos/{repo}/protections
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[]requireddata[].[].patternstringrequireddata[].[].required_approvalsintegerrequireddata[].[].required_checksstring[]requireddata[].[].allow_force_pushfalserequireddata[].[].allow_deletionfalserequireddata[].[].merge_onlybooleanrequiredTrue 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_bystringdata[].[].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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_listProtections', {
repo: '<repo>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_listProtections",
"arguments": {
"repo": "<repo>"
}
}
}Protect branches (create or replace the rule for a pattern)
PUT/v1/loom/repos/{repo}/protections
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
patternstringrequiredA branch name; * matches any characters (e.g. main, release/*) pattern
^[A-Za-z0-9._/*-]{1,200}$required_approvalsintegermin 0 · max 10
required_checksstring[]allow_force_pushfalseallow_deletionfalseapprovals_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
patternstringrequiredrequired_approvalsintegerrequiredrequired_checksstring[]requiredallow_force_pushfalserequiredallow_deletionfalserequiredmerge_onlybooleanrequiredTrue 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_bystringcreated_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"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_setProtection', {
repo: '<repo>',
body: {
pattern: 'string',
},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_setProtection",
"arguments": {
"repo": "<repo>",
"body": {
"pattern": "string"
}
}
}
}Remove the protected-branch rule for a pattern
DELETE/v1/loom/repos/{repo}/protections
Scope loom:admin.
Parameters
repopath · stringrequiredpatternquery · stringrequired
Responses
- 200Removed
Response fields
patternstringrequireddeletedbooleanrequired
- 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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_deleteProtection', {
repo: '<repo>',
pattern: '<pattern>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_deleteProtection",
"arguments": {
"repo": "<repo>",
"pattern": "<pattern>"
}
}
}Pulls
List pull requests
GET/v1/loom/repos/{repo}/pulls
Scope loom:read. Newest first, at most 200. state defaults to open.
Parameters
repopath · stringrequiredstatequery · "open" | "closed" | "merged" | "all"
Responses
- 200Pull requests
Response fields
dataobject[]requireddata[].[].idstringrequiredpattern
^lp_[a-z2-7]{26}$data[].[].numberintegerrequiredmin 1
data[].[].repo_idstringrequireddata[].[].titlestringrequireddata[].[].bodystring | nulldata[].[].state"open" | "closed" | "merged"requireddata[].[].headstringrequireddata[].[].basestringrequireddata[].[].head_shastringrequiredThe head's last seen commit
data[].[].base_shastringrequiredThe base's last seen commit (once merged: the base before the merge)
data[].[].merge_commitstring | nulldata[].[].merged_bystring | nulldata[].[].merged_atstring | null (date-time)data[].[].closed_atstring | null (date-time)data[].[].created_byobjectrequireddata[].[].created_by.kindstringdata[].[].created_by.idstringdata[].[].versionintegerrequireddata[].[].created_atstring (date-time)requireddata[].[].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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_listPulls', {
repo: '<repo>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_listPulls",
"arguments": {
"repo": "<repo>"
}
}
}Open a pull request (merge branch head into base)
POST/v1/loom/repos/{repo}/pulls
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
titlestringrequiredmin length 1 · max length 256
bodystring | nullmax length 65536
headstringrequiredThe branch with the changes max length 200
basestringThe 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
idstringrequiredpattern
^lp_[a-z2-7]{26}$numberintegerrequiredmin 1
repo_idstringrequiredtitlestringrequiredbodystring | nullstate"open" | "closed" | "merged"requiredheadstringrequiredbasestringrequiredhead_shastringrequiredThe head's last seen commit
base_shastringrequiredThe base's last seen commit (once merged: the base before the merge)
merge_commitstring | nullmerged_bystring | nullmerged_atstring | null (date-time)closed_atstring | null (date-time)created_byobjectrequiredcreated_by.kindstringcreated_by.idstringversionintegerrequiredcreated_atstring (date-time)requiredupdated_atstring (date-time)required
- 201Opened
Response fields
idstringrequiredpattern
^lp_[a-z2-7]{26}$numberintegerrequiredmin 1
repo_idstringrequiredtitlestringrequiredbodystring | nullstate"open" | "closed" | "merged"requiredheadstringrequiredbasestringrequiredhead_shastringrequiredThe head's last seen commit
base_shastringrequiredThe base's last seen commit (once merged: the base before the merge)
merge_commitstring | nullmerged_bystring | nullmerged_atstring | null (date-time)closed_atstring | null (date-time)created_byobjectrequiredcreated_by.kindstringcreated_by.idstringversionintegerrequiredcreated_atstring (date-time)requiredupdated_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"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_openPull', {
repo: '<repo>',
body: {
title: 'string',
head: 'string',
},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_openPull",
"arguments": {
"repo": "<repo>",
"body": {
"title": "string",
"head": "string"
}
}
}
}Get a pull request and what stands between it and a merge
GET/v1/loom/repos/{repo}/pulls/{number}
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 · stringrequirednumberpath · integerrequired
Responses
- 200The pull request
Response fields
idstringrequiredpattern
^lp_[a-z2-7]{26}$numberintegerrequiredmin 1
repo_idstringrequiredtitlestringrequiredbodystring | nullstate"open" | "closed" | "merged"requiredheadstringrequiredbasestringrequiredhead_shastringrequiredThe head's last seen commit
base_shastringrequiredThe base's last seen commit (once merged: the base before the merge)
merge_commitstring | nullmerged_bystring | nullmerged_atstring | null (date-time)closed_atstring | null (date-time)created_byobjectrequiredcreated_by.kindstringcreated_by.idstringversionintegerrequiredcreated_atstring (date-time)requiredupdated_atstring (date-time)requiredstatusobject | nullNull once merged or closed
status.head_shastring | nullstatus.base_shastring | nullstatus.mergeableboolean | nullstatus.can_mergebooleanstatus.protectionobject | nullstatus.protection.patternsstring[]status.protection.required_approvalsintegerstatus.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[].[].namestringrequiredstatus.checks[].[].shastringrequiredstatus.checks[].[].source"oneos-ci" | "external"requiredstatus.checks[].[].status"queued" | "in_progress" | "completed"requiredstatus.checks[].[].conclusionstring | nullstatus.checks[].[].summarystring | nullstatus.checks[].[].details_urlstring | nullstatus.checks[].[].ci_run_idstring | nullstatus.checks[].[].created_bystringstatus.checks[].[].updated_atstring (date-time)requiredstatus.blockersobject[]status.blockers[].[].code"approvals" | "changes_requested" | "check_missing" | "check_pending" | "check_failed" | "conflict" | "head_missing" | "base_missing" | "nothing_to_merge" | "not_open"requiredstatus.blockers[].[].messagestringrequiredstatus.blockers[].[].checkstringstatus.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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_getPull', {
repo: '<repo>',
number: '<number>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_getPull",
"arguments": {
"repo": "<repo>",
"number": "<number>"
}
}
}Retitle, describe, close or reopen a pull request
PATCH/v1/loom/repos/{repo}/pulls/{number}
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 · stringrequirednumberpath · integerrequired
Request body application/json
titlestringmin length 1 · max length 256
bodystring | nullmax length 65536
state"open" | "closed"
Responses
- 200The pull request
Response fields
idstringrequiredpattern
^lp_[a-z2-7]{26}$numberintegerrequiredmin 1
repo_idstringrequiredtitlestringrequiredbodystring | nullstate"open" | "closed" | "merged"requiredheadstringrequiredbasestringrequiredhead_shastringrequiredThe head's last seen commit
base_shastringrequiredThe base's last seen commit (once merged: the base before the merge)
merge_commitstring | nullmerged_bystring | nullmerged_atstring | null (date-time)closed_atstring | null (date-time)created_byobjectrequiredcreated_by.kindstringcreated_by.idstringversionintegerrequiredcreated_atstring (date-time)requiredupdated_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 '{}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_updatePull', {
repo: '<repo>',
number: '<number>',
body: {},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_updatePull",
"arguments": {
"repo": "<repo>",
"number": "<number>",
"body": {}
}
}
}List a pull request's comments
GET/v1/loom/repos/{repo}/pulls/{number}/comments
Scope loom:read. Oldest first.
Parameters
repopath · stringrequirednumberpath · integerrequired
Responses
- 200Comments
Response fields
dataobject[]requireddata[].[].idstringrequireddata[].[].bodystringrequireddata[].[].pathstring | nulldata[].[].lineinteger | nulldata[].[].shastring | nulldata[].[].created_byobjectrequireddata[].[].created_by.kindstringdata[].[].created_by.idstringdata[].[].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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_listPullComments', {
repo: '<repo>',
number: '<number>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_listPullComments",
"arguments": {
"repo": "<repo>",
"number": "<number>"
}
}
}Comment on a pull request, or on a line of a file in it
POST/v1/loom/repos/{repo}/pulls/{number}/comments
Scope loom:write. A line needs a path; a file comment records the pull request's last seen head commit (sha).
Parameters
repopath · stringrequirednumberpath · integerrequired
Request body application/json
bodystringrequiredmin length 1 · max length 65536
pathstring | nullmax length 4096
lineinteger | nullmin 1
Responses
- 201The comment
Response fields
idstringrequiredbodystringrequiredpathstring | nulllineinteger | nullshastring | nullcreated_byobjectrequiredcreated_by.kindstringcreated_by.idstringcreated_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"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_commentOnPull', {
repo: '<repo>',
number: '<number>',
body: {
body: 'string',
},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_commentOnPull",
"arguments": {
"repo": "<repo>",
"number": "<number>",
"body": {
"body": "string"
}
}
}
}The commits a pull request brings
GET/v1/loom/repos/{repo}/pulls/{number}/commits
Scope loom:read. Newest first, at most 250.
Parameters
repopath · stringrequirednumberpath · integerrequired
Responses
- 200Commits
Response fields
dataobject[]requireddata[].[].shastringrequireddata[].[].parentsstring[]requireddata[].[].author_namestringrequireddata[].[].author_emailstringrequireddata[].[].authored_atstring (date-time)requireddata[].[].messagestringrequiredtruncatedbooleanrequired
- 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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_listPullCommits', {
repo: '<repo>',
number: '<number>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_listPullCommits",
"arguments": {
"repo": "<repo>",
"number": "<number>"
}
}
}The diff a reviewer reads
GET/v1/loom/repos/{repo}/pulls/{number}/diff
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 · stringrequirednumberpath · integerrequiredpathquery · string
Responses
- 200The diff
Response fields
base_shastringrequiredhead_shastringrequiredmerge_basestringrequiredfilesobject[]requiredfiles[].[].pathstringrequiredfiles[].[].old_pathstring | nullfiles[].[].status"added" | "modified" | "deleted" | "renamed" | "copied" | "type_changed"requiredfiles[].[].additionsinteger | nullfiles[].[].deletionsinteger | nullfiles[].[].binarybooleanfiles_truncatedbooleanrequiredpathstring | nullpatchstringrequiredpatch_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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_getPullDiff', {
repo: '<repo>',
number: '<number>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_getPullDiff",
"arguments": {
"repo": "<repo>",
"number": "<number>"
}
}
}Merge a pull request with a merge commit
POST/v1/loom/repos/{repo}/pulls/{number}/merge
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 · stringrequirednumberpath · integerrequired
Request body application/json
expected_head_shastringpattern
^[0-9a-f]{40}$messagestringmin length 1 · max length 65536
delete_branchbooleanmethod"merge"
Responses
- 200Merged
Response fields
pullobjectrequiredpull.idstringrequiredpattern
^lp_[a-z2-7]{26}$pull.numberintegerrequiredmin 1
pull.repo_idstringrequiredpull.titlestringrequiredpull.bodystring | nullpull.state"open" | "closed" | "merged"requiredpull.headstringrequiredpull.basestringrequiredpull.head_shastringrequiredThe head's last seen commit
pull.base_shastringrequiredThe base's last seen commit (once merged: the base before the merge)
pull.merge_commitstring | nullpull.merged_bystring | nullpull.merged_atstring | null (date-time)pull.closed_atstring | null (date-time)pull.created_byobjectrequiredpull.created_by.kindstringpull.created_by.idstringpull.versionintegerrequiredpull.created_atstring (date-time)requiredpull.updated_atstring (date-time)requiredmerge_commitstringrequiredhead_branch_deletedbooleanrequiredrepoobjectrequiredrepo.idstringrequiredpattern
^lr_[a-z2-7]{26}$repo.namestringrequired1–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_idstringrequiredrepo.descriptionstring | nullrepo.visibility"private"requiredrepo.default_branchstringrequiredrepo.last_commitstring | nullThe default branch's commit
repo.size_bytesintegerrequiredSize of the stored snapshot
repo.seqintegerrequiredThe repo version: 0 when empty, +1 on every change to its branches or tags
repo.created_byobjectrequiredrepo.created_by.kindstringrepo.created_by.idstringrepo.sourceanyrepo.clone_urlstring | nullrepo.versionintegerrequiredThe metadata version, for If-Match
repo.created_atstring (date-time)requiredrepo.updated_atstring (date-time)requiredrepo.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 '{}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_mergePull', {
repo: '<repo>',
number: '<number>',
body: {},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_mergePull",
"arguments": {
"repo": "<repo>",
"number": "<number>",
"body": {}
}
}
}List a pull request's reviews
GET/v1/loom/repos/{repo}/pulls/{number}/reviews
Scope loom:read. Oldest first.
Parameters
repopath · stringrequirednumberpath · integerrequired
Responses
- 200Reviews
Response fields
dataobject[]requireddata[].[].idstringrequireddata[].[].state"approved" | "changes_requested" | "commented"requireddata[].[].shastringrequireddata[].[].bodystring | nulldata[].[].created_byobjectrequireddata[].[].created_by.kindstringdata[].[].created_by.idstringdata[].[].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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_listPullReviews', {
repo: '<repo>',
number: '<number>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_listPullReviews",
"arguments": {
"repo": "<repo>",
"number": "<number>"
}
}
}Review a pull request (approve, request changes or comment)
POST/v1/loom/repos/{repo}/pulls/{number}/reviews
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 · stringrequirednumberpath · integerrequired
Request body application/json
event"approve" | "request_changes" | "comment"requiredbodystring | nullRequired for request_changes and comment max length 65536
shastringpattern
^[0-9a-f]{40}$
Responses
- 201The review
Response fields
idstringrequiredstate"approved" | "changes_requested" | "commented"requiredshastringrequiredbodystring | nullcreated_byobjectrequiredcreated_by.kindstringcreated_by.idstringcreated_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"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_reviewPull', {
repo: '<repo>',
number: '<number>',
body: {
event: 'approve',
},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_reviewPull",
"arguments": {
"repo": "<repo>",
"number": "<number>",
"body": {
"event": "approve"
}
}
}
}Refs
List a repo's branches and tags
GET/v1/loom/repos/{repo}/refs
Scope loom:read.
Parameters
repopath · stringrequired
Responses
- 200Branches and tags at the repo's current version
Response fields
default_branchstringrequiredseqintegerrequiredbranchesobject[]requiredbranches[].[].namestringrequiredbranches[].[].commitstringrequiredtagsobject[]requiredtags[].[].namestringrequiredtags[].[].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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_listRefs', {
repo: '<repo>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_listRefs",
"arguments": {
"repo": "<repo>"
}
}
}Restore
Restore a trashed repo
POST/v1/loom/repos/{repo}/restore
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
idstringrequiredpattern
^lr_[a-z2-7]{26}$namestringrequired1–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_idstringrequireddescriptionstring | nullvisibility"private"requireddefault_branchstringrequiredlast_commitstring | nullThe default branch's commit
size_bytesintegerrequiredSize of the stored snapshot
seqintegerrequiredThe repo version: 0 when empty, +1 on every change to its branches or tags
created_byobjectrequiredcreated_by.kindstringcreated_by.idstringsourceanyclone_urlstring | nullversionintegerrequiredThe metadata version, for If-Match
created_atstring (date-time)requiredupdated_atstring (date-time)requiredpushed_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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_restoreRepo', {
repo: '<repo>',
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_restoreRepo",
"arguments": {
"repo": "<repo>"
}
}
}Statuses
Report a check on a commit (any name but oneos-ci*)
POST/v1/loom/repos/{repo}/statuses
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
shastringrequiredpattern
^[0-9a-f]{40}$namestringrequiredpattern
^[A-Za-z0-9][A-Za-z0-9 ._:/-]{0,99}$status"queued" | "in_progress" | "completed"requiredconclusion"success" | "failure" | "cancelled" | "timed_out" | "skipped" | "neutral" | "action_required"Required when completed
summarystring | nullmax length 8000
details_urlstring | nullpattern
^https://
Responses
- 200The check
Response fields
namestringrequiredshastringrequiredsource"oneos-ci" | "external"requiredstatus"queued" | "in_progress" | "completed"requiredconclusionstring | nullsummarystring | nulldetails_urlstring | nullci_run_idstring | nullcreated_bystringupdated_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"
}'import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_createStatus', {
repo: '<repo>',
body: {
sha: 'string',
name: 'string',
status: 'queued',
},
}){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_createStatus",
"arguments": {
"repo": "<repo>",
"body": {
"sha": "string",
"name": "string",
"status": "queued"
}
}
}
}Whoami
Show the identity, environment and selected project Loom sees for your credential
GET/v1/loom/whoami
Scope loom:read.
Responses
- 200Org, principal, kind, scopes, environment and the selected project
Response fields
orgstringrequiredprincipalstringrequiredkindstringrequiredscopesstring[]requiredtenant_environment"sandbox" | "live"requiredproject_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"import { Genesis } from '@onesi/genesis'
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })
const result = await genesis.call('loom_whoami'){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "loom_whoami",
"arguments": {}
}
}L1fe AI Inc. · Built from Genesis 0.3.1 and the live gateway on 2026-10-25. Support