Application Programming Interface (API)
Vector ships with a GraphQL API that allows you to interact with a running Vector instances. This page will cover how to configuration and enable Vector's API.
Configuration
- vector.toml
- vector.yaml
- vector.json
[api]enabled = false # optional, defaultaddress = "127.0.0.1:8686" # optional, defaultplayground = true # optional, default
- optionalstring
address
The network address to which the API should bind. If you're running Vector in a Docker container, make sure to bind to
0.0.0.0
. Otherwise the API will not be exposed outside the container.- Default:
"127.0.0.1:8686"
- View examples
- Default:
- optionalbool
enabled
Whether the GraphQL API is enabled for this Vector instance.
- Default:
false
- View examples
- Default:
- optionalbool
playground
Whether the GraphQL Playground is enabled for the API. The Playground is accessible via the
/playground
endpoint of the address set using thebind
parameter.- Default:
true
- View examples
- Default:
Endpoints
POST /graphql
Main endpoint for receiving and processing GraphQL queries.
Responses
Code | Description |
---|---|
200 | The query has been processed. GraphQL returns 200 regardless if the query was successful or not. This is due to the fact that queries can partially fail. Please check for the errors key to determine if there were any errors in your query. |
GET /health
Healthcheck endpoint. Useful to verify that Vector is up and running.
Responses
Code | Description |
---|---|
200 | Vector is initialized and running. |
GET /playground
A bundled GraphQL playground that allows you to explore the available queries and manually run queries.
We offer a public playground that you can explore without hosting your own Vector instance.
Responses
Code | Description |
---|---|
200 | Vector is initialized and running. |
How it works
GraphQL
Vector chosoe Graphql for it's API due to the self-documenting and type safe nature. We beleive this offers a superior client experience and makes Vector richly programmable through its API.
Playground
Vector's GraphQL API ships with a built-in playground that allows you to explore
the available commands and manually run queries against the API. This can be
accessed at the /playground
path. We also offer a
public playground that you can explore without
hosting your own Vector instance.