---
title: "The Pipeline HTTP API v2 | Grafana Cloud documentation"
description: "Reference documentation for the Grafana Fleet Management Pipeline HTTP API v2, which allows you to perform CRUD operations on configuration pipelines and list them with pagination, filtering, and sorting."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# The Pipeline HTTP API v2

The Grafana Fleet Management Pipeline API v2 allows you to perform CRUD operations on configuration pipelines. It also lets you list, count, and delete pipelines in bulk using filters, and page through large result sets.

For a full definition of the Pipeline API v2, refer to the [`.proto` file](https://github.com/grafana/fleet-management-api/blob/main/api/pipeline/v2/pipeline.proto).

## Differences from v1

When you migrate from the [Pipeline API v1](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/api-reference/pipeline-api/), the following changes affect the requests you send and the responses you receive:

- **Pagination:** `ListPipelines`, `ListPipelinesRevisions`, and `ListPipelineRevisions` return results one page at a time. Use the `next_page_token` from a response to request the next page.
- **Filtering and sorting:** `ListPipelines` filters by pipeline name, enabled state, and metadata type, and sorts by name or last modified time. It no longer filters by `local_attributes`, `remote_attributes`, or `config_type`. To find the pipelines that match a set of collector attributes, use `GetMatchingPipelines`.
- **Revision order and filters:** The revision RPCs return revisions newest first and accept filters for operation, author, and creation time.
- **New RPCs:** `CountPipelines`, `BulkDeletePipelinesByFilter`, and `GetMatchingPipelines` are only available in v2.
- **Stricter validation:** `BulkDeletePipelines.ids`, `BulkDeletePipelinesByFilter.exclude_ids`, `ListPipelineRevisions.id`, `ListPipelinesRevisionsFilter.pipeline_id`, and `GetPipelineRevision.revision_id` must be digit-only strings.

## Find the base URL

You can find the base URL for the Pipeline API in the Grafana Cloud Fleet Management interface.

1. In your Grafana Cloud stack, click **Connections** &gt; **Fleet Management** in the left-side menu.
2. On the Fleet Management interface, switch to the **API** tab.
3. Find the URL in the **Base URL** section. It looks like one of the following URLs, depending on the region where your Grafana Cloud stack is hosted. To call the Pipeline API v2, replace `pipeline.v1` with `pipeline.v2` in the URL.
   
   Flat format, where `<CLUSTER_NAME>` is the production cluster of your stack:
   
   ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```none
   https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/
   ```
   
   Nested format, where `<CSP>` is the cloud provider, `<CSP_REGION>` is the cloud provider’s region identifier, and `<COUNTER>` distinguishes multiple Grafana Cloud regions hosted in the same cloud provider region:
   
   ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```none
   https://fleet-management-<CLUSTER_NAME>.<CSP>-<CSP_REGION>-<COUNTER>.grafana.net/pipeline.v2.PipelineService/
   ```
   
   > Caution
   > 
   > Always copy the exact URL from your Fleet Management interface instead of constructing it by hand. For details on the URL differences, refer to [Determine Grafana Cloud URLs based on region](https://grafana.com/docs/grafana-cloud/security-and-account-management/region-url-formats/).

### Secure connection

If you need to secure your API traffic, you can configure a private endpoint in place of the base URL. You can find the service name for endpoint configuration and the private DNS name on the same **API** tab where the base URL is found. For more information, refer to the instructions for your cloud provider:

- [AWS PrivateLink](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/set-up/connectivity-options/aws-privatelink/)
- [Azure Private Link](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/set-up/connectivity-options/azure-private-link/)
- [GCP Private Service Connect](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/set-up/connectivity-options/gcp-private-service-connect/)

## Rate limit

You can make a request to the [Fleet Management Tenant API](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/api-reference/tenant-api/) to find out the requests-per-second limits applied to your stack.

Requests to the Pipeline API v2 are included in the `requests_per_second:api` limit reported by the Tenant API and are limited to 3 requests per second by default. Requests to the Pipeline API v1 and v2 share this limit.

## PipelineService

The `PipelineService` defines the RPCs for managing pipelines.

Expand table

| Method Name                 | Request Type                       | Response Type                       | Description                                                           |
|-----------------------------|------------------------------------|-------------------------------------|-----------------------------------------------------------------------|
| GetPipeline                 | GetPipelineRequest                 | Pipeline                            | Returns a pipeline by ID                                              |
| GetPipelineID               | GetPipelineIDRequest               | GetPipelineIDResponse               | Returns a pipeline ID by name                                         |
| ListPipelines               | ListPipelinesRequest               | ListPipelinesResponse               | Returns a page of pipelines                                           |
| CountPipelines              | CountPipelinesRequest              | CountPipelinesResponse              | Returns the number of pipelines matching a filter                     |
| GetMatchingPipelines        | GetMatchingPipelinesRequest        | GetMatchingPipelinesResponse        | Returns the pipelines whose matchers match a set of attributes        |
| CreatePipeline              | CreatePipelineRequest              | Pipeline                            | Creates a new pipeline and returns it                                 |
| UpdatePipeline              | UpdatePipelineRequest              | Pipeline                            | Updates an existing pipeline and returns it                           |
| UpsertPipeline              | UpsertPipelineRequest              | Pipeline                            | Creates a new pipeline or updates an existing one and returns it      |
| DeletePipeline              | DeletePipelineRequest              | DeletePipelineResponse              | Deletes a pipeline by ID                                              |
| BulkDeletePipelines         | BulkDeletePipelinesRequest         | BulkDeletePipelinesResponse         | Deletes multiple pipelines by their IDs                               |
| BulkDeletePipelinesByFilter | BulkDeletePipelinesByFilterRequest | BulkDeletePipelinesByFilterResponse | Deletes every pipeline matching a filter                              |
| SyncPipelines               | SyncPipelinesRequest               | SyncPipelinesResponse               | Creates, updates, and deletes multiple pipelines from a common source |
| ListPipelinesRevisions      | ListPipelinesRevisionsRequest      | ListPipelinesRevisionsResponse      | Returns a page of pipeline revisions across all pipelines             |
| ListPipelineRevisions       | ListPipelineRevisionsRequest       | ListPipelineRevisionsResponse       | Returns a page of pipeline revisions for a single pipeline by ID      |
| GetPipelineRevision         | GetPipelineRevisionRequest         | PipelineRevision                    | Returns a pipeline revision by revision ID                            |

## Endpoints

This section describes the request and response messages of the `PipelineService` RPCs and the types they use.

> Note
> 
> Protobuf field names are defined in `snake_case`. Responses use `camelCase` field names. Both `snake_case` and `camelCase` field names are accepted in requests.

### CreatePipelineRequest

`CreatePipelineRequest` is the request to create a new pipeline. Don’t set `pipeline.id`; Fleet Management assigns the ID when it creates the pipeline. If a pipeline with the same name already exists, the request returns a 409 `ALREADY EXISTS` error. If no `config_type` is specified in this request, `CONFIG_TYPE_ALLOY` is assigned by default.

Expand table

| Field          | Type     | Label    | Description                                                                                     |
|----------------|----------|----------|-------------------------------------------------------------------------------------------------|
| pipeline       | Pipeline | required | The pipeline to create                                                                          |
| validate\_only | bool     | optional | If set, validates the request and previews the response, but doesn’t create the actual resource |

### DeletePipelineRequest

`DeletePipelineRequest` is the request to delete a pipeline by its ID. Requests with an `id` that isn’t a digit-only string fail with a 400 `BAD REQUEST` validation error.

Expand table

| Field | Type   | Label    | Description                                                                 |
|-------|--------|----------|-----------------------------------------------------------------------------|
| id    | string | required | ID of the pipeline to delete; must be a string of digits (unsigned integer) |

### DeletePipelineResponse

`DeletePipelineResponse` is the response to deleting a pipeline. This message is empty and the results of the deletion are defined by the HTTP status code of the response.

### BulkDeletePipelinesRequest

`BulkDeletePipelinesRequest` is the request to delete multiple pipelines by their IDs.

The operation is atomic: either all pipelines are deleted or none are. If any pipeline in the list doesn’t exist, the entire operation fails with a 404 `NOT FOUND` error and no pipelines are deleted. Requests with duplicate IDs, or with an ID that isn’t a digit-only string, fail with a 400 `BAD REQUEST` validation error.

Expand table

| Field | Type         | Label    | Description                                                                                              |
|-------|--------------|----------|----------------------------------------------------------------------------------------------------------|
| ids   | list(string) | required | The IDs of the pipelines to delete; must be non-empty, unique, and strings of digits (unsigned integers) |

### BulkDeletePipelinesResponse

`BulkDeletePipelinesResponse` is the response to deleting multiple pipelines. This message is empty and the results of the deletion are defined by the HTTP status code of the response.

### BulkDeletePipelinesByFilterRequest

`BulkDeletePipelinesByFilterRequest` is the request to delete every pipeline matching a filter. To preview which pipelines the request deletes, send a `ListPipelinesRequest` with the same `filter`.

The `filter` must set `enabled`, `metadata_type`, or a non-empty `name`. Requests that don’t set one fail with a 400 `BAD REQUEST` validation error.

Fleet Management selects the matching pipelines before it deletes them. It skips pipelines that another request deletes in the meantime, and still deletes pipelines that another request changes in the meantime. Skipped pipelines don’t count toward `deleted_count`, so `deleted_count` can be smaller than the number of matching pipelines you didn’t exclude.

To guard against unexpected changes, set `expected_count` to the number of pipelines you expect the request to delete: the `count` that `CountPipelines` returns for the same filter, minus the matching pipelines in `exclude_ids`. Fleet Management compares `expected_count` with the number of matching pipelines after it removes the `exclude_ids`. If the numbers differ, the request fails with a 400 `FAILED PRECONDITION` error and deletes no pipelines.

Expand table

| Field           | Type                | Label    | Description                                                                                                                                        |
|-----------------|---------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| filter          | ListPipelinesFilter | required | Pipelines matching this filter are deleted                                                                                                         |
| exclude\_ids    | list(string)        | optional | IDs of matching pipelines to leave untouched; must be unique strings of digits (unsigned integers); IDs that don’t match the filter have no effect |
| expected\_count | int32               | optional | Non-negative count that must match the number of pipelines selected after `exclude_ids` are removed; `0` is allowed                                |

### BulkDeletePipelinesByFilterResponse

`BulkDeletePipelinesByFilterResponse` is the response to deleting pipelines by filter.

Expand table

| Field          | Type  | Label | Description                 |
|----------------|-------|-------|-----------------------------|
| deleted\_count | int32 |       | Number of pipelines deleted |

### GetPipelineRequest

`GetPipelineRequest` is the request to retrieve a pipeline by its ID.

Expand table

| Field | Type   | Label    | Description               |
|-------|--------|----------|---------------------------|
| id    | string | required | ID of the pipeline to get |

### GetPipelineIDRequest

`GetPipelineIDRequest` is the request to retrieve a pipeline ID by its name.

Expand table

| Field | Type   | Label    | Description                            |
|-------|--------|----------|----------------------------------------|
| name  | string | required | Name of the pipeline to get the ID for |

### GetPipelineIDResponse

`GetPipelineIDResponse` is the response to retrieving a pipeline ID.

Expand table

| Field | Type   | Label | Description        |
|-------|--------|-------|--------------------|
| id    | string |       | ID of the pipeline |

### ListPipelinesRequest

`ListPipelinesRequest` is the request to get a page of pipelines, including their contents and matchers. You can filter the returned pipelines by name, enabled state, and metadata type, and sort them by name or last modified time.

To get the next page, send the same request with `page_token` set to the `next_page_token` from the previous response. If you change `filter`, `sort_by`, or `sort_descending`, omit `page_token` and start again from the first page. Requests with an invalid `page_token` fail with a 400 `BAD REQUEST` error.

Expand table

| Field            | Type                        | Label    | Description                                                                                      |
|------------------|-----------------------------|----------|--------------------------------------------------------------------------------------------------|
| page\_token      | string                      | optional | Token for the page to return; when empty, the first page is returned                             |
| page\_size       | int32                       | optional | Maximum number of pipelines to return; defaults to 100 when unset or non-positive; capped at 500 |
| sort\_by         | ListPipelinesRequest.SortBy | optional | Field to sort results by; defaults to `SORT_BY_NAME`                                             |
| sort\_descending | bool                        | optional | If set, sorts results in descending order                                                        |
| filter           | ListPipelinesFilter         | optional | Filters to apply to the results                                                                  |

#### ListPipelinesRequest.SortBy

Expand table

| Value                    | Description                                                                        |
|--------------------------|------------------------------------------------------------------------------------|
| SORT\_BY\_UNSPECIFIED    | Default; sorts by name                                                             |
| SORT\_BY\_NAME           | Sorts by pipeline name                                                             |
| SORT\_BY\_LAST\_MODIFIED | Sorts by the time the pipeline was last updated, then by name for equal timestamps |

### ListPipelinesFilter

`ListPipelinesFilter` narrows down the pipelines returned by `ListPipelinesRequest`, counted by `CountPipelinesRequest`, and deleted by `BulkDeletePipelinesByFilterRequest`. When you set more than one field, a pipeline must match all of them.

Expand table

| Field          | Type   | Label    | Description                                                                                                                                                                                                             |
|----------------|--------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name           | string | optional | Returns pipelines whose name contains this value (case-insensitive); 100 character limit                                                                                                                                |
| enabled        | bool   | optional | Returns pipelines with this enabled state; when unset, returns both enabled and disabled pipelines                                                                                                                      |
| metadata\_type | string | optional | Returns pipelines whose metadata `type` exactly matches this value (case-sensitive); pipelines without a string metadata `type` never match; an empty string matches only an explicit empty `type`; 100 character limit |

### ListPipelinesResponse

`ListPipelinesResponse` is the response to listing pipelines.

Expand table

| Field             | Type           | Label | Description                                                   |
|-------------------|----------------|-------|---------------------------------------------------------------|
| pipelines         | list(Pipeline) |       | List of pipelines for the current page                        |
| next\_page\_token | string         |       | Token for the next page; empty when there are no more results |

### CountPipelinesRequest

`CountPipelinesRequest` is the request to count the pipelines matching a filter. It accepts the same filter as `ListPipelinesRequest`.

Expand table

| Field  | Type                | Label    | Description                                                      |
|--------|---------------------|----------|------------------------------------------------------------------|
| filter | ListPipelinesFilter | optional | Filters to apply when counting; when unset, counts all pipelines |

### CountPipelinesResponse

`CountPipelinesResponse` is the response to counting pipelines.

Expand table

| Field | Type  | Label | Description                                   |
|-------|-------|-------|-----------------------------------------------|
| count | int32 |       | Total number of pipelines matching the filter |

### GetMatchingPipelinesRequest

`GetMatchingPipelinesRequest` is the request to retrieve the pipelines whose matchers match a set of collector attributes. Fleet Management matches pipelines against the attributes in the request and doesn’t look up a stored collector. The `collector_id` is applied as the `collector.ID` attribute and replaces any `collector.ID` key in the supplied attributes. If a key exists in both `local_attributes` and `remote_attributes`, the remote attribute takes precedence. The response doesn’t guarantee an order of pipelines.

Expand table

| Field              | Type        | Label    | Description                                                                                                                |
|--------------------|-------------|----------|----------------------------------------------------------------------------------------------------------------------------|
| collector\_id      | string      | required | ID of the collector to match pipelines for                                                                                 |
| local\_attributes  | map(string) | optional | Local attributes to match against; maximum of 25 attributes, 100 character limit per key, 150 per value                    |
| remote\_attributes | map(string) | optional | Remote attributes to match against; maximum of 100 attributes, 100 character limit per key, 150 per value                  |
| config\_type       | ConfigType  | optional | Returns only pipelines of this config type; when unset or `CONFIG_TYPE_UNSPECIFIED`, returns pipelines of all config types |
| enabled            | bool        | optional | Returns pipelines with this enabled state; when unset, returns both enabled and disabled pipelines                         |

### GetMatchingPipelinesResponse

`GetMatchingPipelinesResponse` is the response to retrieving matching pipelines.

Expand table

| Field     | Type           | Label | Description                                                    |
|-----------|----------------|-------|----------------------------------------------------------------|
| pipelines | list(Pipeline) |       | List of pipelines whose matchers match the supplied attributes |

### ConfigType

Represents the type of config used by a pipeline. If the `ConfigType` is left unspecified in a create, update, upsert, or sync request, Fleet Management assigns `CONFIG_TYPE_ALLOY`. To keep an OpenTelemetry Collector pipeline, set `CONFIG_TYPE_OTEL` every time you update it.

Expand table

| Value                     | Description                 |
|---------------------------|-----------------------------|
| CONFIG\_TYPE\_UNSPECIFIED | Default; don’t set manually |
| CONFIG\_TYPE\_ALLOY       | Alloy configuration         |
| CONFIG\_TYPE\_OTEL        | OpenTelemetry configuration |

### Pipeline

A `Pipeline` is a self-contained piece of configuration that can be assigned to collectors based on matchers.

Expand table

| Field        | Type                      | Label    | Description                                                                                                                                                                                                                                                                      |
|--------------|---------------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name         | string                    | required | Name of the pipeline which is the unique identifier for the pipeline; must be a valid Alloy identifier; 100 character limit                                                                                                                                                      |
| contents     | string                    | required | Configuration contents of the pipeline to be used by collectors; can’t be empty                                                                                                                                                                                                  |
| matchers     | list(string)              |          | Used to match against collectors and assign pipelines to them; follows the syntax of Prometheus [Alertmanager matchers](https://prometheus.io/docs/alerting/latest/configuration/#matcher); maximum of 15 matchers; 200 character limit per matcher; matcher keys can’t be empty |
| created\_at  | google.protobuf.Timestamp | optional | Timestamp when the pipeline was created                                                                                                                                                                                                                                          |
| updated\_at  | google.protobuf.Timestamp | optional | Timestamp when the pipeline was last updated                                                                                                                                                                                                                                     |
| enabled      | bool                      | optional | Whether the pipeline is enabled for collectors; defaults to `true` when unset in create, update, upsert, and sync requests                                                                                                                                                       |
| id           | string                    | optional | Server-assigned ID of the pipeline                                                                                                                                                                                                                                               |
| metadata     | google.protobuf.Struct    | optional | Additional information about the pipeline; if non-empty, must include a `type` field with a string value                                                                                                                                                                         |
| source       | PipelineSource            | optional | Source of the pipeline                                                                                                                                                                                                                                                           |
| config\_type | ConfigType                | optional | Type of configuration (Grafana Alloy or OpenTelemetry Collector); defaults to `CONFIG_TYPE_ALLOY` when unspecified in create, update, upsert, and sync requests                                                                                                                  |

### PipelineSource

`PipelineSource` indicates the external source of a pipeline. Although the two fields `type` and `namespace` are `optional`, if `type` is specified, then `namespace` must also be specified. If `type` is set to `SOURCE_TYPE_UNSPECIFIED`, `namespace` must be an empty string. Requests that don’t follow these rules fail with a 400 `BAD REQUEST` validation error.

Expand table

| Field     | Type                       | Label    | Description               |
|-----------|----------------------------|----------|---------------------------|
| type      | PipelineSource\_SourceType | optional | Source of the pipeline    |
| namespace | string                     | optional | Namespace of the pipeline |

#### PipelineSource\_SourceType

Expand table

| Value                     | Description                                                                        |
|---------------------------|------------------------------------------------------------------------------------|
| SOURCE\_TYPE\_UNSPECIFIED | Default value applied when `source` isn’t specified; don’t set this value manually |
| SOURCE\_TYPE\_GIT         | The pipeline originates from a Git workflow                                        |
| SOURCE\_TYPE\_TERRAFORM   | The pipeline originates from a Terraform workflow                                  |
| SOURCE\_TYPE\_GRAFANA     | The pipeline was created by an automated workflow in Grafana Cloud                 |

### UpdatePipelineRequest

`UpdatePipelineRequest` is the request to update an existing pipeline. Set `pipeline.id` to the ID of the pipeline to update. The pipeline supplied in this request replaces the existing configuration. Include all configuration fields you want to keep. If the pipeline doesn’t already exist, this request returns a 404 `NOT FOUND` error.

Expand table

| Field          | Type     | Label    | Description                                                                                     |
|----------------|----------|----------|-------------------------------------------------------------------------------------------------|
| pipeline       | Pipeline | required | Contents of the pipeline to update                                                              |
| validate\_only | bool     | optional | If set, validates the request and previews the response, but doesn’t update the actual resource |

### UpsertPipelineRequest

`UpsertPipelineRequest` is the request to create a new pipeline or update an existing one by name. Don’t set `pipeline.id`; Fleet Management uses `pipeline.name` to find the pipeline. If the pipeline already exists, Fleet Management replaces its configuration, as in an `UpdatePipelineRequest`. Include all configuration fields you want to keep.

Expand table

| Field          | Type     | Label    | Description                                                                                     |
|----------------|----------|----------|-------------------------------------------------------------------------------------------------|
| pipeline       | Pipeline | required | Pipeline to create or update                                                                    |
| validate\_only | bool     | optional | If set, validates the request and previews the response, but doesn’t upsert the actual resource |

### ListPipelinesRevisionsRequest

`ListPipelinesRevisionsRequest` is the request to get a page of revisions across all pipelines, excluding contents. The response lists revisions newest first.

To get the next page, send the same request with `page_token` set to the `next_page_token` from the previous response. If you change `filter`, omit `page_token` and start again from the first page. Requests with an invalid `page_token` fail with a 400 `BAD REQUEST` error.

Expand table

| Field       | Type                         | Label    | Description                                                                                      |
|-------------|------------------------------|----------|--------------------------------------------------------------------------------------------------|
| page\_token | string                       | optional | Token for the page to return; when empty, the first page is returned                             |
| page\_size  | int32                        | optional | Maximum number of revisions to return; defaults to 100 when unset or non-positive; capped at 500 |
| filter      | ListPipelinesRevisionsFilter | optional | Filters to apply to the results                                                                  |

### ListPipelinesRevisionsFilter

`ListPipelinesRevisionsFilter` narrows down the revisions returned by `ListPipelinesRevisionsRequest`. The `pipeline_name` filter matches the name stored in each revision; later renames don’t change earlier revisions. When you set more than one field, a revision must match all of them. If you set both `created_after` and `created_before`, `created_before` must be later than `created_after`.

Expand table

| Field           | Type                       | Label    | Description                                                                                       |
|-----------------|----------------------------|----------|---------------------------------------------------------------------------------------------------|
| pipeline\_name  | string                     | optional | Returns revisions whose pipeline name contains this value (case-insensitive); 100 character limit |
| pipeline\_id    | string                     | optional | Returns revisions of the pipeline with this ID; must be a string of digits (unsigned integer)     |
| operation       | PipelineRevision.Operation | optional | Returns revisions with this operation; can’t be `UNSPECIFIED`                                     |
| author          | string                     | optional | Returns revisions whose author contains this value (case-insensitive); 256 character limit        |
| created\_after  | google.protobuf.Timestamp  | optional | Returns revisions created at or after this time                                                   |
| created\_before | google.protobuf.Timestamp  | optional | Returns revisions created before this time                                                        |

### ListPipelinesRevisionsResponse

`ListPipelinesRevisionsResponse` is the response to listing revisions across all pipelines. The pipeline snapshot in each revision doesn’t include the pipeline contents.

Expand table

| Field               | Type                   | Label | Description                                                   |
|---------------------|------------------------|-------|---------------------------------------------------------------|
| pipeline\_revisions | list(PipelineRevision) |       | List of pipeline revisions for the current page               |
| next\_page\_token   | string                 |       | Token for the next page; empty when there are no more results |

### ListPipelineRevisionsRequest

`ListPipelineRevisionsRequest` is the request to retrieve a page of pipeline revisions by pipeline ID. The response lists revisions newest first. An unknown pipeline ID returns an empty list.

To get the next page, send the same request with `page_token` set to the `next_page_token` from the previous response. If you change `id` or `filter`, omit `page_token` and start again from the first page. Requests with an invalid `page_token` fail with a 400 `BAD REQUEST` error.

Expand table

| Field       | Type                        | Label    | Description                                                                                      |
|-------------|-----------------------------|----------|--------------------------------------------------------------------------------------------------|
| id          | string                      | required | ID of the pipeline to get; must be a string of digits (unsigned integer)                         |
| page\_token | string                      | optional | Token for the page to return; when empty, the first page is returned                             |
| page\_size  | int32                       | optional | Maximum number of revisions to return; defaults to 100 when unset or non-positive; capped at 500 |
| filter      | ListPipelineRevisionsFilter | optional | Filters to apply to the results                                                                  |

### ListPipelineRevisionsFilter

`ListPipelineRevisionsFilter` narrows down the revisions returned by `ListPipelineRevisionsRequest`. It accepts the same fields as `ListPipelinesRevisionsFilter`, except `pipeline_name` and `pipeline_id`.

Expand table

| Field           | Type                       | Label    | Description                                                                                |
|-----------------|----------------------------|----------|--------------------------------------------------------------------------------------------|
| operation       | PipelineRevision.Operation | optional | Returns revisions with this operation; can’t be `UNSPECIFIED`                              |
| author          | string                     | optional | Returns revisions whose author contains this value (case-insensitive); 256 character limit |
| created\_after  | google.protobuf.Timestamp  | optional | Returns revisions created at or after this time                                            |
| created\_before | google.protobuf.Timestamp  | optional | Returns revisions created before this time                                                 |

### ListPipelineRevisionsResponse

`ListPipelineRevisionsResponse` is the response to listing the revisions of a single pipeline.

Expand table

| Field               | Type                   | Label | Description                                                   |
|---------------------|------------------------|-------|---------------------------------------------------------------|
| pipeline\_revisions | list(PipelineRevision) |       | List of pipeline revisions for the current page               |
| next\_page\_token   | string                 |       | Token for the next page; empty when there are no more results |

### GetPipelineRevisionRequest

`GetPipelineRevisionRequest` is the request to retrieve a pipeline revision by revision ID. If the revision doesn’t exist, the request returns a 404 `NOT FOUND` error.

Expand table

| Field        | Type   | Label    | Description                                                                       |
|--------------|--------|----------|-----------------------------------------------------------------------------------|
| revision\_id | string | required | ID of the pipeline revision to get; must be a string of digits (unsigned integer) |

### PipelineRevision

A `PipelineRevision` represents a point in time for a `Pipeline`. Revisions created without author context or before author tracking was available omit the `author` field.

Expand table

| Field        | Type                       | Label    | Description                                                                                                                             |
|--------------|----------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------|
| revision\_id | string                     | required | Server-assigned ID of the pipeline revision                                                                                             |
| snapshot     | Pipeline                   | required | The pipeline at the point in time of the revision; `metadata` is always empty, and `source`, `created_at`, and `updated_at` are omitted |
| created\_at  | google.protobuf.Timestamp  | required | Timestamp when the pipeline revision was created                                                                                        |
| operation    | PipelineRevision.Operation | required | The operation that was performed on the pipeline which created the revision                                                             |
| author       | string                     | optional | The user associated with the request that created the revision, when available                                                          |

#### PipelineRevision.Operation

Expand table

| Value       | Description                                           |
|-------------|-------------------------------------------------------|
| UNSPECIFIED | Unknown revision operation                            |
| INSERT      | The pipeline was created at the time of this revision |
| UPDATE      | The pipeline was updated at the time of this revision |
| DELETE      | The pipeline was deleted at the time of this revision |

### SyncPipelinesRequest

`SyncPipelinesRequest` is the request to bulk update pipelines from a common source. Fleet Management creates pipelines that don’t exist and updates existing pipelines as it does for an `UpsertPipelineRequest`. Fleet Management deletes pipelines that have the same source `type` and `namespace` as the request’s `source` but aren’t in the request’s `pipelines`. It leaves pipelines with a different source or no source unchanged. The `source` must set a `type` other than `SOURCE_TYPE_UNSPECIFIED` and a non-empty `namespace`.

Expand table

| Field     | Type           | Label    | Description               |
|-----------|----------------|----------|---------------------------|
| source    | PipelineSource | required | Source of the pipeline(s) |
| pipelines | list(Pipeline) | required | List of pipelines         |

### SyncPipelinesResponse

`SyncPipelinesResponse` is the response to bulk updating pipelines. This message is empty and the results of the sync are defined by the HTTP status code of the response. An HTTP status code of 400 indicates a validation error in the `source` field of the request or in one or more of the pipelines.

## Examples

This section shows example requests and responses for the Pipeline API v2. For examples of `SyncPipelines` requests, refer to [Sync configuration pipelines from a Git repository](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/manage-fleet/pipelines/sync-pipelines-git/).

The examples use the following placeholders:

- *`<INSTANCE_ID>`* : Your Grafana Cloud instance ID, which you can find on the **API** tab in the Fleet Management interface. The API uses it as the Basic Auth username.
- *`<ACCESS_POLICY_TOKEN>`* : Your Grafana Cloud access policy token, which the API uses as the Basic Auth password.
- *`<CLUSTER_NAME>`* : The production cluster of your stack, as described in the [Find the base URL](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/api-reference/pipeline-api-v2/#find-the-base-url) section. If your base URL uses the nested format, replace the whole host with the one from your base URL.
- *`<PIPELINE_NAME>`* : The name of the pipeline to create or update.

Pipeline API requests and responses require proper escaping of the pipeline contents. For this reason, some use of `jq` is helpful. In this example, the contents of the pipeline are saved in a file named `config.alloy`:

Alloy ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
--- config.alloy ---
prometheus.exporter.self "alloy" { }

prometheus.scrape "alloy" {
  targets    = prometheus.exporter.self.alloy.targets
  forward_to = [prometheus.remote_write.grafanacloud.receiver]

  scrape_interval = "60s"
}

prometheus.remote_write "grafanacloud" {
  // Must match the uniquely-identifiable ID set up in the remotecfg block.
  external_labels = {"collector_id" = constants.hostname}

  endpoint {
    url = <SERVICE_URL>

    basic_auth {
      username      = <USERNAME>
      password_file = <PASSWORD_FILE>
    }
  }
}
```

In this file, *`<SERVICE_URL>`* is the remote write endpoint, *`<USERNAME>`* is the username for that endpoint, and *`<PASSWORD_FILE>`* is the path to a file that contains its password.

To build a payload for the `CreatePipeline` and `UpsertPipeline` requests with properly escaped content, the following command is a good starting point. It redirects the content to a `create-pipeline.json` file for easier handling:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
jq --arg contents "$(cat config.alloy)" \
   --arg name "<PIPELINE_NAME>" \
   --argjson matchers '["collector.os=linux", "team!=team-a"]' \
   --argjson enabled true \
   '.pipeline = {name: $name, contents: $contents, matchers: $matchers, enabled: $enabled}' \
   <<< '{}' > create-pipeline.json
```

To create the pipeline, send the payload in a `CreatePipeline` request:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d @create-pipeline.json \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/CreatePipeline
```

The response shows what Fleet Management created, including the unique ID of the pipeline:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "name": "myname",
  "contents": " ... pipeline contents ...",
  "matchers": [
    "collector.os=\"linux\"",
    "team!=\"team-a\""
  ],
  "enabled": true,
  "id": "22234",
  "metadata": {},
  "configType": "CONFIG_TYPE_ALLOY"
}
```

The `ListPipelines` request returns one page of pipelines. In this example, the request asks for enabled pipelines whose name contains `pipeline`, two at a time:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"page_size": 2, "filter": {"name": "pipeline", "enabled": true}}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/ListPipelines
```

The response includes a `nextPageToken` because more pipelines match the filter:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "pipelines": [
    {
      "name": "pipeline_1",
      "contents": " ... pipeline contents ...",
      "matchers": [
        "team=\"team-a\""
      ],
      "createdAt": "2024-09-02T12:31:47Z",
      "updatedAt": "2024-09-02T14:08:10Z",
      "enabled": true,
      "id": "22231",
      "metadata": {},
      "configType": "CONFIG_TYPE_ALLOY"
    },
    {
      "name": "pipeline_2",
      "contents": " ... pipeline contents ...",
      "matchers": [
        "collector.os=\"darwin\""
      ],
      "createdAt": "2024-09-02T16:42:26Z",
      "updatedAt": "2024-09-02T16:42:26Z",
      "enabled": true,
      "id": "22235",
      "metadata": {},
      "configType": "CONFIG_TYPE_ALLOY"
    }
  ],
  "nextPageToken": "eyJwcmltYXJ5IjoicGlwZWxpbmVfMiJ9"
}
```

To get the next page, send the same request with `page_token` set to the `nextPageToken` from the previous response:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"page_size": 2, "filter": {"name": "pipeline", "enabled": true}, "page_token": "eyJwcmltYXJ5IjoicGlwZWxpbmVfMiJ9"}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/ListPipelines
```

The response for the last page omits `nextPageToken`:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "pipelines": [
    {
      "name": "pipeline_3",
      "contents": " ... pipeline contents ...",
      "matchers": [
        "team=\"team-b\""
      ],
      "createdAt": "2024-09-03T08:15:02Z",
      "updatedAt": "2024-09-03T08:15:02Z",
      "enabled": true,
      "id": "22237",
      "metadata": {},
      "configType": "CONFIG_TYPE_ALLOY"
    }
  ]
}
```

The `CountPipelines` request accepts the same filter as `ListPipelines` and returns the number of matching pipelines:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"filter": {"name": "pipeline", "enabled": true}}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/CountPipelines
```

The response resembles the following:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "count": 3
}
```

The `GetMatchingPipelines` request returns the pipelines that a collector with the given attributes receives. Use it to check which pipelines match a collector before you change its attributes:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"collector_id": "my-collector", "local_attributes": {"collector.os": "darwin"}, "remote_attributes": {"team": "team-b"}, "enabled": true}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/GetMatchingPipelines
```

The response resembles the following:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "pipelines": [
    {
      "name": "pipeline_2",
      "contents": " ... pipeline contents ...",
      "matchers": [
        "collector.os=\"darwin\""
      ],
      "createdAt": "2024-09-02T16:42:26Z",
      "updatedAt": "2024-09-02T16:42:26Z",
      "enabled": true,
      "id": "22235",
      "metadata": {},
      "configType": "CONFIG_TYPE_ALLOY"
    },
    {
      "name": "pipeline_3",
      "contents": " ... pipeline contents ...",
      "matchers": [
        "team=\"team-b\""
      ],
      "createdAt": "2024-09-03T08:15:02Z",
      "updatedAt": "2024-09-03T08:15:02Z",
      "enabled": true,
      "id": "22237",
      "metadata": {},
      "configType": "CONFIG_TYPE_ALLOY"
    }
  ]
}
```

