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

> Lists data sources in the specified dataset. When using this endpoint: - Make sure the specified dataset belongs to the same project as your API key. - To check the datasets you have access to in the project, call [GET /v2/team/datasets](/api-reference/v2/list-datasets).

# List data sources

**Example request:**

<CodeGroup>
  ```curl cURL theme={null}
  curl --request GET \
    --url https://ai.data.cloud/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://ai.data.cloud/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>

**Example response:**

```json 200 theme={null}
{
  "code": 0,
  "data": {
    "total_items": 1,
    "page_size": 10,
    "page_number": 1,
    "records": [
      {
        "code": 0,
        "data": {
          "id": "ds-cm7aedl58000501fc52hjj5c3",
          "name": "ds1.xlsx",
          "type": "FILE",
          "status": "synched",
          "size": 14435,
          "dataset_id": "dset-cm7ae4d77028n01l1cnapd5si"
        }
      }
    ]
  }
}
```


## OpenAPI

````yaml get /v2/team/datasets/{id}/datasources
openapi: 3.0.1
info:
  title: Team Open API Snake
  description: ''
  version: 1.0.0
servers:
  - url: https://ai.data.cloud/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: >-
        Lists data sources in the specified dataset. When using this endpoint:

        - Make sure the specified dataset belongs to the same project as your
        API key.

        - To check the datasets you have access to in the project, call [GET
        /v2/team/datasets](/api-reference/v2/list-datasets).
      parameters:
        - name: id
          in: path
          description: >
            The ID of the dataset of which the data sources you want to list.


            To check the datasets you have access to, call [GET
            /v2/team/datasets](/api-reference/v2/list-datasets).
          required: true
          schema:
            type: string
        - name: page_number
          in: query
          description: >-
            The page number to start listing. If not specified, the default
            value `1` will be used.
          required: false
          example: 0
          schema:
            type: integer
        - name: page_size
          in: query
          description: >-
            The number of items on a single page. If not specified, the default
            value `10` will be used.
          required: false
          example: 0
          schema:
            type: integer
        - name: status
          in: query
          description: >-
            The status of data sources to list. Possible values are:

            - `invalid`: Awaiting processing.

            - `synching`: Currently processing.

            - `synched`: Successfully synchronized.

            If not specified, data sources in any status will be returned.

            Multiple statuses can be specified in a comma-separated list, and
            data sources matching any will be displayed.
          required: false
          example: ''
          schema:
            type: string
            enum:
              - synching
              - invalid
              - synched
        - name: user_id
          in: query
          description: >-
            Your user ID, which uniquely identifies you within your team. To
            obtain your ID:


            - If you're the team admin, refer to [Check user
            information](/enterprise/users#check-user-information).

            - If you're a system or virtual user, ask your team admin to check
            your user ID by referring to [Check user
            information](/enterprise/users#check-user-information).
          required: true
          schema:
            type: string
        - name: x-pd-external-trace-id
          in: header
          description: >-
            The trace ID you set in your system to trace this request. It can be
            up to 128 characters in length. If the request fails, you can
            provide it to the Powerdrill team to help with troubleshooting.
          required: false
          example: ''
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: >-
                      Status code. **0** indicates that the operation is
                      successful. Otherwise, the operation fails. For error
                      troubleshooting, refer to [Error
                      Codes](/api-reference/error-codes).
                  data:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        description: >-
                          The total number of data sources returned in the
                          response.
                      page_size:
                        type: integer
                        description: >-
                          The number of items that are returned in a single
                          page.
                      page_number:
                        type: integer
                        description: The page number of the current page.
                      records:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: >-
                                The data source ID, which uniquely identifies
                                the data source.
                            dataset_id:
                              type: string
                              description: >-
                                The ID of the dataset that hosts the data
                                source.
                            name:
                              type: string
                              description: The data source name.
                            type:
                              type: string
                              description: >-
                                The type of the data source, which is fixed to
                                **FILE**.
                              enum:
                                - FILE
                            status:
                              type: string
                              description: >-
                                The processing status of the data source.
                                Possible values are:

                                - `invalid`: Awaiting processing.

                                - `synching`: Currently processing.

                                - `synched`: Successfully synchronized.
                              enum:
                                - synching
                                - synched
                                - invalid
                            size:
                              type: number
                              description: >-
                                The size of the data source, expressed in bytes.
                                The value is in the `bigint` type. It can be
                                null.
                          description: Information about each data source.
                          required:
                            - id
                            - dataset_id
                            - name
                            - type
                            - status
                        description: A list of data sources returned on a page.
                    required:
                      - total_items
                      - page_size
                      - page_number
                      - records
                    description: A paginated list of data sources.
                required:
                  - data
                  - code
              example:
                code: 0
                data:
                  records:
                    - id: ds-cm8iikpzv000b01fcq6ozrjtd
                      name: olist_sellers_dataset.csv
                      type: FILE
                      status: synched
                      size: 174703
                      dataset_id: dset-cm8iikpc7018f01l1b796jkgu
                  total_items: 1
                  page_size: 10
                  page_number: 1
          headers:
            x-pd-trace-id:
              example: ''
              required: true
              description: >-
                The trace ID returned by Powerdrill. If a failure occurs, you
                can provide it to the Powerdrill team to assist with
                troubleshooting.
              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

````