All Products
Search
Document Center

Platform For AI:ListCodeSources

Last Updated:Oct 17, 2025

Queries a list of code source configurations with support for paging, sorting, and filtering.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

GET /api/v1/codesources HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

DisplayName

string

No

The display name of the code source configuration. Fuzzy match is supported.

MyDataSource

PageNumber

integer

No

The page number. The value starts from 1. The default value is 1.

1

PageSize

integer

No

The number of entries to return on each page. The default value is 20.

10

SortBy

string

No

The field to use for sorting. Valid values:

  • GmtModifyTime: The time when the code source was last modified.

  • DisplayName: The display name.

  • CodeSourceId: The code source ID.

  • GmtCreateTime (default): The time when the code source was created.

GmtModifyTime

Order

string

No

The sort order. Valid values:

  • ASC (default): Ascending order.

  • DESC: Descending order.

desc

WorkspaceId

string

No

The workspace ID. For more information, see ListWorkspaces.

1234

Response elements

Element

Type

Description

Example

object

The response object.

CodeSources

array

A list of code source configurations.

CodeSourceItem

The details of a code source configuration.

TotalCount

integer

The total number of code source configurations that meet the filter conditions.

2

RequestId

string

The request ID.

5A14FA81-DD4E-******-6343FE44B941

Examples

Success response

JSON format

{
  "CodeSources": [
    {
      "CodeSourceId": "code-202**********",
      "DisplayName": "MyCodeSourceName1",
      "Description": "code source of dlc examples",
      "CodeRepo": "https://code.aliyun.com/****",
      "CodeBranch": "master",
      "CodeCommit": "44da10**********",
      "CodeRepoUserName": "user",
      "CodeRepoAccessToken": "",
      "Accessibility": "PUBLIC",
      "UserId": "1157290171663117",
      "WorkspaceId": "1234",
      "GmtCreateTime": "2021-01-18T12:52:15Z",
      "GmtModifyTime": "2021-01-18T12:52:15Z",
      "MountPath": "/root/code/"
    }
  ],
  "TotalCount": 2,
  "RequestId": "5A14FA81-DD4E-******-6343FE44B941"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.