Manage your Knowledge articles using invocable actions.
Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.
Important
The Assign and Publish actions are available in API version 44.0 and later. All the other actions are available in API version 45.0 and later.
Lightning Knowledge must be set up in your org. The user must have permissions to manage articles.
You can use multiple inputs to an invocable action. This technique is useful for actions that don’t take lists, such as restoreKnowledgeArticleVersion.
The following code sample illustrates a response with one success and one failure:
1[{2 "actionName" : "archiveKnowledgeArticles",3 "errors" : null,4 "isSuccess" : false,5 "outputValues" : {6 "ka0RM00000004Ve" : "You can't perform this action. Be sure the action is valid for the current state of the article, and that you have permission to perform it.",7 "ka0RM00000003do" : "Success"8}9}]
Required. Edit action for primary language or translation articles. Valid actions are: EDIT_AS_DRAFT_ARTICLE or EDIT_AS_DRAFT_TRANSLATION.
unpublish
boolean
Required. Indicates whether to keep the article published (false) or archive the published article (true). Use false to keep the current article version online and create a draft. Use true to archive the current online version, which removes it from the knowledge base, and creates a draft.
articleVersionId
string
Article version ID. Required to create a draft from an online (published) translation. Optional to create a draft from the online primary article if the Article ID is provided.
articleId
string
Article ID. Required when creating a draft from the online (published) primary article if the Article Version ID isn’t provided.
Sample Input
The following code sample creates a draft from a primary article and archives the original article:
Required. Comma-separated article version ID list.
pubAction
string
Required. Publish action. Valid actions are: PUBLISH_ARTICLE (replaces the latest version), PUBLISH_ARTICLE_NEW_VERSION (creates a new version), SCHEDULE_ARTICLE_FOR_PUBLICATION, or PUBLISH_TRANSLATION.
pubDate
string
Optional. Scheduled publish date in ISO 8601 format yyyy-MM-dd\'T\'HH:mm:ss.SSSZ. For example, for February 8, 2023, 1:40 pm UTC+01:00 use 2023-02-08T13:40:00.000+0100.
Knowledge actions can respond with two types of error responses: action-scoped errors and item-scoped errors.
Action-scoped errors describe an error about the overall action that you’re trying to invoke. Action-scoped errors have a statusCode in addition to a message. This example illustrates an action-scoped error caused by sending invalid input values.
1[{2 "actionName" : "restoreKnowledgeArticleVersion",3 "errors" : [{4 "statusCode" : "INVALID_API_INPUT",5 "message" : "You can't perform this action. Be sure the action is valid for the current state of the article, and that you have permission to perform it.",6 "fields" : []7}],8 "isSuccess" : false,9 "outputValues" : null10}]
Item-scoped errors describe a problem with a specific article or article version within the action. For example, this code illustrates an archiveKnowledgeArticles action response with one failed item and one successful item.
1[{2 "actionName" : "archiveKnowledgeArticles",3 "errors" : null,4 "isSuccess" : false,5 "outputValues" : {6 "ka0RM00000004Ve" : "You can't perform this action. Be sure the action is valid for the current state of the article, and that you have permission to perform it.",7 "ka0RM00000003do" : "Success"8}9}]
If any type of error occurs with an action, the isSuccess field is false.