> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Import File

> This endpoint takes in the binary content of the imported file, along with additional information about its content, and stores it in a buffer. Permission required: `run-import`.

### Changelog
| Version      | Description |
| ---------------- | ------------|
|3.0.0            | Added       |

## OpenAPI

````json POST /api/v1/uploadImportFile
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Settings"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "paths": {
    "/api/v1/uploadImportFile": {
      "parameters": [],
      "post": {
        "summary": "Upload Import File",
        "operationId": "post-api-v1-uploadImportFile",
        "responses": {
          "200": {
            "$ref": "#/components/responses/trueSuccess"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "errorType": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "Importer not Defined": {
                    "value": {
                      "success": "false",
                      "error": "The importer (png) has no import class defined. [error-importer-not-defined]",
                      "errorType": "error-importer-not-defined",
                      "details": "uploadImportFile"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/authorizationError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/X-User-Id"
          },
          {
            "$ref": "#/components/parameters/X-Auth-Token"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "binaryContent": {
                    "type": "string",
                    "description": "The uploaded file."
                  },
                  "importerKey": {
                    "type": "string",
                    "description": "It indicates how Rocket.Chat should handle the uploaded file. The accepted importer keys are:\n  * `csv`\n  * `hipchatenterprise`\n  * `pending-avatars`\n  * `pending-files`\n  * `slack`\n  * `slack-users`"
                  },
                  "fileName": {
                    "type": "string",
                    "description": "The name of the file to be imported."
                  },
                  "contentType": {
                    "type": "string",
                    "description": "The imported file [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types)."
                  }
                },
                "required": [
                  "binaryContent",
                  "importerKey",
                  "fileName",
                  "contentType"
                ]
              },
              "examples": {
                "Example": {
                  "value": {
                    "binaryContent": "/testfile.csv",
                    "importerKey": "csv",
                    "fileName": "Testfile",
                    "contentType": "text/csv"
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Import"
        ],
        "description": "This endpoint takes in the binary content of the imported file, along with additional information about its content, and stores it in a buffer. Permission required: `run-import`.\n\n### Changelog\n| Version      | Description |\n| ---------------- | ------------|\n|3.0.0            | Added       |"
      }
    }
  },
  "components": {
    "responses": {
      "trueSuccess": {
        "description": "OK",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                }
              }
            },
            "examples": {
              "Success": {
                "value": {
                  "success": "true"
                }
              }
            }
          }
        }
      },
      "authorizationError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Authorization Error": {
                "value": {
                  "status": "error",
                  "message": "You must be logged in to do this."
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "X-User-Id": {
        "name": "X-User-Id",
        "in": "header",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "CkCPNctrgCDfmWLqC",
        "description": "The user ID."
      },
      "X-Auth-Token": {
        "name": "X-Auth-Token",
        "in": "header",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "1Dd4iN_ClKn5jl-xPC36snQ4s9Zd5GZnXCQuCNSKcVE",
        "description": "The authentication token."
      }
    }
  }
}
````

