Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 2.18 KB

File metadata and controls

66 lines (48 loc) · 2.18 KB

Run

Process the data from the current import operation, creating the users on Rocket.Chat. It requires the current import operation state to be ready and it changes the operation state to importing.

{% hint style="success" %} It will return success if the conditions to start the process are met, without waiting for the import to finish. {% endhint %}

{% hint style="info" %} It requires the run-import permission. {% endhint %}

URL Requires Auth HTTP Method
/api/v1/import.run yes POST

{% hint style="warning" %}

  • If a user can not be imported successfully it'll be flagged but the operation will not stop.
  • If a user's email or username is already in use, it'll not be created.
  • Only the users that were imported successfully will be removed from the staging area. {% endhint %}

Headers

ArgumentExampleRequiredDescription
X-User-Idmyuser-nameRequiredThe authenticated user ID.
X-Auth-Tokenmyauth-tokenRequiredAuth token.

Example Call

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

Example Result

Success

{
  "success": true
}

Error

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

{% tabs %} {% tab title="No Permission" %}

{
    "success": false,
    "error": "User does not have the permissions required for this action [error-unauthorized]"
}

{% endtab %} {% endtabs %}

Change Log

Version Description
6.3.0 Added