---
title: Scraper Targets
description: Create and manage Prometheus scraper targets that collect metrics and write them to InfluxDB OSS v2 buckets.
url: https://docs.influxdata.com/influxdb/v2/api/scraper-targets/
estimated_tokens: 20021
product: InfluxDB OSS v2
version: v2
---

[Download InfluxDB API Spec](/openapi/influxdb-oss-v2-api.yml)

Create and manage Prometheus scraper targets that collect metrics and write them to InfluxDB OSS v2 buckets.

GET `/api/v2/scrapers`

### List all scraper targets

#### Parameters

##### Query parameters

`name` string

Specifies the name of the scraper target.

`id` array

List of scraper target IDs to return. If both `id` and `owner` are specified, only `id` is used.

`orgID` string

Specifies the organization ID of the scraper target.

`org` string

Specifies the organization name of the scraper target.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/scrapers" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 All scraper targets

`configurations` object\[\]

POST `/api/v2/scrapers`

### Create a scraper target

#### Parameters

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

Scraper target to create

Content-Type: `application/json`

`allowInsecure` boolean

Skip TLS verification on endpoint.

`bucketID` string

The ID of the bucket to write to.

`name` string

The name of the scraper target.

`orgID` string

The organization ID.

`type` string

The type of the metrics to be parsed.

Allowed: `prometheus`

`url` string

The URL of the metrics endpoint.

Example: `"http://localhost:9090/metrics"`

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/scrapers" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "allowInsecure": false,
  "bucketID": "BUCKETID",
  "name": "NAME",
  "orgID": "ORGID",
  "type": "prometheus",
  "url": "http://localhost:9090/metrics"
}'
```

#### Responses

201 Scraper target created

default Internal server error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/scrapers/{scraperTargetID}`

### Retrieve a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The identifier of the scraper target.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 The scraper target

default Internal server error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

PATCH `/api/v2/scrapers/{scraperTargetID}`

### Update a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The identifier of the scraper target.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

Scraper target update to apply

Content-Type: `application/json`

`allowInsecure` boolean

Skip TLS verification on endpoint.

`bucketID` string

The ID of the bucket to write to.

`name` string

The name of the scraper target.

`orgID` string

The organization ID.

`type` string

The type of the metrics to be parsed.

Allowed: `prometheus`

`url` string

The URL of the metrics endpoint.

Example: `"http://localhost:9090/metrics"`

Example request [Ask AI about this](#)

```sh
curl --request PATCH \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "allowInsecure": false,
  "bucketID": "BUCKETID",
  "name": "NAME",
  "orgID": "ORGID",
  "type": "prometheus",
  "url": "http://localhost:9090/metrics"
}'
```

#### Responses

200 Scraper target updated

default Internal server error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE `/api/v2/scrapers/{scraperTargetID}`

### Delete a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The identifier of the scraper target.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204 Scraper target deleted

default Internal server error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/scrapers/{scraperTargetID}/labels`

### List all labels for a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The scraper target ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}/labels" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 A list of labels for a scraper target.

`labels` string

`links` string

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

POST `/api/v2/scrapers/{scraperTargetID}/labels`

### Add a label to a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The scraper target ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

Label to add

Content-Type: `application/json`

`labelID` required string

A label ID. Specifies the label to attach.

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}/labels" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "labelID": "LABELID"
}'
```

#### Responses

201 The newly added label

`label` string

`links` string

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE `/api/v2/scrapers/{scraperTargetID}/labels/{labelID}`

### Delete a label from a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The scraper target ID.

`labelID` required string

The label ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}/labels/{labelID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204 Delete has been accepted

404 Scraper target not found

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/scrapers/{scraperTargetID}/members`

### List all users with member privileges for a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The scraper target ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}/members" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 A list of scraper target members

`links` object

`self` string <uri>

`users` object\[\]

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

POST `/api/v2/scrapers/{scraperTargetID}/members`

### Add a member to a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The scraper target ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

User to add as member

Content-Type: `application/json`

`id` required string

The ID of the user to add to the resource.

`name` string

The name of the user to add to the resource.

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}/members" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "id": "ID",
  "name": "NAME"
}'
```

#### Responses

201 Member added to scraper targets

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE `/api/v2/scrapers/{scraperTargetID}/members/{userID}`

### Remove a member from a scraper target

#### Parameters

##### Path parameters

`userID` required string

The ID of member to remove.

`scraperTargetID` required string

The scraper target ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}/members/{userID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204 Member removed

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

GET `/api/v2/scrapers/{scraperTargetID}/owners`

### List all owners of a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The scraper target ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}/owners" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 A list of scraper target owners

`links` object

`self` string <uri>

`users` object\[\]

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

POST `/api/v2/scrapers/{scraperTargetID}/owners`

### Add an owner to a scraper target

#### Parameters

##### Path parameters

`scraperTargetID` required string

The scraper target ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

#### Request body required

User to add as owner

Content-Type: `application/json`

`id` required string

The ID of the user to add to the resource.

`name` string

The name of the user to add to the resource.

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}/owners" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "id": "ID",
  "name": "NAME"
}'
```

#### Responses

201 Scraper target owner added

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.

DELETE `/api/v2/scrapers/{scraperTargetID}/owners/{userID}`

### Remove an owner from a scraper target

#### Parameters

##### Path parameters

`userID` required string

The ID of owner to remove.

`scraperTargetID` required string

The scraper target ID.

##### Header parameters

`Zap-Trace-Span` string

OpenTracing span context

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/scrapers/{scraperTargetID}/owners/{userID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204 Owner removed

default Unexpected error

`code` required string

code is the machine-readable error code.

Allowed: `internal error` , `not implemented` , `not found` , `conflict` , `invalid` , `unprocessable entity` , `empty value` , `unavailable` , `forbidden` , `too many requests` , `unauthorized` , `method not allowed` , `request too large` , `unsupported media type`

`err` string

Stack of errors that occurred during processing of the request. Useful for debugging.

`message` string

Human-readable message.

`op` string

Describes the logical code operation when the error occurred. Useful for debugging.
