Delete Knowledge Base Article

DELETE /articles/{correlationId} - Delete Knowledge Base Article

Permanently delete an article and all its content from the knowledge base. This operation cannot be undone and will remove the article in all languages.

Endpoint

DELETE /v1/knowledge-base/articles/{correlationId}

Request Headers

Header

Value

Required

Authorization

Bearer YOUR_API_TOKEN

Yes

Path Parameters

Parameter

Type

Required

Description

correlationId

string

Yes

The correlation ID of the article to delete. Can be custom ID or internal ID prefixed with 'pf_'

Correlation ID Format

  • Custom IDs: Use your own correlation ID as provided during import (e.g., "my-article-001")
  • Internal IDs: Use internal database ID prefixed with "pf_" (e.g., "pf_123")

Response Format

Success Response (200 OK)

{
  "message": "Article deleted successfully"
}

Examples

Example 1: Delete Article by Custom Correlation ID

curl -X DELETE "https://api.productfruits.com/v1/knowledgebase/articles/getting-started-001" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response:

{
  "message": "Article deleted successfully"
}

Example 2: Delete Article by Internal ID

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

Response:

{
  "message": "Article deleted successfully"
}

Example 3: Error Handling Example

# Attempt to delete non-existent article
curl -X DELETE "https://api.productfruits.com/v1/knowledgebase/articles/non-existent-id" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response (400 Bad Request):

{
  "error": "Article with correlation ID 'non-existent-id' not found"
}

What Gets Deleted

When you delete an article, the following items are permanently removed:

Article Data

  • Article metadata (title, description, settings)
  • Category assignment
  • Feature and ordering information
  • Version information
  • Alternate slugs configuration

All Content Versions

  • All content in all languages
  • All published and unpublished versions
  • Content metadata (slugs, keywords, leads)
  • Content creation and modification history

Considerations Before Deleting

Content Impact

  • Broken Links: External links to the article will become invalid
  • SEO Impact: Search engine rankings and indexed pages will be lost
  • User Bookmarks: User-saved bookmarks will become invalid

Alternative Actions

Before deleting, consider these alternatives:

  • Make Private: Set isPrivate: true to hide from end users
  • Unpublish: Set content publishStatus: "unpublished" to hide specific versions
  • Archive: Move to an archive category instead of deleting
  • Redirect: Set up redirects before deletion if the content is moving

Backup Recommendations

  • Export article content before deletion
  • Save important analytics data
  • Document any external references to the article
  • Notify team members of planned deletions

Best Practices

  • Verify Before Deletion: Use GET /articles to confirm the article exists and review its content
  • Backup Important Content: Export article data before deletion using GET /articles
  • Check External References: Ensure no external systems or documentation link to this article
  • Consider Alternatives: Instead of deletion, consider making articles private or unpublished
  • Handle Errors Gracefully: Implement proper error handling for non-existent articles
  • Respect Rate Limits: Add delays between multiple deletions to avoid hitting limits

Common Error Scenarios

Article Not Found

Cause: Using incorrect correlation ID or article already deleted
Solution: Verify correlation ID using GET /articles endpoint first

Authentication Issues

Cause: Invalid or expired API token
Solution: Regenerate API token and update authorization header

Rate Limiting

Cause: Too many deletion requests in short time
Solution: Implement delays between requests and batch operations appropriately

Rate Limiting

For detailed information about API limits and optimization strategies, please consult our guide on rate limiting.

Error Response Examples

400 Bad Request - Missing Correlation ID

{
  "error": "Correlation ID is required"
}

400 Bad Request - Article Not Found or Other Error

{
  "error": "Article with correlation ID 'invalid-id' not found"
}

401 Unauthorized

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

500 Internal Server Error

{
  "error": "Internal server error occurred while deleting article"
}


Was this article helpful?