> For the complete documentation index, see [llms.txt](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/management/datasources/datasourceslist.md).

# List Data Sources (Batch by ID)

Fetch a known set of data sources by ID (or external ID) in a single request

### Endpoint

```sh
POST /api/v1/providers/datasources:list
```

### Description

`DataSourcesList` is the POST/body counterpart of [List Data Sources](/4yItIzMvkpAvMVFAamTf/developers/api/management/datasources/listdatasources.md). It accepts the request parameters in the body so that `ids` and `external_ids` lists travel in the request body instead of the query string, enabling batch fetch by ID without a URL-length limit.

Use this endpoint when an integration needs to retrieve a known set of data sources in a single call. The SCIM `filter` query string supported by `ListDataSources` only allows single-value `EQ` and has no `IN` operator, which forces clients to either issue N parallel `GetDataSource` calls or to page through the full list. `DataSourcesList` removes that constraint: the `ids` and `external_ids` typed lists map to a native `IN` lookup. Unknown IDs are silently omitted from the response — they are not treated as an error.

`filter`, `order_by`, `page_size`, and `page_token` keep the same semantics as `ListDataSources`. All conditions on the request are combined with `AND`.

### API Reference

{% openapi src="/files/Aco9gj4MY2XoNiD4zIjr" path="/api/v1/providers/datasources:list" method="post" %}
[openapi.yaml](https://1967633068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZDkWMxox3pekd0NsZJ%2Fuploads%2Fgit-blob-c990b1c25368cfe24114b6d88a4d362095219709%2Fopenapi.yaml?alt=media)
{% endopenapi %}

### Request Body Parameters

| Parameter      | Type      | Required? | Description                                                                                                                                                                 |
| -------------- | --------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ids`          | string\[] | Optional  | Fetch the data sources with these IDs. Maps to `id IN (...)`. Unknown IDs are silently omitted from the response.                                                           |
| `external_ids` | string\[] | Optional  | Fetch the data sources with these external IDs. Maps to `external_id IN (...)`. Unknown external IDs are silently omitted from the response.                                |
| `filter`       | string    | Optional  | SCIM filter, same syntax and attributes as `ListDataSourcesRequest.filter` (`name`, `agent_type`, `status`, `state`, `provider_id`, `data_provider_id`, `datasource_type`). |
| `order_by`     | string    | Optional  | Sort results by: `name`, `agent_type`, `status`, `state`, `provider_id`, `data_provider_id`, or `datasource_type`.                                                          |
| `page_size`    | integer   | Optional  | The maximum number of results to return. Fewer results may be returned even when more pages exist.                                                                          |
| `page_token`   | string    | Optional  | The token specifying the specific page of results to retrieve.                                                                                                              |

### Request Examples

{% tabs %}
{% tab title="Fetch by ID" %}

```bash
curl -X POST "$BASE_URL/api/v1/providers/datasources:list" \
  -H "authorization: Bearer $VEZA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": [
      "6961b032-3fd7-4baa-a230-146d1b70ec27",
      "cd0cf102-e86c-4599-9cbe-64d2c6b83236"
    ]
  }'
```

{% endtab %}

{% tab title="Fetch by External ID" %}

```bash
curl -X POST "$BASE_URL/api/v1/providers/datasources:list" \
  -H "authorization: Bearer $VEZA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "external_ids": ["aws-prod-ec2", "aws-prod-iam"]
  }'
```

{% endtab %}

{% tab title="Combined with Filter and Pagination" %}

```bash
curl -X POST "$BASE_URL/api/v1/providers/datasources:list" \
  -H "authorization: Bearer $VEZA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": ["6961b032-3fd7-4baa-a230-146d1b70ec27"],
    "filter": "status eq \"SUCCESS\"",
    "order_by": "name",
    "page_size": 10
  }'
```

{% endtab %}
{% endtabs %}

### Response Example

```json
{
  "values": [
    {
      "id": "6961b032-3fd7-4baa-a230-146d1b70ec27",
      "name": "AWS EC2 (527398259632)",
      "datasource_type": "EXTRACTOR",
      "agent_type": "AWS_EC2",
      "status": "SUCCESS",
      "provider_id": "cd0cf102-e86c-4599-9cbe-64d2c6b83236",
      "path": "AWS/ec2",
      "state": "ENABLED",
      "effective_state": "ENABLED",
      "created_at": "2021-10-26T07:10:38Z",
      "updated_at": "2021-10-26T07:10:38Z",
      "synced_at": "2022-01-13T20:53:23Z",
      "parsed_at": "2022-01-13T20:53:29Z"
    }
  ],
  "next_page_token": "",
  "has_more": false
}
```

### When to Use This Endpoint

| Use Case                                                              | Recommended Endpoint                                                                                |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| Retrieve a single data source by ID                                   | [Get Data Source](/4yItIzMvkpAvMVFAamTf/developers/api/management/datasources/getdatasource.md)     |
| Retrieve all data sources, optionally filtered by a single attribute  | [List Data Sources](/4yItIzMvkpAvMVFAamTf/developers/api/management/datasources/listdatasources.md) |
| Retrieve a known set of data sources by ID or external ID in one call | List Data Sources (Batch by ID) — this endpoint                                                     |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.veza.com/4yItIzMvkpAvMVFAamTf/developers/api/management/datasources/datasourceslist.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