You can use a similar `jq` command to build an `UpdatePipeline` request redirected to `update-pipeline.json`, by adding the unique pipeline ID:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
jq --arg contents "$(cat config.alloy)" \
   --arg id "22234" \
   --arg name "<PIPELINE_NAME>" \
   --argjson matchers '["collector.os=linux", "team!=team-a"]' \
   --argjson enabled true \
   '.pipeline = {id: $id, name: $name, contents: $contents, matchers: $matchers, enabled: $enabled}' \
   <<< '{}' > update-pipeline.json
```

To update the pipeline, send the payload in an `UpdatePipeline` request:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d @update-pipeline.json \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/UpdatePipeline
```

The response shows what Fleet Management updated:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "name": "myname",
  "contents": " ... new pipeline contents ...",
  "matchers": [
    "collector.os=\"linux\"",
    "team!=\"team-a\""
  ],
  "enabled": true,
  "id": "22234",
  "metadata": {},
  "configType": "CONFIG_TYPE_ALLOY"
}
```

The `GetPipeline` and `DeletePipeline` requests require only an ID for accessing and removing a configuration. To get a pipeline, send a `GetPipeline` request with its ID:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"id": "22234"}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/GetPipeline
```

The response resembles the following:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "name": "myname",
  "contents": "... pipeline contents ...",
  "matchers": [
    "collector.os=\"linux\"",
    "team!=\"team-a\""
  ],
  "createdAt": "2024-09-02T16:42:26Z",
  "updatedAt": "2024-09-02T16:42:26Z",
  "enabled": true,
  "id": "22234",
  "metadata": {},
  "configType": "CONFIG_TYPE_ALLOY"
}
```

To delete the pipeline, send a `DeletePipeline` request with its ID:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"id": "22234"}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/DeletePipeline
```

