---
title: Sources
description: Manage data sources configured in InfluxDB OSS v2.
url: https://docs.influxdata.com/influxdb/v2/api/sources/
estimated_tokens: 3202
product: InfluxDB OSS v2
version: v2
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb/v2/api/sources/
---

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

Manage data sources configured in InfluxDB OSS v2.

GET`/api/v2/sources`

### List all sources

#### Parameters

##### Query parameters

`org`string

The name of the organization.

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

Example request[Ask AI about this](#)

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

#### Responses

200A list of sources

`links`object

`self`string \<uri\>

`sources`object[]

defaultUnexpected error

`code`requiredstring

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/sources`

### Create a source

#### Parameters

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

#### Request bodyrequired

Source to create

Content-Type:`application/json`

`default`boolean

`defaultRP`string

`id`string

`insecureSkipVerify`boolean

`languages`string[]

`links`object

`buckets`string

`health`string

`query`string

`self`string

`metaUrl`string \<uri\>

`name`string

`orgID`string

`password`string

`sharedSecret`string

`telegraf`string

`token`string

`type`string

Allowed:`v1`, `v2`, `self`

`url`string \<uri\>

`username`string

Example request[Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/sources" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "default": false,
  "defaultRP": "DEFAULTRP",
  "id": "ID",
  "insecureSkipVerify": false,
  "languages": [
    "example"
  ],
  "links": {},
  "metaUrl": "METAURL",
  "name": "NAME",
  "orgID": "ORGID",
  "password": "PASSWORD",
  "sharedSecret": "SHAREDSECRET",
  "telegraf": "TELEGRAF",
  "token": "TOKEN",
  "type": "v1",
  "url": "URL",
  "username": "USERNAME"
}'
```

#### Responses

201Created Source

`default`boolean

`defaultRP`string

`id`string

`insecureSkipVerify`boolean

`languages`string[]

`links`object

`buckets`string

`health`string

`query`string

`self`string

`metaUrl`string \<uri\>

`name`string

`orgID`string

`password`string

`sharedSecret`string

`telegraf`string

`token`string

`type`string

Allowed:`v1`, `v2`, `self`

`url`string \<uri\>

`username`string

defaultUnexpected error

`code`requiredstring

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/sources/{sourceID}`

### Retrieve a source

#### Parameters

##### Path parameters

`sourceID`requiredstring

The source 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/sources/{sourceID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200A source

`default`boolean

`defaultRP`string

`id`string

`insecureSkipVerify`boolean

`languages`string[]

`links`object

`buckets`string

`health`string

`query`string

`self`string

`metaUrl`string \<uri\>

`name`string

`orgID`string

`password`string

`sharedSecret`string

`telegraf`string

`token`string

`type`string

Allowed:`v1`, `v2`, `self`

`url`string \<uri\>

`username`string

404Source not found

`code`requiredstring

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.

defaultUnexpected error

`code`requiredstring

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/sources/{sourceID}`

### Update a Source

#### Parameters

##### Path parameters

`sourceID`requiredstring

The source ID.

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

#### Request bodyrequired

Source update

Content-Type:`application/json`

`default`boolean

`defaultRP`string

`id`string

`insecureSkipVerify`boolean

`languages`string[]

`links`object

`buckets`string

`health`string

`query`string

`self`string

`metaUrl`string \<uri\>

`name`string

`orgID`string

`password`string

`sharedSecret`string

`telegraf`string

`token`string

`type`string

Allowed:`v1`, `v2`, `self`

`url`string \<uri\>

`username`string

Example request[Ask AI about this](#)

```sh
curl --request PATCH \
  "http://localhost:8086/api/v2/sources/{sourceID}" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "default": false,
  "defaultRP": "DEFAULTRP",
  "id": "ID",
  "insecureSkipVerify": false,
  "languages": [
    "example"
  ],
  "links": {},
  "metaUrl": "METAURL",
  "name": "NAME",
  "orgID": "ORGID",
  "password": "PASSWORD",
  "sharedSecret": "SHAREDSECRET",
  "telegraf": "TELEGRAF",
  "token": "TOKEN",
  "type": "v1",
  "url": "URL",
  "username": "USERNAME"
}'
```

#### Responses

200Created Source

`default`boolean

`defaultRP`string

`id`string

`insecureSkipVerify`boolean

`languages`string[]

`links`object

`buckets`string

`health`string

`query`string

`self`string

`metaUrl`string \<uri\>

`name`string

`orgID`string

`password`string

`sharedSecret`string

`telegraf`string

`token`string

`type`string

Allowed:`v1`, `v2`, `self`

`url`string \<uri\>

`username`string

404Source not found

`code`requiredstring

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.

defaultUnexpected error

`code`requiredstring

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/sources/{sourceID}`

### Delete a source

#### Parameters

##### Path parameters

`sourceID`requiredstring

The source 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/sources/{sourceID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204Delete has been accepted

404View not found

`code`requiredstring

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.

defaultUnexpected error

`code`requiredstring

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/sources/{sourceID}/buckets`

### Get buckets in a source

#### Parameters

##### Path parameters

`sourceID`requiredstring

The source ID.

##### Query parameters

`org`string

The name of the organization.

##### Header parameters

`Zap-Trace-Span`string

OpenTracing span context

Example request[Ask AI about this](#)

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

#### Responses

200A source

`buckets`object[]

`links`string

404Source not found

`code`requiredstring

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.

defaultUnexpected error

`code`requiredstring

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/sources/{sourceID}/health`

### Get the health of a source

#### Parameters

##### Path parameters

`sourceID`requiredstring

The source 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/sources/{sourceID}/health" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200The source is healthy

`checks`object[]

`commit`string

`message`string

`name`requiredstring

`status`requiredstring

Allowed:`pass`, `fail`

`version`string

503The source is not healthy

`checks`object[]

`commit`string

`message`string

`name`requiredstring

`status`requiredstring

Allowed:`pass`, `fail`

`version`string

defaultUnexpected error

`code`requiredstring

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.
