Skip to main content
Business planREST / JSON

Knowledge Base API

Programmatically manage your agent's knowledge base. Push product updates, menu changes, and pricing without logging into the dashboard.

Get your API key →

Start in 30 seconds

Pick your preferred approach. The AI Coding Agent tab gives you a copy-paste prompt to drop into Claude Code, Cursor, Windsurf, or any AI assistant — it writes the integration for you.

Paste into Claude Code, Cursor, Windsurf, GitHub Copilot, or any AI assistant
I want to integrate with the AgentNDX Knowledge Base API. Please implement a client for it using the spec below.

## Base URL
https://agentndx.com/api/v1

## Authentication
Every request requires this header:
  Authorization: Bearer andx_<your_api_key>

API keys are generated from: AgentNDX dashboard → Settings → API tab (requires Business plan).

## Endpoints

GET  /pages/{pageId}/knowledge
  List all knowledge entries for a page.
  Response: { data: [ { id, tenantId, pageId, type, question, answer, sortOrder, createdAt, updatedAt } ] }

POST /pages/{pageId}/knowledge
  Create a knowledge entry.
  Body: { "question": "string (required, max 2000)", "answer": "string (required, max 5000)", "type": "faq" | "custom" (default "custom") }
  Response 201: { data: { id, tenantId, pageId, type, question, answer, sortOrder, createdAt, updatedAt } }

PUT  /pages/{pageId}/knowledge/{entryId}
  Update a knowledge entry. At least one field required.
  Body: { "question": "string (optional)", "answer": "string (optional)" }
  Response: { data: { ...updated entry } }

DELETE /pages/{pageId}/knowledge/{entryId}
  Delete a knowledge entry.
  Response: 204 No Content

PUT  /pages/{pageId}/content
  Partially update page content (hero text, services list, FAQ section).
  All fields optional — only supplied fields are updated; others are preserved.
  Body: {
    "content": {
      "hero": { "headline": "string", "subheadline": "string", "cta_text": "string", "trust_badges": ["string"] },
      "services": [ { "name": "string", "description": "string", "price_range": "string (optional)" } ],
      "faq": [ { "question": "string", "answer": "string" } ]
    }
  }
  Response: { data: { id, slug, content, updatedAt } }

## Response Envelope
Success: { "data": <payload>, "meta": { "requestId": "req_..." } }
Error:   { "error": { "code": "ERROR_CODE", "message": "Human-readable" }, "meta": { "requestId": "req_..." } }

## Error Codes
401 UNAUTHORIZED           — Missing or invalid API key
402 PLAN_UPGRADE_REQUIRED  — API requires Business plan
404 PAGE_NOT_FOUND         — pageId not found or not yours
404 ENTRY_NOT_FOUND        — entryId not found or not yours
422 VALIDATION_ERROR       — Invalid request body (details in error.details[])
429 RATE_LIMITED           — 120 requests/minute exceeded (Retry-After header included)
500 INTERNAL_ERROR         — Transient server error, safe to retry

## My credentials (fill these in)
API_KEY=andx_YOUR_KEY_HERE
PAGE_ID=YOUR_PAGE_UUID_HERE

## What I want to build
[Describe your use case here — e.g. "a nightly cron job that syncs our menu from a Google Sheet" or "a webhook handler that updates pricing when our CMS publishes"]

Paste the block above into any AI coding assistant — Claude Code, Cursor, Windsurf, GitHub Copilot, or similar. Fill in your API key and page ID from the Settings → API tab, then describe your use case at the bottom.


Authentication

API keys are 69-character strings prefixed with andx_. Generate them from Settings → API (requires Business plan). Pass the key as a Bearer token in every request.

Keys are scoped to your account — every API call only touches data belonging to your tenant. Never share your key or commit it to source control.

Authorization: Bearer andx_a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4

Finding your page ID

Your page ID is a UUID visible in the dashboard URL whenever you open a page:

https://agentndx.com/dashboard/pages/{pageId}/editor

Copy the UUID segment between /pages/ and /editor. That is the value to use as {pageId} in every endpoint below.


Endpoint reference

Base URL: https://agentndx.com/api/v1

GET/pages/{pageId}/knowledge

List all knowledge entries for the given page.

Path parameters

FieldTypeRequiredDescription
pageIdstring (UUID)YesThe page whose knowledge entries you want to list.

Response fields (each item in data[])

FieldTypeRequiredDescription
idstringNoEntry UUID.
tenantIdstringNoYour tenant UUID.
pageIdstringNoParent page UUID.
type"faq" | "custom"NoEntry type.
questionstringNoThe question or topic.
answerstringNoThe answer text.
sortOrdernumberNoDisplay sort order.
createdAtstring (ISO 8601)NoCreation timestamp.
updatedAtstring (ISO 8601)NoLast-updated timestamp.
Example
curl https://agentndx.com/api/v1/pages/YOUR_PAGE_ID/knowledge \
  -H "Authorization: Bearer andx_YOUR_KEY"
{
  "data": [
    {
      "id": "ent_01abc...",
      "tenantId": "ten_01xyz...",
      "pageId": "pge_01def...",
      "type": "custom",
      "question": "What are your hours?",
      "answer": "Monday–Friday, 9am–6pm.",
      "sortOrder": 0,
      "createdAt": "2026-01-15T10:00:00.000Z",
      "updatedAt": "2026-01-15T10:00:00.000Z"
    }
  ],
  "meta": { "requestId": "req_01abc..." }
}
POST/pages/{pageId}/knowledge

Create a new knowledge entry for the given page.