The response resembles the following:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{}
```

The `BulkDeletePipelines` endpoint allows you to delete multiple pipelines based on their IDs in a single request. This is useful when you need to clean up multiple pipelines at once. The operation is atomic. If any pipeline in the list doesn’t exist, the entire operation fails with a 404 `NOT FOUND` response and no pipelines are deleted. To delete three pipelines, send their IDs in a `BulkDeletePipelines` request:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"ids": ["22231", "22235", "22237"]}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/BulkDeletePipelines
```

The response is empty, and its 200 `OK` status means Fleet Management deleted all the pipelines:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{}
```

The `BulkDeletePipelinesByFilter` endpoint lets you delete every pipeline matching a filter without listing their IDs first. Before you delete, use `ListPipelines` with the same filter to review the matching pipelines, and `CountPipelines` to get the number of matches. Set `expected_count` to that number minus the pipelines you exclude. In this example, three disabled pipelines match the filter, and the request keeps one of them, `22240`, by listing its ID in `exclude_ids`:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"filter": {"enabled": false}, "exclude_ids": ["22240"], "expected_count": 2}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/BulkDeletePipelinesByFilter
```

The response shows that Fleet Management deleted the two pipelines that weren’t excluded:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "deletedCount": 2
}
```

If the number of matching pipelines changes before the request runs, the request fails and deletes nothing. In this example, a fourth pipeline matches the filter when the request runs:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"filter": {"enabled": false}, "expected_count": 3}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/BulkDeletePipelinesByFilter
```

