All Products
Search
Document Center

DataWorks:ListFiles

Last Updated:Aug 28, 2026

Queries files in a DataWorks workspace, with optional filters for file type, owner, keyword, and more.

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

dataworks:*

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

FileFolderPath

string

No

The folder path of the files.

Business_process/my_first_business_process/MaxCompute/ods_layer

ProjectId

integer

No

The DataWorks workspace ID. You can obtain this from the Workspace Management page in the DataWorks console.

You must set either ProjectId or ProjectIdentifier to specify the workspace.

10000

Keyword

string

No

The keyword for fuzzy matching file names. Files whose names contain this keyword are returned.

ods

ProjectIdentifier

string

No

The DataWorks workspace name. You can obtain this from the Workspace Management page in the DataWorks console.

You must set either ProjectId or ProjectIdentifier to specify the workspace.

dw_project

PageNumber

integer

No

The page number.

1

PageSize

integer

No

The number of entries per page. Default value: 10. Maximum value: 100.

10

UseType

string

No

The module to which the files belong. Valid values:

  • NORMAL: The files are used for DataStudio.

  • MANUAL: The files are used for manually triggered nodes.

  • MANUAL_BIZ: The files are used for manually triggered workflows.

  • SKIP: The files are used for dry-run nodes in DataStudio.

  • ADHOCQUERY: The files are used for ad hoc queries.

  • COMPONENT: The files are used for snippets.

NORMAL

FileTypes

string

No

The types of the code in the files.

Valid values: 6 (Shell), 10 (ODPS SQL), 11 (ODPS MR), 23 (Data Integration), 24 (ODPS Script), 97 (PAI), 98 (node group), 99 (zero load), 221 (PyODPS 2), 225 (ODPS Spark), 227 (EMR Hive), 228 (EMR Spark), 229 (EMR Spark SQL), 230 (EMR MR), 239 (OSS object inspection), 257 (EMR Shell), 258 (EMR Spark Shell), 259 (EMR Presto), 260 (EMR Impala), 900 (real-time synchronization), 1002 (PAI inner node), 1089 (cross-tenant collaboration), 1091 (Hologres development), 1093 (Hologres SQL), 1100 (assignment), 1106 (for-each), and 1221 (PyODPS 3).

10,23

Owner

string

No

The owner of the files.

3726346****

NodeId

integer

No

The scheduled node ID. You can call the ListNodes operation to obtain the node ID.

123541234

NeedContent

boolean

No

Specifies whether to include file content in the response. Enabling this for large files may increase latency.

false

NeedAbsoluteFolderPath

boolean

No

Specifies whether to include the absolute folder path of each file in the response.

false

ExactFileName

string

No

The exact file name to match. Only files with this exact name are returned.

ods_create.sql

FileIdIn

string

No

A comma-separated list of file IDs to filter by. Maximum: 50 IDs per request.

78237,816123

LastEditUser

string

No

The ID of the Alibaba Cloud account that is used to last modify the file.

38748246285727

Response elements

Element

Type

Description

Example

object

The returned data.

HttpStatusCode

integer

The HTTP status code returned.

200

ErrorMessage

string

The error message returned.

The connection does not exist.

RequestId

string

The request ID for troubleshooting.

0000-ABCD-EFG

ErrorCode

string

The error code returned.

Invalid.Tenant.ConnectionNotExists

Success

boolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

Data

object

The files returned.

PageNumber

integer

The page number of the returned page.

1

PageSize

integer

The number of entries returned per page.

10

TotalCount

integer

The total number of entries returned.

13

Files

array<object>

The details of the files.

object

The information about the file.

CommitStatus

integer

Indicates whether the latest code is committed. Valid values: 0 (not committed) and 1 (committed).

1

AutoParsing

boolean

Indicates whether automatic parsing is enabled for the file.

  • true: Automatic parsing is enabled.

  • false: Automatic parsing is disabled.

Corresponds to the Analyze Code setting in the Dependencies section of the Properties panel in the DataWorks console.

true

Owner

string

The Alibaba Cloud account ID of the file owner.

3872572****

CreateTime

integer

The file creation time, in UNIX timestamp format (milliseconds).

