Skip to content

Export

Content Export APIs

Export Knowledge

Request

Overview

The Content Export API initiates a bulk export of the Knowledge Hub to a client-provided Amazon S3 bucket or SFTP server path. It returns a URL with a Job ID to enable tracking the status of this asynchronous operation.
Each export job can send multiple JSON files, depending on the total number of items to process. More than one bulk export can take place, as needed, one per portal.

Permission

  • Only a client application can invoke this API.

License

  • This API requires a site license (SKU: EG-CL-RTKA-PT).
Security
oAuthClient(Required scopes:
https://api.egain.cloud/auth/.de...
)
Headers
Accept-Languagestringrequired

The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).

Enum:"en-US""es-ES""fr-FR""it-IT""de-DE""nl-NL""pt-BR""pt-PT""da-DK""ru-RU"
Example:en-US
Bodyapplication/jsonrequired
articleCategoriesstring

Category of articles to return. If all is selected, it includes both browsable and searchable articles.

Default:"searchable"
Enum:"searchable""all"
portalIDstring, [ 7 .. 20 ] characters^[a-zA-Z0-9]{2,4}-\d{4,15}$required

The ID of the portal being accessed.

A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.

Example:"PROD-1000"
languageobject(language)required

The Knowledge Base language in which the content is created.

exportUnpublishedOnlyboolean

Determines which article version to export. If true, the latest unpublished version will be exported for each article where available, and articles that do not have an unpublished version will be omitted from the export. If this property is false or omitted, the latest published version will be exported for each article where available. Each request exports either all published or all unpublished article versions in a portal; never both.

Default:false
resourceTypesArray of stringsrequired

Types of Knowledge Hub resources to export. Use 'all' to specify all resource types at once.

Below are the attributes that are returned for each resource type specified.

Portal Resource Type Attributes
Portal Attribute NameDescription
idThe ID of the Portal in Readable format.
alternateIdThe system-generated ID of the Portal in long format.
nameThe name of the Portal.
descriptionThe Portal's description.
departmentIdID of the department this Portal belongs to.
defaultContentLanguageIdThe default ID of the language for the portal content.
Topic Resource Type Attributes
Topic Attribute NameDescription
idThe ID of the Topic in Readable form.
alternateIdThe system-generated ID of the Topic in long form.
nameThe name of the Topic.
departmentIdID of the department this Topic belongs to.
modifiedDateThe date when the Topic was last modified on.
topicHomeArticleIdThe ID of the Article used as the home page of this Topic.
childCountTotal number of children sub-topis below the current Topic.
subTopicIdsArray with the list of sub-topics (all levels of the topic hierarchy).
parentTopicIdID of the parent Topic. -1 if it is the root Topic.
imageURLURL of the inline Topic image.
customAttributesOne or more comma-separated names for Topic custom attributes defined by the user to be returned.
Article Resource Type Attributes

Export article's attributes returned are aligned with the response of the Get Article By ID with Editions API.

Items Enum:"articles""topics""portals""all"
Example:
[ "articles" ]
dataDestinationobjectrequired
POST
/content/export
curl -i -X POST \
  https://api.egain.cloud/knowledge/portalmgr/v4/content/export \
  -H 'Accept-Language: en-US' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "articleCategories": "searchable",
    "portalID": "PROD-1000",
    "language": {
      "code": "en-US"
    },
    "resourceTypes": [
      "articles"
    ],
    "dataDestination": {
      "destinationType": "SFTP server",
      "path": "exports/mydeptfolder",
      "sftpDetails": {
        "username": "rtka-user",
        "password": "xyz1234",
        "host": "sftp.yourcompany.com",
        "port": 22
      }
    }
  }'

Responses

A request was accepted and is being processed.

Expected Processing Time:

  • Small jobs (< 1,000 items): 5-15 minutes
  • Medium jobs (1,000-10,000 items): 15-60 minutes
  • Large jobs (> 10,000 items): 1-4 hours (depending on content complexity)
Headers
locationstring

Location Header
This header contains the URL to check the status of your validation job. The jobID (as in this example) is the unique identifier for tracking this operation. ```

Example:"/knowledge/portalmgr/v4/content/export/7A84B875-6F75-4C7B-B137-0632B62DB0BD"
Response
No content