The response is HTTP 400 with a `failed_precondition` error code.

The revision RPCs allow for revisiting the history of changes to pipeline objects for a user.

`ListPipelinesRevisions` lists all changes newest first alongside the operation that initiated them. For brevity, the response omits the configuration contents of the pipeline in each snapshot. You can filter the revisions by pipeline name or ID, operation, author, and creation time.

Similarly, `ListPipelineRevisions` allows for viewing the state of a single pipeline ID at every point in time it was changed, along with a snapshot that includes the pipeline contents. In both RPCs, the snapshot `metadata` is always empty. For details, refer to the [PipelineRevision](https://grafana.com/docs/grafana-cloud/send-data/fleet-management/api-reference/pipeline-api-v2/#pipelinerevision) section.

In this example, the request asks for the two most recent revisions created by `user_login`:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"page_size": 2, "filter": {"author": "user_login"}}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/ListPipelinesRevisions
```

The response resembles the following:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "pipelineRevisions": [
    {
      "revisionId": "4",
      "snapshot": {
        "name": "myname",
        "matchers": [
          "collector.os=\"linux\"",
          "team=\"team-a\""
        ],
        "enabled": true,
        "id": "1",
        "metadata": {},
        "configType": "CONFIG_TYPE_ALLOY"
      },
      "createdAt": "2025-02-14T09:38:55Z",
      "operation": "DELETE",
      "author": "user_login"
    },
    {
      "revisionId": "3",
      "snapshot": {
        "name": "myname",
        "matchers": [
          "collector.os=\"linux\"",
          "team=\"team-a\""
        ],
        "enabled": true,
        "id": "1",
        "metadata": {},
        "configType": "CONFIG_TYPE_ALLOY"
      },
      "createdAt": "2025-02-14T09:37:49Z",
      "operation": "UPDATE",
      "author": "user_login"
    }
  ],
  "nextPageToken": "eyJwcmltYXJ5IjoiMyJ9"
}
```

