Skip to main content
POST
/
api
/
adm
/
import
/
file
Upload Import File
curl --request POST \
  --url https://localhost:44371/api/adm/import/file \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'ContentType=<string>' \
  --form 'ContentDisposition=<string>' \
  --form 'Headers=<unknown>' \
  --form Length=123 \
  --form 'Name=<string>' \
  --form 'FileName=<string>'
{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Description

Uploads a CSV file for batch import processing. The file is validated for format compliance and then queued for asynchronous processing by background workers. Processing status can be monitored via the GetImportEntries endpoint.

Input

  • Query Parameters: model (ImportBatchSaveFileCommandRequest) — Request parameters including:
    • batchId (guid, required) — Unique identifier for the import batch.
    • importType (string, optional) — Type of import (e.g., Transactions, Users).
  • Form Data: file (IFormFile, required) — CSV file containing data to import (multipart/form-data upload).

Output

Returns a BaseCommandResponse indicating whether the file was accepted for processing.

Example Request

POST /api/admin/importBatches/file?batchId=9ef15c43-a955-6f4h-c7g3-1h6d4f0e3g9c
Content-Type: multipart/form-data
Authorization: Bearer {token}

[CSV file content in multipart body]

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Errors

  • 400 Bad Request — Invalid file format (not valid CSV or missing required columns) or file exceeds maximum size.
  • 404 Not Found — No import batch exists with the specified ID.

Notes

  • Processing is asynchronous; poll batch status via GetImportEntries for completion.
  • CSV must include header row with required column names.
  • Maximum file size typically 50MB; larger files should be split.
  • Failed rows do not roll back successful rows.
  • Download result file after completion to review success/failure details.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Query Parameters

BatchId
string<guid>

Identifier of the import batch whose file is being saved. Maps to the batch record created when the upload was initiated and enables deduplicating subsequent uploads for the same batch.

CompanyId
string<guid>

Identifier of the company storing the file. Ensures the uploaded file is applied to the correct tenant workspace and enforces per-company retention policies.

CompanyProjectId
string<guid>

Identifier of the project associated with the stored file. Allows multiple projects within the same company to stage separate batches without collisions.

Type
enum<string>

Type of import batch whose file is being saved. Determines downstream parsing rules; for example, ImportType.Transactions expects transaction CSV columns whereas ImportType.PaymentsInfo expects tokenized payment records.

Available options:
Transactions,
PaymentsInfo,
TransferTransactions,
TransferPaymentsInfo

Body

multipart/form-data
ContentType
string | null
ContentDisposition
string | null
Headers
any[] | null
Length
integer<int64>
Name
string | null
FileName
string | null

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null