Sources

Download InfluxDB API Spec
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
curl --request GET \
  "http://localhost:8086/api/v2/sources" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

200 A list of sources
links object
self string <uri>
sources object[]
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
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/sources

Create a source

Parameters

Header parameters
Zap-Trace-Span string
OpenTracing span context

Request body required

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
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": [
    "flux"
  ],
  "links": {
    "buckets": "BUCKETS",
    "health": "HEALTH",
    "query": "QUERY",
    "self": "SELF"
  },
  "metaUrl": "METAURL",
  "name": "NAME",
  "orgID": "ORGID",
  "password": "PASSWORD",
  "sharedSecret": "SHAREDSECRET",
  "telegraf": "TELEGRAF",
  "token": "TOKEN",
  "type": "v1",
  "url": "URL",
  "username": "USERNAME"
}'

Responses

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

Retrieve a source

Parameters

Path parameters
sourceID required string
The source ID.
Header parameters
Zap-Trace-Span string
OpenTracing span context
Example request Ask AI about this
curl --request GET \
  "http://localhost:8086/api/v2/sources/{sourceID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

200 A 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
404 Source 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.
PATCH /api/v2/sources/{sourceID}

Update a Source

Parameters

Path parameters
sourceID required string
The source ID.
Header parameters
Zap-Trace-Span string
OpenTracing span context

Request body required

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
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": [
    "flux"
  ],
  "links": {
    "buckets": "BUCKETS",
    "health": "HEALTH",
    "query": "QUERY",
    "self": "SELF"
  },
  "metaUrl": "METAURL",
  "name": "NAME",
  "orgID": "ORGID",
  "password": "PASSWORD",
  "sharedSecret": "SHAREDSECRET",
  "telegraf": "TELEGRAF",
  "token": "TOKEN",
  "type": "v1",
  "url": "URL",
  "username": "USERNAME"
}'

Responses

200 Created 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
404 Source 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.
DELETE /api/v2/sources/{sourceID}

Delete a source

Parameters

Path parameters
sourceID required string
The source ID.
Header parameters
Zap-Trace-Span string
OpenTracing span context
Example request Ask AI about this
curl --request DELETE \
  "http://localhost:8086/api/v2/sources/{sourceID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

204 Delete has been accepted
404 View 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/sources/{sourceID}/buckets

Get buckets in a source

Parameters

Path parameters
sourceID required string
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
curl --request GET \
  "http://localhost:8086/api/v2/sources/{sourceID}/buckets" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

200 A source
buckets object[]
createdAt string <date-time>
description string
id string
labels object[]
id string
name string
orgID string
properties object
Key-value pairs associated with this label. To remove a property, send an update with an empty value ("") for the key.
Example: {"color":"ffb3b3","description":"this is a description"}
links object
Example: {"labels":"/api/v2/buckets/1/labels","members":"/api/v2/buckets/1/members","org":"/api/v2/orgs/2","owners":"/api/v2/buckets/1/owners","self":"/api/v2/buckets/1","write":"/api/v2/write?org=2\u0026bucket=1"}
labels string <uri>
URI of resource.
members string <uri>
URI of resource.
org string <uri>
URI of resource.
owners string <uri>
URI of resource.
self string <uri>
URI of resource.
write string <uri>
URI of resource.
name required string
orgID string
retentionRules required object[]

Retention rules to expire or retain data. The InfluxDB /api/v2 API uses RetentionRules to configure the retention period.

InfluxDB Cloud

  • retentionRules is required.

InfluxDB OSS

  • retentionRules isn’t required.
everySeconds required integer <int64>
The duration in seconds for how long data will be kept in the database. The default duration is 2592000 (30 days). 0 represents infinite retention.
Default: 2592000
Example: 86400
shardGroupDurationSeconds integer <int64>

The shard group duration. The duration or interval (in seconds) that each shard group covers.

InfluxDB Cloud

  • Does not use shardGroupDurationsSeconds.

InfluxDB OSS

type string
Allowed: expire
Default: expire
rp string
schemaType string
Allowed: implicit , explicit
type string
Allowed: user , system
Default: user
updatedAt string <date-time>
links object
URI pointers for additional paged results.
next string <uri>
URI of resource.
prev string <uri>
URI of resource.
self required string <uri>
URI of resource.
404 Source 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/sources/{sourceID}/health

Get the health of a source

Parameters

Path parameters
sourceID required string
The source ID.
Header parameters
Zap-Trace-Span string
OpenTracing span context
Example request Ask AI about this
curl --request GET \
  "http://localhost:8086/api/v2/sources/{sourceID}/health" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

200 The source is healthy
checks object[]
checks object[]
checks object[]
commit string
message string
name required string
status required string
Allowed: pass , fail
version string
commit string
message string
name required string
status required string
Allowed: pass , fail
version string
commit string
message string
name required string
status required string
Allowed: pass , fail
version string
503 The source is not healthy
checks object[]
checks object[]
checks object[]
commit string
message string
name required string
status required string
Allowed: pass , fail
version string
commit string
message string
name required string
status required string
Allowed: pass , fail
version string
commit string
message string
name required string
status required string
Allowed: pass , fail
version 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.

Was this page helpful?

Thank you for your feedback!