- Content Manager
- V4
This API allows a user to edit details of a single article. To specify whether you are editing, checking in, or publishing the article, use the required operation query parameter.
A property omitted from the request is left unchanged. To remove a value, send it explicitly in the form that matches its type:
- Strings — send an empty string (
""). For example,"summary": ""clears the version summary. - Objects — send
null. For example,"compliancePolicy": nullunassigns the compliance policy from the article. An object is removed as a whole;{}is not a removal form and is treated as an object with no properties supplied. - Arrays — the supplied array replaces the current one in full; there is no partial add or remove. To drop two entries and add one, send the complete list as it should read after the edit. To clear an array, send an empty array (
[]). - Dates and numbers — send
null. There is no empty date or empty number, so""is not accepted. For example,"expirationDate": nullclears the expiration date.
These rules apply at every level of the request body. Within an object supplied for update, its own properties follow the same rules: those omitted are left unchanged, and those sent as "", null, or [] are removed. For example, "macro": { "defaultValue": "" } clears the macro's default value and leaves the rest of the macro unchanged.
links and unlinks are the exception to the array rule. They do not replace a collection; they describe resource associations to add and to remove — for example, topics and related articles.
Not every property can be removed. Some must always hold a value — such as versions.name, versions.articleType, versions.ownedBy, and versions.availabilityDate — and sending "" or null for them is rejected instead of clearing the value. Read-only properties cannot be sent at all.
content is authoritative for the version's inline images. Send it as the article should read after the edit — images to keep, images to add, and no tag for images to drop.
- Keep an existing image by leaving its tag as Get Article returned it. The server resolves the image from
idalone and never readssrc, sosrccan be omitted and a signature that has since expired is not a problem. - Add a new image exactly as in Create Article — pre-upload it with
applicationset toarticleandisInlineset totrue, then put the returnedfileUploadIdon the tag. - Remove an image by dropping its tag. An inline image whose tag is not present in the submitted
contentis removed from the version.
<img id="96ea5bd9-36dd-4771-aaa7-aa8cf794307e" alt="Forgot password link" width="480" />
<img fileUploadId="c1f0a3d2-9b47-4e15-8a6c-2d7e5f4b8091" alt="Reset confirmation" width="480" />- A tag must not carry both
idandfileUploadId. Sending both is rejected with400. - An
idthat does not exist, or that belongs to a different article or version, is rejected with400, and no change is saved. - Inline images are never listed in
attachments. The two are separate uploads, distinguished byisInlineat pre-upload time, and are managed independently. - Omitting
contentleaves the current content, and with it the current inline images, unchanged.
Each newly added image is stored and its tag rewritten into the hosted form, so the next Get Article returns it with a generated id and a signed src, alongside the images that were kept.
The user must have either the Author or Knowledge Base Manager role, or a custom role with Edit Article action. Additionally:
- If article is being edited using any operation
- User must have
Edit Articlepermission on the parent folder. - If related article links or unlinks are supplied with the request, the user must have
View Folderpermission on the parent folder for each of the related articles.
- User must have
- If
operationischeckin- If the article is not in the draft stage, the user must be a contributor of the current article stage.
- If
operationispublish- The requesting user must be allowed by this article's workflow to move the article to
publishedstage.
- The requesting user must be allowed by this article's workflow to move the article to
- Article must have been checked out by the requesting user.
- When
versionsis included, the article version being edited is always the latest version.
- The article name (
versions[].name) must be unique among articles of the same language in the same folder. Renaming the article in the$langlanguage, including translating its name, to a name already used by another article in that folder and language is rejected with409. The same name in a different language is not a conflict.
The article authoring operation to perform.
edit— edit article content and metadata. The request body must include at least one writable property.checkin— check in the article, optionally with edits. Send{}to check in without changing any fields.publish— publish the article, optionally with edits. Send{}to publish without changing any fields.
Version object with the fields to update. Omitted version properties are left unchanged.
Macros are embeddable shortcuts to article content — they substitute lengthy or dynamic text with short values. If a new macro is created while editing an article, the name field is required.
To unassign the macro from the article, send null. Omitting the property leaves the current macro unchanged.
Compliance policy associated with the article; defines when users must complete the Read & Sign for an article.
To remove the compliance policy from the article, send null. Omitting the property leaves the current compliance policy unchanged.
Custom attribute values for this article. Each entry corresponds to an attribute definition that already exists in the system.
The supplied array replaces the current set in full. To unassign the values of an individual custom attribute, send the array containing only the attributes that should remain. To unassign the values of every custom attribute at once, send an empty array ([]). Omitting the property leaves the current custom attributes unchanged.
attribValues requires at least one value, so an individual attribute's values cannot be cleared by sending it with an empty attribValues array. Omit that attribute from the supplied customAttributes array instead.
Indicates the resource type being added to the article—for example, topic or related article. Accepted rel values are topic and article, respectively. The payload may use a comma-separated list of IDs in href, or multiple Links.
- Production Serverhttps://api.egain.cloud/knowledge/contentmgr/v4/articles/{articleIDs}
Every writable request field populated for operation=edit and operation=checkin. attachments keeps existing attachment 9001 by its id and adds a newly uploaded file by its fileUploadId; any attachment not listed is removed. content does the same for inline images — it keeps image 96ea5bd9-36dd-4771-aaa7-aa8cf794307e by its id and adds a pre-uploaded image by its fileUploadId; any image whose tag is dropped is removed.
label and isMajorUpdate are rejected with 400 unless operation=publish.
curl -i -X PATCH \
'https://api.egain.cloud/knowledge/contentmgr/v4/articles/PROD-2996?operation=edit&%24lang=en-US' \
-H 'Accept-Language: en-US' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'If-Match: 2026-04-15T09:00:00.000Z' \
-d '{
"relatedQuestions": [
"How do I reset my password?",
"What if the reset email never arrives?"
],
"customAttributes": [
{
"attribInternalName": "audience",
"attribValues": [
{
"value": "Administrators"
}
]
}
],
"compliancePolicy": {
"id": "5001"
},
"links": [
{
"rel": "topic",
"href": "/knowledge/contentmgr/v4/topics/KB-3102"
},
{
"rel": "article",
"href": "/knowledge/contentmgr/v4/articles/PROD-4102"
}
],
"unlinks": [
{
"rel": "topic",
"href": "/knowledge/contentmgr/v4/topics/KB-3103"
},
{
"rel": "article",
"href": "/knowledge/contentmgr/v4/articles/PROD-3050"
}
],
"macro": {
"name": "password_reset_support_hours",
"description": "Reusable support-hours note for password reset content.",
"defaultValue": "Agents respond within 24 hours.",
"fallbackArticle": {
"id": "PROD-2997"
}
},
"versions": [
{
"name": "How to reset your password",
"description": "Steps to reset a forgotten password.",
"keywords": "password reset,sign-in,troubleshooting",
"summary": "Reset your password from the account portal.",
"additionalInfo": "Applies to SSO and local accounts.",
"content": "<p>Open the sign-in page, select <b>Forgot password</b>, and follow the emailed reset instructions.</p><p><img id=\"96ea5bd9-36dd-4771-aaa7-aa8cf794307e\" alt=\"Forgot password link\" width=\"480\" /></p><p><img fileUploadId=\"7b2e94a1-0c58-4d63-9f17-5ae83b6c204d\" alt=\"Reset confirmation\" width=\"480\" /></p>",
"structuredAuthoring": {
"confidenceLevel": {
"value": "validated"
},
"environment": "Online banking portal, Account Management",
"issueDescription": "Customer cannot complete password reset after being redirected from the sign-in page.",
"issueCause": "Redirect URI mismatch between the portal and the identity provider."
},
"availabilityDate": "2027-08-19T09:00:00.000Z",
"expirationDate": "2028-04-14T23:59:59.000Z",
"imageUrl": "https://www.example.com/images/kb/password-reset-draft.png",
"attachments": [
{
"id": "9001"
},
{
"fileUploadId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
],
"articleType": {
"id": "932100000002021"
},
"personalization": {
"accessTagCategories": [
{
"id": "300",
"tags": [
{
"id": "301"
}
],
"tagGroups": [
{
"id": "330"
}
]
}
],
"filterTagCategories": [
{
"id": "310",
"tags": [
{
"id": "311"
}
],
"tagGroups": [
{
"id": "340"
}
]
}
],
"publishViews": [
{
"id": "320"
}
]
},
"ownedBy": {
"id": "1005"
},
"includeInGenAI": true
}
]
}'No content