In this example, the request asks for the `UPDATE` revisions of the pipeline with ID `1`:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"id": "1", "filter": {"operation": "UPDATE"}}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/ListPipelineRevisions
```

The response resembles the following:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "pipelineRevisions": [
    {
      "revisionId": "3",
      "snapshot": {
        "name": "myname",
        "contents": "prometheus.exporter.self \"alloy\" { }\n\nprometheus.scrape \"alloy\" {\n\ttargets    = prometheus.exporter.self.alloy.targets\n\tforward_to = [prometheus.remote_write.grafanacloud.receiver]\n\n\tscrape_interval = \"60s\"\n}\n\nprometheus.remote_write \"grafanacloud\" {\n\t// Must match the uniquely-identifiable ID set up in the remotecfg block.\n\texternal_labels = {\"collector_id\" = constants.hostname}\n\n\tendpoint {\n\t\turl = \"http://localhost:8081\"\n\n\t\tbasic_auth {\n\t\t\tusername      = \"user\"\n\t\t\tpassword_file = \"/path/to/my/pass\"\n\t\t}\n\t}\n}",
        "matchers": [
          "collector.os=\"linux\"",
          "team=\"team-a\""
        ],
        "enabled": true,
        "id": "1",
        "metadata": {},
        "configType": "CONFIG_TYPE_ALLOY"
      },
      "createdAt": "2025-02-14T09:37:49Z",
      "operation": "UPDATE",
      "author": "user_login"
    }
  ]
}
```

