# Create Article

## Overview
This API allows a user to create an article in a folder. The article is created in every
enabled knowledge base language. `language` in the request body is the source language,
in which the supplied content is authored.
Newly created articles are created in the checked-out (locked) state.
This operation is not for suggestions.
Some properties in the request schema are shown as allowing `null`, because `null` is how
the [Edit Article](../apis/v4/knowledge/contentmgr/api-bundled/articles/editarticle) API
removes them. On create there is nothing to remove, so sending `null` is unnecessary
and equivalent to omitting the property.
### Inline images
An image embedded in `content` is uploaded before the article is created, through the same
pre-upload flow as an attachment. Pre-upload it with the File Manager
[Generate URL to upload a file](../apis/v4/core/filemgr/api-bundled/storageservice/generatefilepreuploadurl)
API, with `application` set to `article` and `isInline` set to `true`. Send the image bytes
to the returned `uploadUrl`, then place the returned `fileUploadId` as an attribute on the
HTML tag that renders the image — for example, `<img>`:

```html
<img fileUploadId="c1f0a3d2-9b47-4e15-8a6c-2d7e5f4b8091" alt="Forgot password link" width="480" />
```
The `fileUploadId` attribute is what the server resolves; the tag carrying it is not
constrained. Whichever tag the content uses for images — for example, `<img>` or
`<picture>` — is accepted and stored as sent.
* `fileUploadId`
 is the only attribute the server resolves the image from. Don't send
`src`

alongside it as it will be ignored.
* Every other attribute on the tag, such as
`alt`
,
`width`
,
`height`
,
`style`
, and
`class`
,

is preserved.
* The same
`fileUploadId`
 can be referenced by more than one tag; each resolves to the same

stored image.
* A
`fileUploadId`
 that is unknown, expired, or was pre-uploaded with
`isInline`
 set to

`false`
 is rejected with
`400`
, and the article is not created.
* Inline images and attachments are separate uploads. An image pre-uploaded with
`isInline`

set to
`true`
 belongs in
`content`
 only and must not be listed in

`versions[].attachments`
; a file pre-uploaded with
`isInline`
 set to
`false`
 belongs in

`versions[].attachments`
 only.
* A
`fileUploadId`
 attribute is interpreted in
`versions[].content`
 only. In any other

property it is stored as ordinary text.

The server stores the image and rewrites the tag into its hosted form, replacing
`fileUploadId` with a generated `id` and a signed `src` and carrying the other attributes
through. The tag name itself is unchanged. For the tag above,
[Get Article](../apis/v4/knowledge/contentmgr/api-bundled/articles/getarticlewithcontent)
returns:

```html
<img id="96ea5bd9-36dd-4771-aaa7-aa8cf794307e" src="https://api.egain.cloud/core/filemgr/v4/assets/download?signature=35674B764E7848586E786..." alt="Forgot password link" width="480" />
```
## Permissions
The user must have either the `Author` or `Knowledge Base Manager` role, or a custom role
with `Create Article` action. Additionally:
* The user must have
`Create Article`
 permission on the article's parent folder.
* If related article links are supplied in the request, the user must have

`View Folder`
 permission on each of the related article's parent folder.

## Conflicts
* The article name (
`versions[].name`
) must be unique among articles of the same language

in the same folder. The article is created in every enabled knowledge base language, so a

name already used by another article in that folder in any of those languages is rejected

with
`409`
.

Endpoint: POST /articles
Security: oAuthUser, oAuthOnBehalfOfUser

## Description:

  - `Overview` ()
    This API allows a user to create an article in a folder. The article is created in every
enabled knowledge base language. `language` in the request body is the source language,
in which the supplied content is authored.
Newly created articles are created in the checked-out (locked) state. This operation is not for suggestions. Some properties in the request schema are shown as allowing `null`, because `null` is how
the [Edit Article](../apis/v4/knowledge/contentmgr/api-bundled/articles/editarticle) API
removes them. On create there is nothing to remove, so sending `null` is unnecessary
and equivalent to omitting the property.

  - `Inline images` ()
    An image embedded in `content` is uploaded before the article is created, through the same
