> ## 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.

> Counts the data sources for each status in a dataset.

# Get status summary of data sources in dataset

This endpoint returns the count of data sources for each status in the specified dataset. You can use it to verify if all data sources are synchronized and ready for running data analysis jobs.

If both `invalid_count` and `synching_count` in the response are `0`, all data sources in the dataset are accessible to Powerdrill for answering questions. Otherwise, any unsynchronized data sources cannot be accessed.

**Example request:**

<CodeGroup>
  ```curl cURL theme={null}
  curl --request GET \
    --url https://ai.data.cloud/api/v2/team/datasets/{id}/status?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}/status?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": {
    "synched_count": 5,
    "invalid_count": 0,
    "synching_count": 0
  }
}
```


## OpenAPI

````yaml get /v2/team/datasets/{id}/status
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}/status:
    get:
      tags:
        - Dataset
      summary: Get status summary of data sources in dataset
      description: >-
        This endpoint returns the count of data sources for each status in the
        specified dataset. You can use it to verify if all data sources are
        synchronized and ready for running data analysis jobs.


        If both `invalid_count` and `synching_count` in the response are `0`,
        all data sources in the dataset are accessible to Powerdrill for
        answering questions. Otherwise, any unsynchronized data sources cannot
        be accessed.
      parameters:
        - name: id
          in: path
          description: >-
            The ID of the dataset for which you want to check the status of data
            sources.
          required: true
          schema:
            type: string
        - 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:
                      synched_count:
                        type: integer
                        description: The number of synchronized data sources.
                      invalid_count:
                        type: integer
                        description: The number of data sources failed to be synchronized.
                      synching_count:
                        type: integer
                        description: >-
                          The number of data sources waiting to be synchronized
                          or being synchronized.
                    description: >-
                      The number of data sources per state.


                      Note that only when both `invalid_count` and
                      `synching_count` are `0`, all data sources in the dataset
                      can be used by Powerdrill to answer your questions.
                      Otherwise, starting a job immediately cannot fetching data
                      from data sources that are not synchronized.
                    required:
                      - synched_count
                      - invalid_count
                      - synching_count
                required:
                  - data
                  - code
              example:
                code: 0
                data:
                  synched_count: 5
                  invalid_count: 0
                  synching_count: 0
          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

````