Skip to content
GitmoapAPIBeta
Knowledgewiki
POST/repositories/{repo_id}/wiki/pages/{path}/move

Move or rename a wiki page

move_repo_wiki_page
  • wiki:write
    A token needs the wiki:write scope: Create, edit, move and delete wiki pagesGranted by write_api.Every operation this scope unlocks
  • Audited · mutation

    x-gitmoap-audit: {"kind":"audited","arg":"mutation"}

Moves the page to new_path in one commit, and retitles it if you send a title. The old address keeps resolving to the page, and its revision history follows it. Refused when a page already exists at the new path or the new path starts with templates/ or attachments/. Send the head commit you last read the wiki at as expected_head_sha: if anyone has changed the wiki since, the request is refused with 409 and nothing is written, so re-read and try again. A wiki that reads its pages from the repository is changed by committing there, not through this API. Developers and above.

Parameters

Path
  • repo_idRepositoryId (string · uuid)Repository ID
  • pathWikiPagePath (string)URL-encoded wiki page path

Request body

application/json
  • expected_head_shaCommitHash (string)
  • new_pathWikiPagePath (string)Where the page is moving to. Named new_path rather than path because the URL already carries the page's current one, and one name for two addresses is a coin toss for whoever reads the request.
  • messagestring or nulloptional
  • titleWikiPageTitle (string) or nulloptional
Request body exampleSynthesized example
{
"expected_head_sha": "ad9a2eafb158dd62736dbca801e2e2721f7d7514",
"new_path": "new-path-5cd2"
}

Responses

200The page at its new address. The old one keeps resolvingapplication/json
  • created_atstring
  • doc_idstringStable identity. Unchanged by a rename, which is what lets every backlink survive one.
  • formatWikiFormatmarkdownasciidocrstorgtextilemediawikiThe markup a page is written in, decided by its file extension.
  • pathWikiPagePath (string)
  • titleWikiPageTitle (string)
  • updated_atstring
  • wiki_idWikiId (string · uuid)
  • wiki_page_idWikiPageId (string · uuid)
  • created_byActorSummary or nulloptional
200 exampleSynthesized example
{
"created_at": "2026-10-12T10:50:52Z",
"doc_id": "93e5564b-ad13-4331-b383-dd602759561b",
"format": "markdown",
"path": "path-49dd",
"title": "Draw the region map from operation density",
"updated_at": "2026-10-10T04:24:43Z",
"wiki_id": "74ede9cc-e818-45da-bf5e-66a27fead097",
"wiki_page_id": "c6420762-4094-43c3-ad76-43c8aa75b784",
"created_by": {
"email": "mara@acme.example",
"id": "id-5970",
"username": "lin",
"avatar_url": "https://gitmoap.example/acme/c43a1fd1"
}
}
400Bad request — a path parameter is not a well-formed value of its typeapplication/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 reason or code.
    • fieldstring or nulloptionalOn a 400 that 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 on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): 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-96a4",
"message": "Label every synthesized example"
}
}
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 reason or code.
    • fieldstring or nulloptionalOn a 400 that 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 on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): 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-7b8e",
"message": "Draw the region map from operation density"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
  • FORBIDDENYou are signed in but may not do this here; reason names the permission or the rule that refused it
  • INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs; required_scope names 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 reason or code.
    • fieldstring or nulloptionalOn a 400 that 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 on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): 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-fb76",
"message": "Draw the region map from operation density"
}
}
404No page at this pathapplication/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 reason or code.
    • fieldstring or nulloptionalOn a 400 that 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 on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): 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-56e2",
"message": "Label every synthesized example"
}
}
409A page already exists at the new path, or the head has movedapplication/json
Error codes
  • CONFLICTThe request conflicts with the resource's current state; reason says 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 reason or code.
    • fieldstring or nulloptionalOn a 400 that 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 on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): 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-d299",
"message": "Inline scalar newtypes but keep their brand"
}
}

CLI

gitmoap wiki move-repo-wiki-page

  • --repo-ididRepository ID (id or owner/repo path)
  • --pathidURL-encoded wiki page path
  • --expected-head-shastring
  • --messagestringoptional
  • --new-pathstringWhere the page is moving to. Named `new_path` rather than `path` because the URL already carries the page's current one, and one name for two addresses is a coin toss for whoever reads the request.
  • --titlestringoptional