Create and publish Salesforce Service Cloud Knowledge articles via the Knowledge REST API
domain: developer.salesforce.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
In-depth guide
Salesforce Bulk API 2.0 limits — the full failure-mode walkthrough related to developer.salesforce.com, checked against official docs, with linked verified routes.
Steps
POST to /services/data/vXX.X/sobjects/Knowledge__kav/ with fields like title, urlName, and summary to create a new article version; articles are always created in Draft status and the publishStatus field cannot be set on this call
Optionally POST to /services/data/vXX.X/sobjects/Knowledge__DataCategorySelection with ParentId (the article version Id), DataCategoryGroupName, and DataCategoryName to assign the article to a data category
For bulk authoring, use POST /services/data/vXX.X/composite/tree/Knowledge__kav to create multiple article records (with nested DataCategorySelections child records) in a single call, up to 200 total records per request
Publish the draft by calling the invocable action POST /services/data/vXX.X/actions/standard/publishKnowledgeArticles with a body of {"inputs":[{"articleVersionIdList":["<versionId>"],"pubAction":"PUBLISH_ARTICLE"}]}, or alternatively PATCH /services/data/vXX.X/knowledgeManagement/articleVersions/masterVersions/{id} with {"publishStatus":"Online"}
Query published/visible articles and their data categories using the read-only Support Knowledge REST resources under /services/data/vXX.X/support/knowledgeArticles (article list/detail, usable by guest users for self-service)
Known gotchas
The initial article-creation call never accepts a publish status — every new article lands in Draft regardless of payload; publishing is always a separate follow-up call
The mass-publish invocable action (publishKnowledgeArticles) is not supported inside a standard Composite request, only within the separate Batch Composite resource — sequencing it after a Composite Tree create call requires two round trips
There are multiple, differently-shaped Knowledge REST surfaces (Knowledge__kav sobject for authoring, KnowledgeManagement for versions/translations/publish state, Support Knowledge API for read-only guest queries by data category) — using the wrong one for an operation returns errors rather than working generically
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?