Path parameters

FieldTypeRequiredDescription
pageIdstring (UUID)YesThe page to add the entry to.

Request body

FieldTypeRequiredDescription
questionstringYesThe question or topic. Max 2 000 characters.
answerstringYesThe answer text. Max 5 000 characters.
type"faq" | "custom"NoEntry type. Defaults to "custom".

Returns 201 Created with the new entry.

Example
curl -X POST https://agentndx.com/api/v1/pages/YOUR_PAGE_ID/knowledge \
  -H "Authorization: Bearer andx_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "What are your hours?", "answer": "Monday–Friday, 9am–6pm."}'
{
  "data": {
    "id": "ent_01abc...",
    "tenantId": "ten_01xyz...",
    "pageId": "pge_01def...",
    "type": "custom",
    "question": "What are your hours?",
    "answer": "Monday–Friday, 9am–6pm.",
    "sortOrder": 1,
    "createdAt": "2026-05-28T14:00:00.000Z",
    "updatedAt": "2026-05-28T14:00:00.000Z"
  },
  "meta": { "requestId": "req_02def..." }
}
PUT/pages/{pageId}/knowledge/{entryId}

Update an existing knowledge entry. At least one field required.

Path parameters

FieldTypeRequiredDescription
pageIdstring (UUID)YesThe parent page UUID.
entryIdstring (UUID)YesThe knowledge entry to update.

Request body (at least one field required)

FieldTypeRequiredDescription
questionstringNoUpdated question text. Max 2 000 characters.
answerstringNoUpdated answer text. Max 5 000 characters.
Example
curl -X PUT https://agentndx.com/api/v1/pages/YOUR_PAGE_ID/knowledge/ENTRY_ID \
  -H "Authorization: Bearer andx_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"answer": "Monday–Saturday, 8am–7pm."}'
{
  "data": {
    "id": "ent_01abc...",
    "question": "What are your hours?",
    "answer": "Monday–Saturday, 8am–7pm.",
    "updatedAt": "2026-05-28T16:30:00.000Z"
  },
  "meta": { "requestId": "req_03ghi..." }
}
DELETE/pages/{pageId}/knowledge/{entryId}

Permanently delete a knowledge entry.

Path parameters

FieldTypeRequiredDescription
pageIdstring (UUID)YesThe parent page UUID.
entryIdstring (UUID)YesThe knowledge entry to delete.

Returns 204 No Content on success. No response body.

Example
curl -X DELETE https://agentndx.com/api/v1/pages/YOUR_PAGE_ID/knowledge/ENTRY_ID \
  -H "Authorization: Bearer andx_YOUR_KEY"

# Response: 204 No Content
PUT/pages/{pageId}/content

Partially update page content — hero text, services list, and FAQ section. Only supplied fields are updated; others are preserved.

Path parameters

FieldTypeRequiredDescription
pageIdstring (UUID)YesThe page to update.

Request body (all fields optional)

FieldTypeRequiredDescription
content.hero.headlinestringNoMain page headline.
content.hero.subheadlinestringNoSupporting subheadline.
content.hero.cta_textstringNoCall-to-action button label.
content.hero.trust_badgesstring[]NoShort trust badge strings shown below the hero.
content.servicesServiceItem[]NoArray of service objects — each with name, description, and optional price_range.
content.faqFaqItem[]NoArray of FAQ objects — each with question and answer.

Response fields

FieldTypeRequiredDescription
idstringNoPage UUID.
slugstringNoPublic URL slug.
contentobjectNoFull updated page content object.
updatedAtstring (ISO 8601)NoUpdated timestamp.
Example
curl -X PUT https://agentndx.com/api/v1/pages/YOUR_PAGE_ID/content \
  -H "Authorization: Bearer andx_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": {
      "hero": { "headline": "Fresh ingredients. Open late." },
      "services": [
        { "name": "Ribeye", "description": "12oz USDA Choice", "price_range": "$42" }
      ]
    }
  }'
{
  "data": {
    "id": "pge_01def...",
    "slug": "joes-steakhouse",
    "content": { "hero": { "headline": "Fresh ingredients. Open late." }, "..." },
    "updatedAt": "2026-05-28T18:00:00.000Z"
  },
  "meta": { "requestId": "req_04jkl..." }
}

Error reference

All errors use the same envelope:

{
  "error": { "code": "ERROR_CODE", "message": "Human-readable description" },
  "meta":  { "requestId": "req_..." }
}
StatusCodeMeaning
401UNAUTHORIZEDMissing or invalid API key.
402PLAN_UPGRADE_REQUIREDAPI access requires the Business plan.
404PAGE_NOT_FOUNDpageId not found or does not belong to your tenant.
404ENTRY_NOT_FOUNDentryId not found or does not belong to your tenant.
422VALIDATION_ERRORInvalid request body. Check error.details[] for field-level messages.
429RATE_LIMITED120 requests/minute exceeded. Retry-After header indicates seconds to wait.
500INTERNAL_ERRORTransient server error — safe to retry with exponential backoff.

Rate limits

The API allows 120 requests per minute per account, across all endpoints. When the limit is exceeded you receive a 429 RATE_LIMITED response with a Retry-After header indicating how many seconds to wait before retrying.

Recommended: implement exponential backoff starting at 1 second (e.g. 1s, 2s, 4s, 8s…). Most sync workloads — nightly cron jobs, CMS webhooks, menu updates — stay well under the limit.


Ready to automate your agent?

API keys are available on the Business plan. Upgrade in two clicks from your dashboard.