pre-upload flow as an attachment. Pre-upload it with the File Manager
[Generate URL to upload a file](../apis/v4/core/filemgr/api-bundled/storageservice/generatefilepreuploadurl)
API, with `application` set to `article` and `isInline` set to `true`. Send the image bytes
to the returned `uploadUrl`, then place the returned `fileUploadId` as an attribute on the
HTML tag that renders the image — for example, `<img>`: ```html
<img fileUploadId="c1f0a3d2-9b47-4e15-8a6c-2d7e5f4b8091" alt="Forgot password link" width="480" />
``` The `fileUploadId` attribute is what the server resolves; the tag carrying it is not
constrained. Whichever tag the content uses for images — for example, `<img>` or
`<picture>` — is accepted and stored as sent. * `fileUploadId`
 is the only attribute the server resolves the image from. Don't send
`src`

alongside it as it will be ignored.
* Every other attribute on the tag, such as
`alt`
,
`width`
,
`height`
,
`style`
, and
`class`
,

is preserved.
* The same
`fileUploadId`
 can be referenced by more than one tag; each resolves to the same

stored image.
* A
`fileUploadId`
 that is unknown, expired, or was pre-uploaded with
`isInline`
 set to

`false`
 is rejected with
`400`
, and the article is not created.
* Inline images and attachments are separate uploads. An image pre-uploaded with
`isInline`

set to
`true`
 belongs in
`content`
 only and must not be listed in

`versions[].attachments`
; a file pre-uploaded with
`isInline`
 set to
`false`
 belongs in

`versions[].attachments`
 only.
* A
`fileUploadId`
 attribute is interpreted in
`versions[].content`
 only. In any other

property it is stored as ordinary text. The server stores the image and rewrites the tag into its hosted form, replacing
`fileUploadId` with a generated `id` and a signed `src` and carrying the other attributes
through. The tag name itself is unchanged. For the tag above,
[Get Article](../apis/v4/knowledge/contentmgr/api-bundled/articles/getarticlewithcontent)
returns: ```html
<img id="96ea5bd9-36dd-4771-aaa7-aa8cf794307e" src="https://api.egain.cloud/core/filemgr/v4/assets/download?signature=35674B764E7848586E786..." alt="Forgot password link" width="480" />
```

  - `Permissions` ()
    The user must have either the `Author` or `Knowledge Base Manager` role, or a custom role
with `Create Article` action. Additionally: * The user must have
`Create Article`
 permission on the article's parent folder.
* If related article links are supplied in the request, the user must have

`View Folder`
 permission on each of the related article's parent folder.

  - `Conflicts` ()
    * The article name (
`versions[].name`
) must be unique among articles of the same language

in the same folder. The article is created in every enabled knowledge base language, so a

name already used by another article in that folder in any of those languages is rejected

with
`409`
.

## Security:

  - `oAuthUser` (unknown)
    oauth2 scopes: https://api.egain.cloud/auth/knowledge.contentmgr.manage

  - `oAuthOnBehalfOfUser` (unknown)
    oauth2 scopes: https://api.egain.cloud/auth/knowledge.contentmgr.onbehalfof.manage

## Header parameters:

  - `Content-Type` (string, required)
    The media type sent by the client.

  - `Accept-Language` (string, required)
    The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).

