🔌 Perfect Wiki Public API

Updated today

5 min read

Perfect Wiki provides a Public API that lets you programmatically access and manage your knowledgebase. You can list pages, read their content, create and update articles, delete outdated pages, and even query your knowledgebase using AI - all from your own scripts, integrations, or apps.

Common use cases include syncing content from external systems, building custom search interfaces, powering chatbots with your knowledge base, and automating content management workflows.

Base URL: https://api.perfectwiki.xyz/api


How to get the token?

🔌 Perfect Wiki Public API
  1. Open the Perfect Wiki administration panel.
  2. Find the knowledgebase you want to connect to.
  3. Navigate to the "API Access" section.
  4. Click Generate API Key.
  5. Copy the token immediately - it is shown only once.

If you need a new token, you can regenerate it at any time. Note that regenerating a token invalidates the previous one, so any existing integrations using the old token will stop working.

 

All API requests must include the token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN

API Endpoints

Every successful response includes common fields:

{
  "knowledgebase": {
    "name": "Your Knowledgebase Name"
  },
  "rateLimit": {
    "requestsLeftSecond": 9,
    "requestsLeftMinute": 59
  }
}

List pages in the knowledgebase

Retrieves a list of all visible pages in your knowledgebase. This is useful for building indexes, generating sitemaps, syncing content to external systems, or simply getting an overview of what's available.

Request

GET /public-api/v1/knowledgebase
Authorization: Bearer YOUR_API_TOKEN

Response 200 OK

{
  "knowledgebase": { "name": "Engineering Docs" },
  "pages": [
    {
      "id": "abc123",
      "title": "Getting Started",
      "tags": ["onboarding", "setup"]
    }
  ],
  "rateLimit": { "requestsLeftSecond": 9, "requestsLeftMinute": 59 }
}

Get a page

Retrieves the full content of a specific page in html format. Use this to display articles in your own app, export content, or feed pages into other systems.

Request

GET /public-api/v1/page/:id
Authorization: Bearer YOUR_API_TOKEN
ParameterLocationRequiredDescription
idURL pathYesThe page ID

Response 200 OK

{
  "knowledgebase": { "name": "Engineering Docs" },
  "page": {
    "id": "abc123",
    "title": "Getting Started",
    "tags": ["onboarding", "setup"],
    "content": "<p>Welcome to the team...</p>"
  },
  "rateLimit": { "requestsLeftSecond": 9, "requestsLeftMinute": 59 }
}

Error 404 Not Found - the page does not exist or is not visible in this knowledgebase.

Create a page

Creates a new page in the knowledgebase. Useful for importing content from external sources, automating documentation workflows, or allowing other tools to publish directly to your wiki.

Request

POST /public-api/v1/page
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "title": "New Article",
  "content": "<p>Article body in HTML</p>",
  "tags": ["api", "automation"]
}
FieldTypeRequiredDescription
titlestringYesPage title
contentstringNoHTML content of the page
tagsstring[]NoList of tags

Response 200 OK

{
  "knowledgebase": { "name": "Engineering Docs" },
  "message": "acknowledged",
  "page": { "id": "new_page_id" },
  "rateLimit": { "requestsLeftSecond": 9, "requestsLeftMinute": 59 }
}

Update a page

Updates an existing page. You can change the title, content, tags, or any combination. Only the fields you include will be updated - everything else stays the same.

Request

POST /public-api/v1/page/:id
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "title": "Updated Title",
  "content": "<p>Updated content</p>",
  "tags": ["updated"]
}
FieldTypeRequiredDescription
idURL pathYesThe page ID
titlestringNoNew page title
contentstringNoNew HTML content
tagsstring[]NoNew tags (replaces existing tags)

At least one of title, body, or tags must be provided.

Response 200 OK

{
  "knowledgebase": { "name": "Engineering Docs" },
  "message": "acknowledged",
  "rateLimit": { "requestsLeftSecond": 9, "requestsLeftMinute": 59 }
}

