All Products
Search
Document Center

DataWorks:ListFiles

Last Updated:Oct 27, 2026

Queries a list of files.

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 path of the folder where the file resides.

Business_process/my_first_business_process/MaxCompute/ods_layer

ProjectId

integer

No

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the workspace ID.

You must specify either this parameter or the ProjectIdentifier parameter to determine the DataWorks workspace for the API operation.

10000

Keyword

string

No

The keyword in the file name. Fuzzy match is supported. You can enter a keyword to query all files whose names contain the keyword.

ods

ProjectIdentifier

string

No

The name of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the workspace name.

You must specify either this parameter or the ProjectId parameter to determine the DataWorks workspace for the API operation.

dw_project

PageNumber

integer

No

The number of the page to return.

1

PageSize

integer

No

The number of entries to return on each page. Default value: 10. Maximum value: 100.

10

UseType

string

No

The functional module to which the file belongs. Valid values:

  • NORMAL: Data Studio.

  • MANUAL: Manual task.

  • MANUAL_BIZ: Manual business flow.

  • SKIP: Dry-run scheduling in Data Studio.

  • ADHOCQUERY: Ad hoc query.

  • COMPONENT: Component management.

NORMAL

FileTypes

string

No

The file type. The code varies by file type. For more information, see DataWorks node types. Specifies the code type of the file to query.

10,23

Owner

string

No

The owner of the file.

3726346****

NodeId

integer

No

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

123541234

NeedContent

boolean

No

Specifies whether the query result includes the file content. For files with a large amount of content, network transmission latency may be high.

false

NeedAbsoluteFolderPath

boolean

No

Specifies whether the query result includes the path of the folder where the file is located.

false

ExactFileName

string

No

The file name for exact match. The file name in the query result must be an exact match with the value of this parameter.

ods_create.sql

FileIdIn

string

No

The list of file IDs. The file IDs in the query result must be a subset of the IDs in this list. You can specify up to 50 file IDs at a time.

78237,816123

LastEditUser

string

No

The Alibaba Cloud user ID of the user who last edited the file.

38748246285727

Response elements

Element

Type

Description

Example

object

The response.

HttpStatusCode

integer

The HTTP status code.

200

ErrorMessage

string

The error message.

The connection does not exist.

RequestId

string

The request ID. You can use the ID to troubleshoot errors.

0000-ABCD-****

ErrorCode

string

The error code.

Invalid.Tenant.ConnectionNotExists

Success

boolean

Indicates whether the call was successful. Valid values:

  • true: The call was successful.

  • false: The call failed.

true

Data

object

The list of files that meet the specified conditions.

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 that meet the specified conditions.

13

Files

array<object>

The file details.

object

The file information.

CommitStatus

integer

The current commit status of the file. Valid values: 0 (the latest code is not committed) and 1 (the latest code is committed).

1

AutoParsing

boolean

Indicates whether the automatic parsing feature is enabled for the file. Valid values:

  • true: The file automatically parses code.

  • false: The file does not automatically parse code.

This parameter corresponds to the Code Parsing setting that takes effect when you set Schedule Dependencies to Same Cycle under Schedule Settings for a Data Studio task in the DataWorks console.

true

Owner

string

The Alibaba Cloud user ID of the file owner.

3872572****

CreateTime

integer

The time when the file was created. The value is a UNIX timestamp in milliseconds.

1593950832000

FileType

integer

The file type. Different file types correspond to different code types. For more information, see DataWorks node types.

10

CurrentVersion

integer

The latest committed version number of the file.

2

BizId

integer

[Deprecated] The ID of the business flow to which the file belongs. Use the BusinessId field instead.

300000

LastEditUser

string

The Alibaba Cloud user ID of the user who last edited the file.

38748246285727

FileName

string

The name of the file.

ods_user_info_d

ConnectionName

string

The name of the data source used when the task corresponding to the file is run.

odps_source

UseType

string

The functional module to which the file belongs. Valid values:

  • NORMAL: Data Studio.

  • MANUAL: Manual task.

  • MANUAL_BIZ: Manual business flow.

  • SKIP: Dry-run scheduling in Data Studio.

  • ADHOCQUERY: Ad hoc query.

  • COMPONENT: Component management.

NORMAL

FileFolderId

string

The ID of the folder where the file is located.

2735c2****

FileId

integer

The ID of the file.

10000001

ParentId

integer

The ID of the composite node file to which the current file belongs. This field is returned only if the current file is an internal file of a composite node file.

-1

CreateUser

string

The Alibaba Cloud user ID of the user who created the file.

382762****

IsMaxCompute

boolean

Indicates whether the resource file needs to be uploaded to MaxCompute. This field is returned only if the current file is a MaxCompute resource file.

This field is valid only when the file is a MaxCompute resource file.

false

BusinessId

integer

The ID of the business flow to which the file belongs.

300000

FileDescription

string

The description of the file.

my test datastudio file

LastEditTime

integer

The time when the file was last edited. The value is a UNIX timestamp in milliseconds.

1593950832000

Content

string

[Deprecated] The content of the file. You can call the GetFile operation to query the file content.

SHOW TABLES;

NodeId

integer

The ID of the scheduled task generated in the scheduling system after the file is committed.

300001

AbsoluteFolderPath

string

The path of the folder where the file is located.

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.