## Request fields (application/json):

  - `language` (object, required)
    The knowledge-base language for this resource.

  - `language.code` (string, required)
    The BCP 47 knowledge-base locale code.
    Enum: "ar-AE", "bg-BG", "cs-CZ", "da-DK", "de-AT", "de-DE", "el-GR", "en-GB", "en-US", "es-ES", "fi-FI", "fil-PH", "fr-CA", "fr-FR", "hi-IN", "hu-HU", "id-ID", "it-IT", "ja-JP", "ko-KR", "ms-MY", "nb-NO", "nl-NL", "nn-NO", "pl-PL", "pt-BR", "pt-PT", "ro-RO", "ru-RU", "sk-SK", "sl-SI", "sr-RS", "sv-SE", "th-TH", "tr-TR", "uk-UA", "vi-VN", "zh-Hans", "zh-Hant", "xx-XX"

  - `versions` (array, required)
    Article version to create.

  - `versions.isMajorUpdate` (boolean)
    Whether this version is a major update. On Article edits, this property is only allowed when the article is being published, otherwise it is rejected with `400`.

  - `versions.label` (string)
    Release summary for the version. On Article edits, this property is only allowed when the article is being published, otherwise it is rejected with `400`.

  - `versions.content` (string)
    Raw HTML content of the current article's version. The maximum size is 2 MB. The number of characters that fit depends on the language.

  - `versions.attachments` (array)
    Attachments linked to this article version.

  - `versions.attachments.id` (string)
    The ID of the attachment.

  - `versions.attachments.created` (object)
    Date and user who uploaded the attachment.

  - `versions.attachments.created.user` (object, required)

  - `versions.attachments.created.user.id` (string, required)
    The ID of the user.

  - `versions.attachments.created.date` (string, required)
    The date and time associated with this object.

  - `versions.attachments.fileUploadId` (string)
    Identifier of a pre-uploaded file, returned by the File Manager
[Generate URL to upload a file](../apis/v4/core/filemgr/api-bundled/storageservice/generatefilepreuploadurl)
API.
Upload the file before referencing it here. That API returns a `fileUploadId` together
with a short-lived signed `uploadUrl`; send the file bytes to the `uploadUrl`, then send
the `fileUploadId` in this property to attach the uploaded file to the article version.
Once attached, the file receives an attachment `id`, which is what identifies it on
subsequent edits. The `fileUploadId` has no further use.

  - `versions.name` (string, required)
    The name of the article in this version's language. Must be unique among articles of the same language in the same folder. The same name in a different language is not a conflict.

  - `versions.created` (object)
    Created date and created by user for this article version.

  - `versions.lastModified` (object)
    Last modified date and user for this article version.

  - `versions.description` (string)
    The article version's description. The maximum size is 1 KB. The number of characters that fit depends on the language.

  - `versions.keywords` (string)
    The keywords for the version. The maximum size is 1 KB. The number of characters that fit depends on the language.

  - `versions.summary` (string)
    A summary metadata of the version. The maximum size is 1 KB. The number of characters that fit depends on the language.

  - `versions.additionalInfo` (string)
    Additional information for the version. The maximum size is 1 KB. The number of characters that fit depends on the language.

  - `versions.structuredAuthoring` (object)
    This property is only applicable when structured authoring is enabled for the article type and department.

  - `versions.structuredAuthoring.confidenceLevel` (object)
    Stage of the article lifecycle indicating author confidence in readiness.
On Edit Article, send `null` to clear the confidence level. Omitting the property leaves
the current value unchanged.

  - `versions.structuredAuthoring.confidenceLevel.value` (string)
    Supported values:
- `work_in_progress`
- `not_validated`
- `validated`
- `archived`

Additional values may be added in the future, so clients should handle unrecognized values gracefully.

  - `versions.structuredAuthoring.environment` (string)
    Specifies the relevant product, category, or business process tied to the issue. The maximum size is 1 KB. The number of characters that fit depends on the language.

  - `versions.structuredAuthoring.issueDescription` (string)
    Describes the problem, symptom, or question the article addresses. The maximum size is 1 KB. The number of characters that fit depends on the language.

  - `versions.structuredAuthoring.issueCause` (string)
    Identifies the underlying cause of the issue. The maximum size is 1 KB. The number of characters that fit depends on the language.

  - `versions.availabilityDate` (string)
    The date that the version becomes available, in UTC. Availability date must not be
