Articles must be in published status (with a PublishSatus field value of Online) for you to manage their promoted terms.
// Identify the article to promote in search results List<MyArticle__kav> articles = [SELECT Id FROM MyArticle__kav WHERE PublishStatus='Online' AND Language='en_US' AND Id='Article Id']; // Define the promotion rule SearchPromotionRule s = new SearchPromotionRule( Query='Salesforce', PromotedEntity=articles[0]); // Save the new rule insert s;