The `GetPipelineRevision` request returns a single revision by its ID, including the contents of the pipeline at that point in time:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
curl -q \
    -d '{"revision_id": "4"}' \
    -u "<INSTANCE_ID>:<ACCESS_POLICY_TOKEN>" \
    --header "Content-Type: application/json" \
    -X POST https://fleet-management-<CLUSTER_NAME>.grafana.net/pipeline.v2.PipelineService/GetPipelineRevision
```

The response resembles the following:

JSON ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```json
{
  "revisionId": "4",
  "snapshot": {
    "name": "myname",
    "contents": "prometheus.exporter.self \"alloy\" { }\n\nprometheus.scrape \"alloy\" {\n\ttargets    = prometheus.exporter.self.alloy.targets\n\tforward_to = [prometheus.remote_write.grafanacloud.receiver]\n\n\tscrape_interval = \"60s\"\n}\n\nprometheus.remote_write \"grafanacloud\" {\n\t// Must match the uniquely-identifiable ID set up in the remotecfg block.\n\texternal_labels = {\"collector_id\" = constants.hostname}\n\n\tendpoint {\n\t\turl = \"http://localhost:8081\"\n\n\t\tbasic_auth {\n\t\t\tusername      = \"user\"\n\t\t\tpassword_file = \"/path/to/my/pass\"\n\t\t}\n\t}\n}",
    "matchers": [
      "collector.os=\"linux\"",
      "team=\"team-a\""
    ],
    "enabled": true,
    "id": "1",
    "metadata": {},
    "configType": "CONFIG_TYPE_ALLOY"
  },
  "createdAt": "2025-02-14T09:38:55Z",
  "operation": "DELETE",
  "author": "user_login"
}
```
