Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

InfluxDB Invokable Scripts API

Store, manage, and execute scripts in InfluxDB.A script stores your custom Flux script and provides an invokableendpoint that accepts runtime parameters.In a script, you can specify custom runtime parameters(`params`)--for example, `params.myparameter`.Once you create a script, InfluxDB generates an[`/api/v2/scripts/SCRIPT_ID/invoke` endpoint](#operation/PostScriptsIDInvoke)for your organization.You can run the script from API requests and tasks, defining parametervalues for each run.When the script runs, InfluxDB replaces `params` references in thescript with the runtime parameter values you define.Use the `/api/v2/scripts` endpoints to create and manage scripts.See related guides to learn how to define parameters and execute scripts.### Related guides- [Invoke custom scripts](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/) from API requests.- [Create a task that references a script](https://docs.influxdata.com/influxdb/cloud/process-data/manage-tasks/create-task/#create-a-task-that-references-a-script)

InfluxDB Invokable Scripts API is one of 40 APIs that InfluxDB publishes on the APIs.io network, described by a machine-readable OpenAPI specification and an AsyncAPI event-driven specification.

Tagged areas include Invokable Scripts. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, an AsyncAPI specification, authentication docs, and a getting-started guide.

This API exposes 7 operations across 4 paths, and defines 10 schemas. It is described by OpenAPI 3.0.0.

Requests are made against the base URL https://cloud2.influxdata.com/api/v2.

7 operations 4 paths 10 schemas 1 DELETE3 GET1 PATCH2 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.0.0
Base URL
https://cloud2.influxdata.com/api/v2
Authentication
HTTP Basic, API Key
Resource Areas
1

Authentication & Security 2

InfluxDB Invokable Scripts API declares 2 security schemes for authenticating requests. It accepts HTTP basic authentication (BasicAuthentication). An API key is passed in the header as Authorization (TokenAuthentication). By default, every request must be authenticated.

  • BasicAuthentication — Basic authentication scheme Use the HTTP Basic authentication scheme for InfluxDB /api/v2 API operations that support it: Syntax Authorization: Basic BASE64ENC…
  • TokenAuthentication — Use the [Token authentication](section/Authentication/TokenAuthentication) scheme to authenticate to the InfluxDB API. In your API requests, send an Authorizat…

Paths & Operations 7

Across 4 paths, the API surfaces 7 operations — 1 DELETE, 3 GET, 1 PATCH, 2 POST. Each is listed below with its method, path, parameters, and response codes.

Invokable Scripts 7

Store, manage, and execute scripts in InfluxDB. A script stores your custom Flux script and provides an invokable endpoint that accepts runtime parameters. In a script, you can sp…

GET
/api/v2/scripts
List scripts
GetScripts 3 params → 200400401500default
POST
/api/v2/scripts
Create a script
PostScripts body → 201400401422500default
DELETE
/api/v2/scripts/{scriptID}
Delete a script
DeleteScriptsID 1 param → 204401500default
GET
/api/v2/scripts/{scriptID}
Retrieve a script
GetScriptsID 1 param → 200401404500default
PATCH
/api/v2/scripts/{scriptID}
Update a script
PatchScriptsID 1 param body → 200401404500default
POST
/api/v2/scripts/{scriptID}/invoke
Invoke a script
PostScriptsIDInvoke 1 param body → 200400401404500default
GET
/api/v2/scripts/{scriptID}/params
Find script parameters.
GetScriptsIDParams 1 param → 200401404500default

Schemas 10

The contract defines 10 schemas that model the data the API accepts and returns. The most detailed are Script (9 properties), Error (4 properties), ScriptCreateRequest (4 properties), ScriptUpdateRequest (2 properties). Each schema is shown below with its type and property counts.

ScriptHTTPResponseData
string
The response body contains the results of the executed script. The response is user-defined and dynamic.
Script
object
9 properties 3 required
ScriptLanguage
string
ScriptUpdateRequest
object
2 properties
ErrorCode
string
code is the machine-readable error code.
ScriptInvocationParams
object
1 property
Scripts
object
1 property
Params
object
1 property
ScriptCreateRequest
object
4 properties 4 required
Error
object
4 properties 1 required

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

influxdb-invokable-scripts-api-openapi.yml Raw ↑

Other APIs InfluxDB publishes across the network.

InfluxDB Authorizations (API tokens) API
InfluxDB Bucket Schemas API
InfluxDB Buckets API
InfluxDB Cells API
InfluxDB Checks API
InfluxDB Config API
InfluxDB Dashboards API
InfluxDB Data I/O endpoints API
InfluxDB DBRPs API
InfluxDB Delete API
InfluxDB Labels API
InfluxDB Legacy Authorizations API