more than 1 year into the future.
    Example: 2026-04-15T09:00:00.000Z

  - `versions.expirationDate` (string)
    The date that the version expires, in UTC. Expiration date must not be more than 5 years into the future.
    Example: 2028-04-14T23:59:59.000Z

  - `versions.imageUrl` (string)
    Image URL (http, https, or ftp). Empty allowed. Min 10 characters when provided.
    Example: https://www.example.com/images/kb/release-banner.png

  - `versions.articleType` (object)
    Article type. Defaults to General during article creation if not provided.

  - `versions.articleType.id` (string, required)
    The ID of the article type.
    Example: 932100000002020

  - `versions.personalization` (object)
    Personalization controls article access, search filtering, and publish views.

  - `versions.personalization.accessTagCategories` (array)
    Tag categories that restrict visibility to matching users or groups.
On Edit Article, the supplied array replaces the current one in full — each supplied
tag category is taken as complete, including its `tags` and `tagGroups`. To remove all
access tag categories, send an empty array (`[]`). Omitting the property leaves the
current value unchanged.

  - `versions.personalization.accessTagCategories.id` (string, required)
    The ID of the tag category.

  - `versions.personalization.accessTagCategories.tags` (array)
    Tags selected in this category.

  - `versions.personalization.accessTagCategories.tags.id` (string, required)
    The ID of the tag.

  - `versions.personalization.accessTagCategories.tagGroups` (array)
    Tag groups selected in this category.

  - `versions.personalization.accessTagCategories.tagGroups.id` (string, required)
    The ID of the tag group.

  - `versions.personalization.filterTagCategories` (array)
    Tag categories used to refine search when request tags or tag groups match.
On Edit Article, the supplied array replaces the current one in full — each supplied
tag category is taken as complete, including its `tags` and `tagGroups`. To remove all
filter tag categories, send an empty array (`[]`). Omitting the property leaves the
current value unchanged.

  - `versions.personalization.publishViews` (array)
    Publish view for the article.
On Edit Article, the supplied array replaces the current one in full. To remove all
publish views, send an empty array (`[]`). Omitting the property leaves the current
value unchanged.

  - `versions.personalization.publishViews.id` (string, required)
    The ID of the publish view.

  - `versions.ownedBy` (object)
    The user who owns the article. Defaults to the author.

  - `versions.includeInGenAI` (boolean)
    Whether this version allows Generative AI to be used for Instant Answers.

  - `macro` (object)
    Describes the Macro associated with the article. Macros are embeddable shortcuts to article
content — they substitute lengthy or dynamic text with short values.

  - `macro.name` (string)
    The macro name.

  - `macro.description` (string)
    Description of the macro.

  - `macro.defaultValue` (string)
    Displayed when the macro expands and the source article has no content. Use as a short fallback for empty source content.

  - `macro.fallbackArticle` (object)
    If expansion fails, show this article's published and available content instead of an
