Links

New

Creates a new import operation; If an operation was already running, it will be aborted. Any data from previous imports will be cleared automatically.
It requires the run-import permission.
URL
Requires Auth
HTTP Method
/api/v1/import.new
yes
POST

Headers

Argument
Example
Required
Description
X-User-Id
myuser-name
Required
The authenticated user ID.
X-Auth-Token
myauth-token
Required
Auth token.

Example Call

curl --location --request POST 'http://localhost:3000/api/v1/import.new' \
--header 'x-auth-token: QizJozLOnWMi_2vWaLHhjfd-XYKT6XM40lTZ3zg1UMd' \
--header 'x-user-id: rbAXPnMktTFbNpwtJ' \
--header 'Content-Type: application/json' \
--data ''

Example Result

Success

{
"operation": {
"_id": "64d69545ee8ae821983005f5",
"type": "api",
"importerKey": "api",
"ts": "2023-08-11T20:08:37.655Z",
"status": "importer_new",
"valid": true,
"user": "rbAXPnMktTFbNpwtJ",
"_updatedAt": "2023-08-11T20:08:37.655Z"
},
"success": true
}

Error

  • No Permission: This occurs when the authenticated user doesn't have the run-import permission.
No Permission
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}

Change Log

Version
Description
6.3.0
Added
Last modified 6mo ago
Rocket.Chat versions receive support for six months after release.