> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ai.relyt.cn/llms.txt
> Use this file to discover all available pages before exploring further.

> 返回指定数据集中的数据源列表。使用此接口时，请注意：
- 确保指定数据集和您的 API Key 归属于同一项目。 - 如需查看您在该项目中有访问权限的数据集，请调用 [GET /v2/team/datasets](/api-reference/list-datasets) 接口。

# List data sources

**请求示例：**

<CodeGroup>
  ```curl cURL theme={null}
  curl --request GET \
    --url https://app.ai.relyt.cn/app/api/v2/team/datasets/{id}/datasources?user_id=tmm-dafasdfasdfasdf \
    --header 'x-pd-api-key: <api-key>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://app.ai.relyt.cn/app/api/v2/team/datasets/{id}/datasources?user_id=tmm-dafasdfasdfasdf"

  headers = {"x-pd-api-key": "<api-key>"}

  response = requests.request("GET", url, headers=headers)

  print(response.text)
  ```
</CodeGroup>

**返回示例：**

```json 200 theme={null}
{
  "code": 0,
  "data": {
    "total_items": 1,
    "page_size": 10,
    "page_number": 1,
    "records": [
      {
        "id": "datasource-cadsgfsdagasgadsg",
        "dataset_id": "dataset-dagasdgasgasg",
        "name": "test.csv",
        "type": "FILE",
        "status": "synching"
      }
    ]
  }
}
```


## OpenAPI

````yaml get /v2/team/datasets/{id}/datasources
openapi: 3.0.1
info:
  title: Team Open API Version 2 中文版本
  description: ''
  version: 1.0.0
servers:
  - url: https://app.ai.relyt.cn/app/api
    description: 体验环境
security:
  - apikey-header-x-pd-api-key: []
tags:
  - name: Session
  - name: Dataset
  - name: Data source
  - name: File
  - name: Job
paths:
  /v2/team/datasets/{id}/datasources:
    get:
      tags:
        - Data source
      summary: List data sources
      description: >-
        返回指定数据集中的数据源列表。使用此接口时，请注意：


        - 确保指定数据集和您的 API Key 归属于同一项目。

        - 如需查看您在该项目中有访问权限的数据集，请调用 [GET
        /v2/team/datasets](/api-reference/list-datasets) 接口。
      parameters:
        - name: id
          in: path
          description: >-
            目标数据集 ID。


            如需查询您有访问权限的数据集列表，请调用 [GET
            /v2/team/datasets](/api-reference/list-datasets) 接口。
          required: true
          schema:
            type: string
        - name: page_number
          in: query
          description: 分页返回的起始页码。如不指定，则使用默认值 `1`。
          required: false
          example: 0
          schema:
            type: integer
        - name: page_size
          in: query
          description: 每页返回的记录数量。如不指定，则使用默认值 `10`。
          required: false
          example: 0
          schema:
            type: integer
        - name: status
          in: query
          description: |-
            数据源状态。指定该参数后，只有处于指定状态的数据源才会被返回。可选值包括：

            - `invalid`：等待处理中。
            - `synching`：正在处理中。
            - `synched`：已成功同步。

            如果未指定，将返回所有数据源。

            可以通过英文逗号分隔的列表指定多个状态，匹配任何状态的数据源将被返回。
          required: false
          example: ''
          schema:
            type: string
            enum:
              - synching
              - invalid
              - synched
        - name: user_id
          in: query
          description: 用户 ID，即您在组织中的唯一身份标识。
          required: true
          schema:
            type: string
        - name: x-pd-external-trace-id
          in: header
          description: >-
            您本地系统中设置的 Trace ID，至多支持 128 个字符。当请求发生错误时，可以将此 ID 提供给 Relyt AI
            团队，协助进行故障排查。
          required: false
          example: ''
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: >-
                      状态码。**0** 表示操作成功。其它值则表示操作失败。如需进行错误排查，请参阅
                      [错误码](/introduction/error-codes)。
                  data:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        description: 返回的数据源总数量。
                      page_size:
                        type: integer
                        description: 每页返回的数据源数量。
                      page_number:
                        type: integer
                        description: 当前页面的页码。
                      records:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: 数据源 ID，即该数据源在数据集中的唯一标识。
                            dataset_id:
                              type: string
                              description: 数据源所在的数据集 ID。
                            name:
                              type: string
                              description: 数据源名称。
                            type:
                              type: string
                              description: 数据源类型，固定为 **FILE**。
                              enum:
                                - FILE
                            status:
                              type: string
                              description: |-
                                数据源的处理状态。可能值为：

                                - `invalid`：等待处理中。
                                - `synching`：正在处理中。
                                - `synched`：已成功同步。
                              enum:
                                - synching
                                - synched
                                - invalid
                          description: 数据源对象。
                          required:
                            - id
                            - dataset_id
                            - name
                            - type
                            - status
                        description: 当前页面返回的数据源列表。
                    required:
                      - total_items
                      - page_size
                      - page_number
                      - records
                    description: 返回的数据源分页列表。
                required:
                  - data
                  - code
              examples:
                '1':
                  summary: 成功示例
                  value:
                    code: 0
                    data:
                      total_items: 1
                      page_size: 10
                      page_number: 1
                      records:
                        - id: datasource-cadsgfsdagasgadsg
                          dataset_id: dataset-dagasdgasgasg
                          name: test.csv
                          type: FILE
                          status: synching
          headers:
            x-pd-trace-id:
              example: ''
              required: true
              description: Relyt AI 返回的 Trace ID。当请求发生错误时，可以将此 ID 提供给 Relyt AI 团队，协助进行故障排查。
              schema:
                type: string
      deprecated: false
      security:
        - apikey-header-x-pd-api-key: []
components:
  securitySchemes:
    apikey-header-x-pd-api-key:
      type: apiKey
      in: header
      name: x-pd-api-key

````