Knowledgewiki
PATCH/repositories/{repo_id}/wiki
Enable, disable, or repoint a repository's wiki
update_repo_wiki
wiki:manage
A token needs thewiki:managescope: Enable or disable a wiki and change where it reads fromGranted bywrite_api.Every operation this scope unlocksAudited · mutation
x-gitmoap-audit: {"kind":"audited","arg":"mutation"}
The first call creates the wiki; settings you leave out take their defaults — enabled, with
pages kept in the wiki's own repository and home as the home page. Later calls change only the
fields you send. Instead of its own repository, the wiki can read its pages from a directory on
the repository's default branch, inside its specs, docs or legal directory; such a wiki is
edited by committing to the repository. Maintainers and above.
Parameters
Path
- repo_idRepositoryId (string · uuid)Repository ID
Request body
application/json- default_pageWikiPagePath (string) or nulloptional
- enabledboolean or nulloptional
- sourceWikiSourcededicatedin_repoor nulloptionalWhere a wiki's pages come from.
- source_pathRepoPath (string) or nulloptional
Request body exampleSynthesized example
{}
Responses
200The wiki as storedapplication/json
- created_atstring
- default_pageWikiPagePath (string)The page served at the wiki's root.
- enabledbooleanWhether the wiki is on. A disabled wiki is `false` here, never a `404`: whether a wiki exists is not a secret, and only its contents are.
- page_countinteger · int32How many pages the wiki has.
- scope_idstring
- scope_typeScopeTypegrouprepository
- sourceWikiSourcededicatedin_repoWhere a wiki's pages come from.
- updated_atstring
- wiki_idWikiId (string · uuid)
- clone_urlstring or nulloptionalWhere this wiki can be cloned from. Absent when the wiki has no clone URL of its own, as for a wiki that reads its pages from a repository.
created_byActorSummary or nulloptional
- The ActorSummary schema
- emailstring
- idstring
- usernamestring
- avatar_urlstring or nulloptional
- head_shaCommitHash (string) or nulloptionalThe commit the index was last built from. Absent until the first sync.
- indexed_atstring or nulloptional
- source_pathRepoPath (string) or nulloptionalThe directory a
in_repowiki reads from. Absent for adedicatedone.
200 exampleSynthesized example
{
"created_at": "2026-10-10T04:58:27Z",
"default_page": "default-page-e512",
"enabled": true,
"page_count": 1,
"scope_id": "56f1024c-6475-455f-bfe8-ab0bf8156d6c",
"scope_type": "group",
"source": "dedicated",
"updated_at": "2026-10-11T15:03:21Z",
"wiki_id": "b8189d5e-8039-4286-a343-8a61102a5ce8",
"clone_url": "https://gitmoap.example/acme/8fe65fe5",
"created_by": {
"email": "lin@acme.example",
"id": "id-18ae",
"username": "lin",
"avatar_url": "https://gitmoap.example/acme/35add132"
},
"head_sha": "a08620f3a38474ed92d6d321c1aa11a1c5fe427e",
"indexed_at": "2026-10-16T12:54:20Z",
"source_path": "source-path-14e9"
}
400An in-repo wiki must name the directory it reads fromapplication/json
Error codes
- BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-2303",
"message": "Stream pipeline status into the run header"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/json
Error codes
- UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-c8b2",
"message": "Pin a page's payload to the build that rendered it"
}
}
403Maintainer is required to change a wiki's settingsapplication/json
Error codes
- FORBIDDENYou are signed in but may not do this here;
reasonnames the permission or the rule that refused it - INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs;
required_scopenames it - PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-ac1a",
"message": "Draw the region map from operation density"
}
}
404No such scope, or it is not visible to the callerapplication/json
Error codes
- NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-1fb6",
"message": "Draw the region map from operation density"
}
}
409The request conflicts with the resource's current state; `reason` says howapplication/json
Error codes
- CONFLICTThe request conflicts with the resource's current state;
reasonsays how - LEGAL_ACCEPTANCE_REQUIREDAccept the current Terms of Service before changing anything; reading stays open
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
409 exampleSynthesized example
{
"error": {
"code": "code-8538",
"message": "Pin a page's payload to the build that rendered it"
}
}
CLI
gitmoap wiki update-repo-wiki
- --repo-ididRepository ID (id or owner/repo path)
- --default-pagestringoptional
- --enabledflagoptional
- --sourcededicated | in_repooptional
- --source-pathstringoptional