Delete Article Content by Language

DELETE /articles/{correlationId}/content/{lang} - Delete Article Content by Language

Delete all content versions for a specific language from an article. This operation removes all content versions in the specified language while preserving the article and content in other languages.

Endpoint

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

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. Can be custom ID or internal ID prefixed with 'pf_'

lang

string

Yes

The language code of the content to delete (ISO 639-1 format, e.g., 'en', 'es', 'fr')

Parameter Details

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")

Language Code Format

  • Must be a valid ISO 639-1 language code (2 characters)
  • Case-sensitive (use lowercase)
  • Examples: en, es, fr, de, zh, ja

Response Format

Success Response (200 OK)

{
  "message": "Article content for language 'en' deleted successfully"
}

Examples

Example 1: Delete English Content

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

Response:

{
  "message": "Article content for language 'en' deleted successfully"
}

Example 2: Delete Spanish Content by Internal ID

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

Response:

{
  "message": "Article content for language 'es' deleted successfully"
}

Example 3: Error Handling Example

# Attempt to delete content that doesn't exist
curl -X DELETE "https://api.productfruits.com/v1/knowledgebase/articles/getting-started-001/content/zh" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response (400 Bad Request):

{
  "error": "Article with correlation ID 'getting-started-001' not found"
}

What Gets Deleted

When you delete content for a specific language, the following items are permanently removed:

Content Data

  • All content versions in the specified language
  • Published and unpublished content versions
  • Content metadata (title, slug, keywords, lead)
  • Content creation and modification history

Language-Specific Data

  • SEO data for that language
  • Search index entries for that language
  • Analytics data specific to that language content
  • User engagement data (views, feedback) for that language

What Remains Intact

  • Article metadata and settings
  • Content in other languages
  • Category assignments
  • Featured status and ordering
  • Alternate slugs for other languages

Common Use Cases

Language Deprecation

Remove content in languages no longer supported by your organization

Content Quality Control

Remove auto-translated or machine-generated content that doesn't meet quality standards

Localization Strategy Changes

Remove content before implementing new translation workflows

Compliance Requirements

Remove content that doesn't meet regional legal or regulatory requirements

Best Practices

  • Verify Content Exists: Use GET /articles to confirm the article and language content exists
  • Check Language Impact: Ensure you're not removing the last language from an article
  • Backup Content: Export content using GET /articles before deletion for recovery purposes
  • Consider Alternatives: Instead of deletion, consider unpublishing content or making it private
  • Respect Rate Limits: Add delays between multiple deletions to avoid hitting rate limits
  • Handle Errors Gracefully: Implement proper error handling for non-existent content

Common Error Scenarios

Article Not Found

Cause: Incorrect correlation ID or article doesn't exist
Solution: Verify the correlation ID using GET /articles endpoint

Language Content Not Found

Cause: No content exists in the specified language
Solution: Check available languages in the article before attempting deletion

Invalid Language Code

Cause: Using incorrect language code format
Solution: Use valid ISO 639-1 language codes (e.g., 'en', 'es', 'fr')

Rate Limiting

Detailed information about API limits and optimization strategies can be found by consulting this guide.

Error Response Examples

400 Bad Request - Missing Correlation ID

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

400 Bad Request - Missing Language Code

{
  "error": "Language code is required"
}

400 Bad Request - Article or Content Not Found

{
  "error": "Article with correlation ID 'article-001' not found"
}

401 Unauthorized

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

500 Internal Server Error

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


Was this article helpful?