Get Current Import Operations

It requires the run-import permission.

URLRequires AuthHTTP Method

/api/v1/getCurrentImportOperation

yes

GET

Headers

ArgumentExampleRequiredDescription

X-User-Id

myuser-name

Required

The authenticated user ID.

X-Auth-Token

myauth-token

Required

Auth token.

Example Call

curl -L -X GET 'http://localhost:3000/api/v1/getCurrentImportOperation' \
-H 'X-User-Id: d26x6zSkaPSe5gCyy' \
-H 'X-Auth-Token: Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'

Example Result

Success

{
    "success": true,
    "operation": {
        "_id": "7PbvsnKJD9ZAqw38C",
        "type": "Pending Avatars",
        "importerKey": "pending-avatars",
        "ts": 1635337234169,
        "status": "importer_done",
        "valid": true,
        "user": "d26x6zSkaPSe5gCyy",
        "_updatedAt": "2021-10-27T12:20:34.184Z"
    }
}

Error

Any of the following errors can occur on the endpoint.

  • Authorization: Requires an authentication token for the request to be made.

  • No Permission: This occurs when the authenticated user doesn't have the run-import permission.

{
    "success": false,
    "error": "unauthorized"
}

Change Log

VersionDescription

3.0.0

Added

Last updated

Rocket.Chat versions receive support for six months after release.