/xwiki:xwiki-rest-apifrom xwiki
Reads from and writes to a running XWiki instance over its REST API using curl. Fetches/modifies page content and xobjects, creates pages, and runs Solr searches.
Ships in xwiki. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Interact with a running XWiki over its REST API using curl. op.xwiki.org is OpenProject, not an
XWiki instance: its work packages are xwiki-openproject's.
Base URL: http://<host>:<port>/xwiki/rest — for local dev this is
http://localhost:8080/xwiki/rest. If XWiki is deployed as the root webapp (e.g. the official
Docker image), the /xwiki context is dropped: http://<host>:<port>/rest.
Auth: HTTP Basic — curl -u Admin:admin .... With no credentials you act as XWiki.Guest
(read-only on public pages; writes get 401). Always authenticate for write operations.
For a remote instance (xwiki.org…), look for the ~/.xwiki-credentials file before asking the
developer for credentials — never print that file and parse it, never source it; its
format, the rule and the curl recipe are in kb/servers/index.md.
Send the default curl User-Agent to the xwiki.org sites — Cloudflare answers 403 to a
browser-like one or none ([[servers/index]]).
Format: responses are XML by default. Ask for JSON with ?media=json on the URL or an
Accept: application/json header. Send bodies with -H "Content-Type: application/xml" (or
application/x-www-form-urlencoded). Send a body file with --data-binary @file, never
-d @file: -d strips the newlines, saving the whole page on a single line.
Reference identifiers, not URLs, for reasoning: a page reference like Sandbox.WebHome maps
to path segments — see nested spaces below.
Nested spaces (important): each space is its own /spaces/{name} segment. The page reference
A.B.C is spaces/A/spaces/B/pages/C. In XWiki's nested model a "page" A.B is usually stored as
A.B.WebHome, i.e. spaces/A/spaces/B/pages/WebHome. When unsure whether a page is terminal or
nested, GET the space's pages list or try .../pages/WebHome.
Response headers include xwiki-version (WAR version) and xwiki-user (the resolved user, absent
for guest) — handy to confirm you authenticated as expected. Add -i to curl to see them.
CSRF form token (writes, XWiki 14.10.8+/15.2+): a state-changing REST call whose body is
text/plain, multipart/form-data or application/x-www-form-urlencoded needs a form token in
the XWiki-Form-Token request header, or it fails with 403 and body Invalid or missing form token.. Every REST response returns the current token in that same XWiki-Form-Token header, so a
cheap GET (e.g. GET .../rest/wikis/xwiki) yields one; read it and echo it back on the write:
TOKEN=$(curl -s -I -u Admin:admin "http://localhost:8080/xwiki/rest/wikis/xwiki" \
| tr -d '\r' | awk -F': ' 'tolower($1)=="xwiki-form-token"{print $2}')
curl -s -u Admin:admin -X POST -H "XWiki-Form-Token: $TOKEN" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "className=XWiki.TestClass" --data-urlencode "property#text=hi" \
".../pages/WebHome/objects"
The token stays constant per server run but can rotate on restart — retry once on 403 with the
token from the error response. Sending it when it isn't needed is harmless. An application/xml
page PUT is exempt; form-encoded object POST and property writes are not.
Path template used throughout (with {S} standing for the possibly-repeated /spaces/{name}
segments):
http://localhost:8080/xwiki/rest/wikis/{wiki}{S}/pages/{page}
{wiki} is normally xwiki on a default install.
Page (title, content, syntax, version, author…):
curl -s -u Admin:admin \
"http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/WebHome?media=json"
All objects attached to the page:
curl -s -u Admin:admin \
"http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/WebHome/objects?media=json"
One specific object (by class + number, usually 0 for the first) and its properties:
curl -s -u Admin:admin \
".../pages/WebHome/objects/XWiki.TestClass/0?media=json"
curl -s -u Admin:admin \
".../pages/WebHome/objects/XWiki.TestClass/0/properties?media=json"
A single property value: append /properties/{propertyName}.
Two traps that return empty rather than failing, so they read as "the page has no such field":
<value> is not the first child of <property> — two <link/> elements come first, so a
<property name="…">\s*<value> regex matches nothing and reports every field as empty. Match the
whole <property …>…</property> block, then find <value> inside it. ?media=json avoids this.GET …/objects carries no property values — only summaries. Fetch …/objects/{Class}/{n}.Enumerate by space prefix, not by asking for children. GET <space>/spaces returns the space
itself, not its sub-spaces, the query endpoint rejects XWQL (400), and REST-created pages have an
empty parent — so any parent/children walk under-reports silently, looking complete. List
the pages explicitly and assert the expected count; cache the tree locally for repeated scans.
When merging object properties into page data, note that a class may define its own content property,
which then clobbers the page content — keep them under a separate key.
PUT to the page URL. Three body formats are accepted; pick the simplest that fits.
Only the content (quickest), text/plain:
curl -s -u Admin:admin -X PUT \
-H "Content-Type: text/plain" \
--data-binary "New page content in {{/}} wiki syntax" \
"http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/WebHome"
Title + content together, application/x-www-form-urlencoded (allowed fields: title, parent,
content):
curl -s -u Admin:admin -X PUT \
--data-urlencode "title=Hello world" \
--data-urlencode "content=This is **bold**." \
"http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/WebHome"
Full control, application/xml — send a <page> element (only include the fields you want to set):
<page xmlns="http://www.xwiki.org">
<title>Hello world</title>
<syntax>xwiki/2.1</syntax>
<content>This is a new page</content>
</page>
curl -s -u Admin:admin -X PUT -H "Content-Type: application/xml" \
--data-binary "@page.xml" \
"http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/WebHome"
Returns 201 if the page was created, 202 if updated, 304 if unchanged. Add
?minorRevision=true to record a minor version instead of a major one.
To keep a title, send back rawTitle, never title. A page GET returns title rendered and
HTML-escaped (Forums & Mailing Lists) next to the source rawTitle (Forums & Mailing Lists).
A PUT that copies title saves the escaped text as the new title, one more & per round trip.
Compare rawTitle too when reading a write back.
Update all given properties of an existing object (PUT the object URL, form-encoded):
curl -s -u Admin:admin -X PUT \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "property#text=Updated value" \
".../pages/WebHome/objects/XWiki.TestClass/0"
Update a single property (PUT its property URL):
curl -s -u Admin:admin -X PUT \
--data-urlencode "property#text=Updated value" \
".../pages/WebHome/objects/XWiki.TestClass/0/properties/text"
Delete an object with -X DELETE on the object URL (204 on success).
202 does not mean the write landed — always read it backBack-to-back writes to the same page can silently drop one: a property PUT issued right after a
content PUT returned 202 and was lost (it read back empty, while properties written after it
stuck); re-issuing it a moment later stored it byte-for-byte. Follow every write with a read-back
assert and re-issue on mismatch. A rendered-page check is no substitute — a lost field that is not
displayed renders as nothing at all.
A malformed property write also returns 202 — and blanks the property. On the single-property
URL the form field must be named property#<name>, not <name>: sending faq=… instead of
property#faq=… is accepted, reports success, and leaves the property empty, destroying whatever
was there. The same happens with a #-less field name on the object URL. So the read-back assert is
not only about lost writes: it is the only thing standing between a wrong field name and silent data
loss on a live page. Sending the raw value as a text/plain body works too, and has no field name to
get wrong.
hidden is settable as a plain form field on the page PUT (alongside content, title,
syntax) — no separate object is needed.
Creating a page is the same PUT as updating one — PUT to a URL that does not yet exist. Any missing parent spaces are created automatically.
curl -s -u Admin:admin -X PUT -H "Content-Type: application/xml" \
--data-binary "@page.xml" \
"http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/spaces/New/pages/WebHome"
Then add one or more objects by POSTing to the page's objects collection.
Form-encoded (concise) — className plus property#name=value pairs:
curl -s -u Admin:admin -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "className=XWiki.TestClass" \
--data-urlencode "property#text=Whatever you want" \
".../spaces/New/pages/WebHome/objects"
Or XML — POST an <object> element:
<object xmlns="http://www.xwiki.org">
<className>XWiki.TestClass</className>
<property name="text">
<value>Whatever you want to put here</value>
</property>
</object>
curl -s -u Admin:admin -X POST -H "Content-Type: application/xml" \
--data-binary "@object.xml" \
".../spaces/New/pages/WebHome/objects"
201 on creation; the Location response header holds the new object's URI (including its assigned
object number). Only the class's own properties are settable — the class must already exist.
Query a single wiki (Solr is the default and only-by-default type since 17.10.5+ / 18.2.0+):
curl -s -u Admin:admin \
"http://localhost:8080/xwiki/rest/wikis/xwiki/query?q=Sandbox&type=solr&number=10&media=json"
Useful parameters: type={solr,hql,xwql,lucene} (non-Solr types must be enabled via
rest.allowedQueryTypes in xwiki.properties), number=n (page size), start=n (offset),
order={asc,desc}, prettyNames={true,false}.
The q value is a Solr query. Filter by field, e.g. restrict to the Sandbox space and title text:
q=title:hello AND space:Sandbox
Search across several wikis at once with the root query resource and a wikis list:
curl -s -u Admin:admin \
"http://localhost:8080/xwiki/rest/wikis/query?q=hello&wikis=xwiki,subwiki&number=10&media=json"
Results come back as searchResults/searchResult entries, each with the page's reference, title
and a link to its REST resource — feed that link back into use case 1 to fetch full content.
conventions/page-deletion.md./, space, etc.).
curl --data-urlencode handles bodies; encode path segments yourself.DocApp xobjects, reading
the doc-quality checker's findings, navigation pinning, content fragments — are in the
KB's conventions/documentation-mechanics.md, not here. For more than a one-field edit, the
xwiki-doc-writing skill ships a client and a publish/audit CLI in its tools/ directory that
already handle the traps below (session-bound token, read-back asserts) — prefer them over fresh
curl calls.-i and read the status line and xwiki-user header — a 401 almost
always means you posted as guest (wrong/missing -u), a 403 means either the authenticated user
lacks edit rights on that page or (body Invalid or missing form token.) a missing/stale CSRF
token — see the XWiki-Form-Token note under Fundamentals.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub xwiki/xwiki-dev-llm --plugin xwiki38 skills in this plugin
/xwiki-backportBackport any change (bug fix, feature, refactor, or test) to an older branch of an XWiki repo (xwiki-platform / xwiki-commons / xwiki-rendering / xwiki-contrib). Cherry-pick `-x` the source commit(s) into a worktree, ADAPT the result to the older branch (module pom versions, Java level, `@since` tags, data migration versions and skip ranges, style/API divergence), verify it compiles against that branch, and push / open a PR. Use whenever a commit that exists on one branch needs to be applied to an older/maintenance branch. For the `testneeded`-labelled test sweep use xwiki-backport-testneeded (which builds on this skill); for Maven commands use xwiki-build; for PR/commit conventions use xwiki-pull-request; for the versioning/`@since` conventions (the format and what carries `@since`) use xwiki-knowledge./xwiki-backport-testneededBackport the automated test of one JIRA issue labelled `testneeded` to the currently-supported stable branches, adjust its `@since` tags across all branches, and open the PRs. Use when asked to backport the test of a given testneeded issue, or to catch a stable branch up with a recently-added test. (For several issues at once, the user will say so — then apply this per issue.) This is the test-specific layer on top of xwiki-backport (which owns the generic cherry-pick / adapt-to-branch / verify mechanics — including the mandatory pom-version, Java-version and `@since` checks). For Maven use xwiki-build; for PR/commit conventions use xwiki-pull-request; for the `@since` rules use xwiki-knowledge; for querying JIRA (the testneeded sweep) use xwiki-jira./xwiki-buildBuild and test XWiki Maven modules. Use when building XWiki, running its tests, or when the user mentions mvn, a build, a failing test, or a specific XWiki module./xwiki-capture-ui-changeCapture the "before" screenshot of a fix to existing XWiki UI when the branch can no longer produce it (the fix is already in the working tree) - on the released version's Docker image, or by building and deploying the pre-fix code on a local instance - and shoot the same fixture in both states. Costs minutes to tens of minutes, so propose it and run it only with the user's explicit approval. Not for a new feature or a redesign (there is no "before"), nor when the bug can still be shot on a running instance before applying the fix. For deploying an extension without a comparison use xwiki-deploy-extension; for Maven commands use xwiki-build; for the PR/JIRA screenshot conventions use xwiki-pull-request; for manually testing every fix of a release use xwiki-manual-test./xwiki-ci-checkEXPLICIT INVOCATION ONLY — never load this skill to answer a question about CI. The daily acting sweep of ci.xwiki.org: it turns what is red on the maintained branches into incidents, attributes each to the commit that caused it and comments there, opens PRs for mechanical fixes (a failing quality gate or a build break first), files proven flicker issues, drafts a fix for one flicker, and posts a digest to Matrix. Only with --write does it write to GitHub, JIRA and Matrix; otherwise it analyses to stdout and asks before each write. Use ONLY when named — `/xwiki-ci-check`, "run the CI check", or a scheduled routine invoking it by name. Do NOT use it for "what's the CI status?", "is master green?", "why is this test failing?" or any other read-only CI question: those are xwiki-release-test-triage. To fix one flicker use xwiki-fix-flickering-docker-test, to file an issue use xwiki-jira, to open a PR use xwiki-pull-request, for Maven use xwiki-build, for Sonar findings use xwiki-fix-sonarqube-issue./xwiki-contrib-releaseRelease an xwiki-contrib extension (groupId org.xwiki.contrib) end to end — preflight, `mvn release:prepare`/`release:perform` to nexus.xwiki.org, the issue-tracker version (JIRA or OpenProject), the extensions.xwiki.org import and release notes, then the hand-off to the announcement. Use when asked to release or publish a version of a contrib extension ("release v1.15 of the doc app"). Not for xwiki-commons/rendering/platform releases (use xwiki-xs-release). For the blog post use xwiki-contrib-release-blog-post; for Maven/JDK use xwiki-build; for tracker calls use xwiki-jira or xwiki-openproject.