Error 404 Not Found - the page does not exist or is not visible in this knowledgebase.

Delete a page

Permanently removes a page from the knowledgebase. Use with caution - this action cannot be undone via the API.

Request

DELETE /public-api/v1/page/:id
Authorization: Bearer YOUR_API_TOKEN
ParameterLocationRequiredDescription
idURL pathYesThe page ID

Response 200 OK

{
  "knowledgebase": { "name": "Engineering Docs" },
  "message": "acknowledged",
  "rateLimit": { "requestsLeftSecond": 9, "requestsLeftMinute": 59 }
}

Error 404 Not Found -- the page does not exist or is not visible in this knowledgebase.

Query the knowledgebase with AI

Ask a natural language question and get an AI-generated answer based on your knowledgebase content. The response includes the answer along with links to the most relevant pages.

This is great for building chatbots, search interfaces, or support tools that leverage your existing documentation.

Billing note: Each query to this endpoint counts as an AI Request and is billed according to your plan's AI query allowance. You can check your current usage and upgrade your plan on the billing page.

Request

POST /public-api/v1/knowledgebase/query
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "q": "How do I reset my password?"
}
FieldTypeRequiredDescription
qstringYesYour question or query

Response 200 OK

{
  "knowledgebase": { "name": "Engineering Docs" },
  "aiBotResponse": {
    "response": "To reset your password, go to Settings > Security and click 'Reset Password'...",
    "relatedPages": [
      { "id": "page1", "title": "Password Management" }
    ],
    "isEmptyResult": false
  },
  "rateLimit": { "requestsLeftSecond": 9, "requestsLeftMinute": 59 }
}

Error 402 Payment Required -- you have exceeded your monthly AI query limit. Upgrade your plan to continue using AI queries.

Error Codes

CodeMeaningDescription
400Bad RequestMissing or invalid parameters
401UnauthorizedMissing or invalid API token
402Payment RequiredAI query billing limit exceeded
404Not FoundPage does not exist or is not visible
429Too Many RequestsRate limit exceeded - slow down and retry
500Internal Server ErrorSomething went wrong on our end

Rate Limits

To ensure fair usage and system stability, the API enforces the following rate limits per token:

WindowMax Requests
Per second10
Per minute60

Every response includes a rateLimit object so you can monitor your remaining quota:

"rateLimit": {
  "requestsLeftSecond": 8,
  "requestsLeftMinute": 52
}

If you exceed the limit, you'll receive a 429 Too Many Requests error. Simply wait and retry.

Need higher limits? Contact us at docs.perfectwiki.com/feedback to discuss your use case - we can accommodate higher limits for enterprise integrations.

FAQ

Can I use one token for multiple knowledgebases? 

No. Each token is tied to a single knowledgebase. If you need to access multiple knowledgebases, generate a separate token for each one.

What happens if I regenerate my token? 

The old token is immediately invalidated. Update all integrations with the new token right away.

Is the page content returned as HTML? 

Yes. The content field in page responses contains the full HTML body of the page.

Are AI queries free? 

No. Each call to the /knowledgebase/query endpoint counts as an AI Request and is billed according to your plan. Check your billing page for current usage and limits.

Can I create pages with nested/parent structure via the API? 

Currently, all pages created via the API are added to the root level of the knowledgebase.

What format should the content field be in when creating or updating pages? 

Use standard HTML. For example: <p>This is a paragraph</p>.

I'm getting a 401 error. What should I do? 

Make sure you're including the Authorization: Bearer YOUR_TOKEN header and that the token hasn't been regenerated since you last copied it.

I'm getting a 429 error. What should I do? 

You're hitting the rate limit. Reduce the frequency of your requests or add a small delay between calls. If you consistently need higher throughput, reach out to us.

Where can I get help or report issues? 

Visit docs.perfectwiki.com/feedback - we're happy to help.

Was this page helpful?