All Products
Search
Document Center

Data Management:CreateDataImportOrder

Last Updated:Oct 19, 2026

Creates a data import ticket.

Operation description

Only database instances whose control mode is set to Security Collaboration can call this API operation.

For more information about this feature, see Data import.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dms:CreateDataImportOrder

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Comment

string

Yes

The business background of the data import, which helps reduce communication costs.

test

RelatedUserList

array

No

The list of relevant users.

integer

No

The user ID of a relevant user. The specified relevant users can view the ticket and collaborate on it. Users who are not specified cannot view the ticket, except for administrators and DBAs.

51****

Param

object

Yes

The ticket parameters.

Classify

string

No

The reason for the data import.

test

AttachmentName

string

Yes

The attachment key of the imported data. You can call the GetUserUploadFileJob operation to obtain the value of this parameter.

upload_big_file_test_orders

DbItemList

array<object>

Yes

The list of databases to which data is to be imported. Currently, you can import data to only one database at a time.

object

No

The database information.

DbId

integer

Yes

The ID of the database. Databases are classified into physical databases and logical databases:

1860****

Logic

boolean

Yes

Specifies whether the database is a logical database. Valid values:

  • true: The database is a logical database.

  • false: The database is a physical database.

Note

If you set this parameter to true, the destination database must be a logical database.

false

FileType

string

Yes

The type of the file. Valid values:

  • SQL: SQL file.

  • CSV: CSV file.

  • EXCEL: Excel file.

  • JSON: JSON file. Only specific databases, such as MongoDB, support JSON files.

Valid values:

  • EXCEL :

    EXCEL

  • CSV :

    CSV

  • JSON :

    JSON

  • SQL :

    SQL

CSV

FileEncoding

string

No

The encoding format of the file. Valid values:

  • AUTO: Automatic recognition.

  • UTF-8: UTF-8 encoding.

  • GBK: GBK encoding.

  • ISO-8859-1: ISO-8859-1 encoding.

AUTO

TableName

string

No

The name of the destination table to which data in the CSV file is imported.

Note

If FileType is set to CSV, this parameter is required.

Table_text

InsertType

string

No

The insert type. Valid values:

  • INSERT: The database checks the primary key when data is inserted. If a duplicate primary key exists, an error is reported.

  • INSERT_IGNORE: If an identical record already exists in the table, the new data is ignored.

  • REPLACE_INTO: If a row of data already exists in the table based on the primary key or unique index, the existing row is deleted before the new data is inserted.

Note

If FileType is set to CSV, this parameter is required.

INSERT

CsvFirstRowIsColumnDef

boolean

No

Specifies whether the first row of the CSV file contains column names. Valid values:

  • true: The first row of the CSV file contains column names.

  • false: The first row of the CSV file contains data.

Note

If FileType is set to CSV, this parameter is required.

true

IgnoreError

boolean

No

Specifies whether to ignore errors. Valid values:

  • true: Ignores errors. If an error occurs, the failed SQL script is skipped and the execution continues.

  • false: Does not ignore errors. If an error occurs, the subsequent SQL scripts are interrupted and no longer executed.

false

ImportMode

string

No

The import mode. Valid values:

  • FAST_MODE: Fast mode. The file is read during the execution phase, and the SQL statements are directly executed in the specified destination database. This mode has lower security than the safe mode but higher execution efficiency.

  • SAFE_MODE: Safe mode. The file is parsed during the precheck phase, and the SQL or CSV data is cached in the database. During the execution phase, the data is read from the cache and executed in the specified destination database. This mode has higher security but lower execution efficiency than the fast mode.

FAST_MODE

RollbackSQL

string

No

The rollback SQL statement.

Note

If RollbackSqlType is set to TEXT, this parameter is required.

empty

RollbackAttachmentName

string

No

The attachment key of the rollback SQL statement. You can call the GetUserUploadFileJob operation to obtain the value of this parameter.

Note

If RollbackSqlType is set to ATTACHMENT, this parameter is required.

rollback.sql

RollbackSqlType

string

No

The submission method of the rollback SQL statement. Valid values:

  • TEXT: Text.

  • ATTACHMENT: Attachment.

TEXT

ExecMode

string

No

The execution method of the ticket. Valid values:

  • COMMITOR: The submitter executes the ticket after the ticket is approved.

  • AUTO: The ticket is automatically executed after it is approved.

  • LAST_AUDITOR: The last approver executes the ticket after the ticket is approved.

COMMITOR

AttachmentKey

string

No

The attachment key of the ticket, which is used to supplement the ticket information. You can call the GetUserUploadFileJob operation to obtain the value of this parameter.

order_attachment.txt

Tid

integer

No

The tenant ID. You can call the GetUserActiveTenant or ListUserTenants operation to obtain the value of this parameter.

3***

RealLoginUserUid

string

No

The UID of the Alibaba Cloud account that actually calls the API operation.

21400447956867****

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931

Success

boolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

ErrorMessage

string

The error message.

UnknownError

ErrorCode

string

The error code.

UnknownError

CreateOrderResult

array

The ticket creation result.

integer

The ticket ID.

1****

Examples

Success response

JSON format

{
  "RequestId": "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
  "Success": true,
  "ErrorMessage": "UnknownError",
  "ErrorCode": "UnknownError",
  "CreateOrderResult": [
    0
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.