Knowledge API article publish fails with validation error on custom field Approval_Status__c

Our automated publishing workflow for knowledge articles is failing when we try to publish via the Knowledge API. The articles save as drafts successfully, but the publish action throws a validation error related to a custom field ‘Approval_Status__c’.

Error response:

{
  "message": "Required fields are missing: [Approval_Status__c]",
  "errorCode": "REQUIRED_FIELD_MISSING",
  "fields": ["Approval_Status__c"]
}

The weird thing is this field IS populated when we create the draft - I can see it in the UI with value ‘Pending’. But when the automated publishing workflow runs (usually 24-48 hours after draft creation), the publish fails. Manual publishing from the UI works fine. We have about 50-60 articles per week going through this workflow and it’s disrupting our content release schedule. Is there something special about Knowledge API required fields during the publish transition that I’m missing?

You’ve hit a common gotcha with Knowledge API custom field validation and automated publishing workflows. Here’s the complete solution:

Root Cause: Knowledge API treats publishing as creating a new article version, not just a status change. Custom fields marked as required must be explicitly provided in the publish request, even if they exist on the draft version. The UI handles this automatically by copying field values, but the API requires explicit specification.

Solution for Knowledge API Required Fields:

  1. Query the Draft Version First: Before publishing, retrieve all custom field values from the current draft:
GET /services/data/v60.0/sobjects/Knowledge__kav/{articleId}
// Include all custom fields in query
  1. Include Custom Fields in Publish Request: When calling the publish action, include ALL required custom fields:
PATCH /services/data/v60.0/sobjects/Knowledge__kav/{articleId}
{
  "ValidationStatus": "Published",
  "Approval_Status__c": "Approved",
  // Include any other required custom fields
}

Automated Publishing Workflow Fix:

Update your workflow to follow this pattern:

  1. Pre-Publish Validation: Query the draft article and verify all required custom fields have values
  2. Field Value Preservation: Store these field values in your workflow state
  3. Publish with Full Payload: Include all required custom fields in the publish API call
  4. Post-Publish Verification: Query the published version to confirm field values persisted

Handling Multi-Language Articles: If you have translations, each language version needs the custom fields set independently. Loop through all translations and apply the same field values to each version before publishing.

Custom Field Validation Rules: Review your validation rules on the Knowledge__kav object. Make sure they’re not triggering during the Draft→Published transition. Add a condition to exclude validation during status changes:


AND(ISCHANGED(ValidationStatus), ValidationStatus = 'Published')

Best Practice for Content Lifecycle Automation:

  • Create a custom field mapping configuration that defines which fields must be included in publish requests
  • Build a reusable function that queries draft values and constructs the complete publish payload
  • Add logging to track which fields are missing when publish fails
  • Implement a pre-flight check that validates all required fields before attempting publish

This approach has resolved similar issues for several clients. Your 50-60 articles per week should flow smoothly once you’re explicitly passing custom field values in the publish API calls.


This draft is based on general Salesforce knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

Check if your custom field is marked as required on the page layout. Sometimes fields are required for publishing but not for draft creation. The Knowledge API respects page layout field requirements differently than the UI does.

We had a similar issue last quarter. The problem was that our validation rule was checking the field value during the status transition from ‘Draft’ to ‘Online’. The field was populated, but the validation rule was evaluating it at the wrong time in the lifecycle. Check your validation rules for any logic that fires on status changes - they might be clearing or resetting the field value before the API can read it.

Are you using KnowledgeArticleVersion object in your API calls? When publishing, you need to update the specific version, not the article master. Try this approach: query for the draft version first using the article number, then issue the publish action against that version ID. The field values might not be persisting correctly across version transitions.

Tested this on API v58.0 by querying the draft KnowledgeArticleVersion fields first, then explicitly passing Approval_Status__c in the publish PATCH request — validation error gone.

I think the issue is with how Knowledge API handles custom field validation during automated publishing workflows. When you publish manually from UI, Salesforce applies field values from the current context. But API calls need explicit field values in the publish request body, even if they’re already set on the draft.

Check your API payload - are you including all required custom fields in the publish call itself, or are you assuming they carry over from the draft? Knowledge articles have complex versioning and the field values don’t always transfer automatically during status transitions via API.

That makes sense about the payload. So I need to explicitly set Approval_Status__c in the publish API call even though it exists on the draft? That seems redundant but I’ll try it.