List Knowledge Base Articles

GET /articles - List Knowledge Base Articles

Retrieve a list of all articles in the knowledge base with basic information including their content versions. This endpoint is useful for synchronization, validation, and getting an overview of your knowledge base content.

Endpoint

GET /v1/knowledgebase/articles

Request Headers

Header

Value

Required

Authorization

Bearer YOUR_API_TOKEN

Yes

Request Parameters

Query Parameters

Parameter

Type

Required

Description

correlationCategoryId

string

No

Filter articles by category correlation ID. Use null to get articles not assigned to any category (root articles)

Examples

  • All articles: GET /articles
  • Articles in specific category: GET /articles?correlationCategoryId=tutorials
  • Root articles (no category): GET /articles?correlationCategoryId=null

Response Format

Success Response (200 OK)

{
  "articles": [
    {
      "id": "123",
      "correlationId": "getting-started-001",
      "lastModified": "2024-01-15T10:30:00Z",
      "categoryId": 456,
      "isPrivate": false,
      "isHidden": false,
      "isFeatured": true,
      "featuredOrder": 1,
      "order": 5,
      "version": "v1",
      "alternateSlugs": "{\"en\":[\"getting-started\",\"start-guide\"]}",
      "contents": [
        {
          "id": "789",
          "correlationId": "content-en-001",
          "lang": "en",
          "published": true,
          "lastModified": "2024-01-15T10:30:00Z"
        },
        {
          "id": "790",
          "correlationId": "content-es-001",
          "lang": "es",
          "published": false,
          "lastModified": "2024-01-14T15:20:00Z"
        }
      ]
    }
  ]
}

Response Fields

Article Object

Field

Type

Description

Example

id

string

Internal database ID of the article

"123"

correlationId

string

Custom correlation ID (if set)

"getting-started-001"

lastModified

string

ISO 8601 timestamp of last modification

"2024-01-15T10:30:00Z"

categoryId

number

ID of the category (null if no category)

456

isPrivate

boolean

Whether article is private

false

isHidden

boolean

Whether article is hidden from navigation

false

isFeatured

boolean

Whether article is featured

true

featuredOrder

number

Display order for featured articles

1

order

number

Display order within category

5

version

string

Article format version

"v1"

alternateSlugs

string

JSON string of alternate slugs by language

"{\"en\":[\"old-slug\"]}"

contents

array

Array of content versions

See Content Object below

Content Object (contents[])

Field

Type

Description

Example

id

string

Internal database ID of the content

"789"

correlationId

string

Custom correlation ID for content (if set)

"content-en-001"

lang

string

Language code (ISO 639-1)

"en"

published

boolean

Whether this content version is published

true

lastModified

string

ISO 8601 timestamp of last modification

"2024-01-15T10:30:00Z"

Examples

Example 1: Get All Articles

curl -X GET "https://api.productfruits.com/v1/knowledgebase/articles" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example 2: Get Articles in Specific Category

curl -X GET "https://api.productfruits.com/v1/knowledgebase/articles?correlationCategoryId=tutorials" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example 3: Get Root Articles (No Category)

curl -X GET "https://api.productfruits.com/v1/knowledgebase/articles?correlationCategoryId=null" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response:

{
  "articles": [
    {
      "id": "1",
      "correlationId": "getting-started",
      "lastModified": "2024-01-15T10:30:00Z",
      "categoryId": 1,
      "isPrivate": false,
      "isHidden": false,
      "isFeatured": true,
      "featuredOrder": 1,
      "order": 1,
      "version": "v1",
      "alternateSlugs": null,
      "contents": [
        {
          "id": "1",
          "correlationId": "getting-started-en",
          "lang": "en",
          "published": true,
          "lastModified": "2024-01-15T10:30:00Z"
        }
      ]
    },
    {
      "id": "2",
      "correlationId": "faq",
      "lastModified": "2024-01-14T15:20:00Z",
      "categoryId": null,
      "isPrivate": false,
      "isHidden": false,
      "isFeatured": false,
      "featuredOrder": 0,
      "order": 10,
      "version": "v1",
      "alternateSlugs": "{\"en\":[\"frequently-asked-questions\"]}",
      "contents": [
        {
          "id": "3",
          "correlationId": "faq-en",
          "lang": "en",
          "published": true,
          "lastModified": "2024-01-14T15:20:00Z"
        },
        {
          "id": "4",
          "correlationId": "faq-es",
          "lang": "es",
          "published": false,
          "lastModified": "2024-01-14T14:00:00Z"
        }
      ]
    }
  ]
}

Best Practices

  • Use Filtering: Filter by correlationCategoryId to get specific content sets
  • Cache Responses: Store results locally and use lastModified timestamps for change detection
  • Monitor Content: Use this endpoint to validate article states before making updates
  • Backup Data: Call this endpoint before bulk operations to create snapshots
  • Track Languages: Monitor which articles have content in specific languages

Common Use Cases

Content Synchronization

Use this endpoint to compare your local content with the knowledge base:

  • Identify articles that need updates based on lastModified timestamps
  • Detect missing translations by checking contents arrays
  • Validate correlation IDs before performing imports

Content Audit

Review your knowledge base structure:

  • Find articles without categories (categoryId: null)
  • Identify unpublished content (published: false)
  • Check featured article organization (isFeatured, featuredOrder)

Migration Planning

Prepare for bulk operations:

  • Get all correlation IDs for reference
  • Understand current content structure
  • Plan category assignments and reorganization

Performance Considerations

  • This endpoint returns all articles at once
  • Large knowledge bases may have significant response times
  • Consider caching responses if calling frequently
  • Use lastModified timestamps to implement incremental synchronization

Error Response Examples

401 Unauthorized

{
  "error": "Authentication required or invalid API token"
}

500 Internal Server Error

{
  "error": "Internal server error occurred while retrieving articles"
}

Rate Limiting

For detailed information about API limits and optimization strategies, consult this guide.

Was this article helpful?