1593950832000

FileType

integer

The type of the code in the file. Valid values: 6 (Shell), 10 (ODPS SQL), 11 (ODPS MR), 23 (Data Integration), 24 (ODPS Script), 99 (zero load), 221 (PyODPS 2), 225 (ODPS Spark), 227 (EMR Hive), 228 (EMR Spark), 229 (EMR Spark SQL), 230 (EMR MR), 239 (OSS object inspection), 257 (EMR Shell), 258 (EMR Spark Shell), 259 (EMR Presto), 260 (EMR Impala), 900 (real-time synchronization), 1089 (cross-tenant collaboration), 1091 (Hologres development), 1093 (Hologres SQL), 1100 (assignment), and 1221 (PyODPS 3).

10

CurrentVersion

integer

The latest version number of the file.

2

BizId

integer

The ID of the workflow to which the file belongs. This parameter is deprecated and replaced by the BusinessId parameter.

300000

LastEditUser

string

The ID of the Alibaba Cloud account that is used to last modify the file.

38748246285727

FileName

string

The name of the file.

ods_user_info_d

ConnectionName

string

The compute engine instance used to run the corresponding node.

odps_first

UseType

string

The module to which the file belongs. Valid values:

  • NORMAL: The file is used for DataStudio.

  • MANUAL: The file is used for a manually triggered node.

  • MANUAL_BIZ: The file is used for a manually triggered workflow.

  • SKIP: The files is used for a dry-run node in DataStudio.

  • ADHOCQUERY: The file is used for an ad hoc query.

  • COMPONENT: The file is used for a snippet.

NORMAL

FileFolderId

string

The ID of the folder to which the file belongs.

2735c2****

FileId

integer

The ID of the file.

10000001

ParentId

integer

The ID of the parent node group file. Returned only for inner files of a node group.

-1

CreateUser

string

The ID of the Alibaba Cloud account that is used to create the file.

382762****

IsMaxCompute

boolean

Indicates whether the file needs to be uploaded to MaxCompute. Returned only for MaxCompute resource files.

false

BusinessId

integer

The ID of the workflow to which the file belongs.

300000

FileDescription

string

The description of the file.

my test datastudio file

LastEditTime

integer

The last modification time, in UNIX timestamp format (milliseconds).

1593950832000

Content

string

Deprecated. Use the GetFile operation instead.

SHOW TABLES;

NodeId

integer

The auto-triggered node ID generated in the scheduling system after the file is committed.

300001

AbsoluteFolderPath

string

The path of the folder to which the file belongs.

Business_process/my_first_business_process/MaxCompute/ods_layer

Examples

Success response

JSON format

{
  "HttpStatusCode": 200,
  "ErrorMessage": "The connection does not exist.",
  "RequestId": "0000-ABCD-****",
  "ErrorCode": "Invalid.Tenant.ConnectionNotExists",
  "Success": true,
  "Data": {
    "PageNumber": 1,
    "PageSize": 10,
    "TotalCount": 13,
    "Files": [
      {
        "CommitStatus": 1,
        "AutoParsing": true,
        "Owner": "3872572****",
        "CreateTime": 1593950832000,
        "FileType": 10,
        "CurrentVersion": 2,
        "BizId": 300000,
        "LastEditUser": "38748246285727",
        "FileName": "ods_user_info_d",
        "ConnectionName": "odps_source",
        "UseType": "NORMAL",
        "FileFolderId": "2735c2****",
        "FileId": 10000001,
        "ParentId": -1,
        "CreateUser": "382762****",
        "IsMaxCompute": false,
        "BusinessId": 300000,
        "FileDescription": "my test datastudio file",
        "LastEditTime": 1593950832000,
        "Content": "SHOW TABLES;",
        "NodeId": 300001,
        "AbsoluteFolderPath": "Business_process/my_first_business_process/MaxCompute/ods_layer"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

500 InternalError.System An internal system error occurred. Try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later.
403 Forbidden.Access Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. No permission, please authorize
429 Throttling.Api The request for this resource has exceeded your available limit.
429 Throttling.System The DataWorks system is busy. Try again later.
429 Throttling.User Your request is too frequent. Try again later.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.