error. The user must have access to the folder containing the article.
On Edit Article, send `null` to remove the fallback article while keeping the macro
itself. Omitting the property leaves the current fallback article unchanged.

  - `macro.fallbackArticle.id` (string, required)
    The ID of the article.
    Example: PROD-2996

  - `unlinks` (array)
    Indicates the resource type being removed from the current 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.

  - `unlinks.rel` (string)
    Defines the relationship between a linked resource and the current object—for example a resource type name such as *article* or *topic* as defined by the API for that link.

  - `unlinks.href` (string)
    The URL that specifies the link's destination.

  - `links` (array)
    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.

  - `lastModified` (object)
    Last modified date and user for the article.

  - `created` (object)
    Created date and created by user.

  - `department` (object)
    Department the article belongs to.

  - `department.id` (string)
    The ID of the department.
    Example: 999

  - `suggestionStatus` (any)
    Status of the suggestion. Applies only to article suggestions.

  - `articleReviewDetails` (object)
    Review and workflow information for the article.

  - `articleReviewDetails.currentReviewStage` (object)
    The current review stage for the article.

  - `articleReviewDetails.currentReviewStage.id` (string)
    The ID of the review stage.

  - `articleReviewDetails.currentReviewStage.name` (string)
    The name of the review stage.

  - `articleReviewDetails.previousReviewStage` (object)
    The previous review stage for the article.

  - `articleReviewDetails.currentWorkflow` (object)
    The current workflow assigned to the article.

  - `articleReviewDetails.currentWorkflow.id` (string)
    The ID of the workflow.

  - `articleReviewDetails.currentWorkflow.name` (string)
    The name of the workflow.

  - `articleReviewDetails.lastReviewedBy` (object)
    The user who most recently reviewed the article.

  - `lockedBy` (object)
    User who currently has the article checked out, if any.

  - `folder` (object, required)
    The folder this article belongs to.

  - `folder.id` (string, required)
    ID of folder.

  - `compliancePolicy` (object)
    Compliance policy associated with the article; defines when users must complete the Read & Sign for an article.

  - `compliancePolicy.id` (string, required)
    The ID of the compliance policy.

  - `compliancePolicy.created` (object)
    Created date and created by user.

  - `compliancePolicy.lastModified` (object)
    Last modified date of current compliance policy.

  - `relatedQuestions` (array)
    Related questions for the article.

  - `customAttributes` (array)
    Custom attribute values for this article. Each entry corresponds to an attribute definition that already exists in the system.

  - `customAttributes.attribInternalName` (string, required)
    The custom attribute's internal name.

  - `customAttributes.attribValues` (array, required)
    The custom attribute's values.

  - `customAttributes.attribValues.value` (string, required)
    A string that indicates the value.

  - `suggestionResolutionCode` (any)
    Resolution applied when a suggestion is closed. Applies only to article suggestions.

## Request examples:

  - `All writable attributes` (unknown)
    Create an article with every writable request field populated. `content` embeds a
pre-uploaded inline image by its `fileUploadId`; `attachments` adds a separately
pre-uploaded file by its own `fileUploadId`.
`label` and `isMajorUpdate` are not accepted on create.

## Response 201:

  - `201` (unknown)
    Created

## Response 201 headers:

  - `location` (string)
    Self link of the created article
    Example: /knowledge/contentmgr/v4/articles/DEV-5401

  - `ETag` (string)
    UTC ISO-8601 timestamp identifying the resource version for use with the `If-Match` header on subsequent updates.
    Example: 2026-04-15T09:00:00.000Z

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 406:

  - `406` (unknown)
    Not acceptable

## Response 406 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 409:

  - `409` (unknown)
    Conflict

## Response 409 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 429:

  - `429` (unknown)
    Too Many Request

## Response 429 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 500:

  - `500` (unknown)
    Internal server error

## Response 500 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 400 examples:

  - `Required Attribute missing` (unknown)
    Required query parameter is missing

  - `Unallowed attribute value` (unknown)
    One of the attribute has value which is not allowed

## Response 401 examples:

  - `Invalid Authorization` (unknown)
    Invalid or expired Authorization. Generate new Authorization header and try again.

## Response 403 examples:

  - `Required Scope Missing` (unknown)
    User doesn't have required scope to call this API. Refer API description to know which scope needs to be assigned to user.

## Response 406 examples:

  - `Not Acceptable` (unknown)

## Response 409 examples:

  - `duplicate name` (unknown)
    The name is already used by a sibling of the same language under the same parent.

## Response 429 examples:

  - `Too Many Request` (unknown)
    Too many requests. Try again at a later time.

## Response 500 examples:

  - `Internal Server Error` (unknown)

