The Vector API
Vector ships with a GraphQL API that allows you to interact with a running Vector instance. This page covers how to configure and enable Vector’s API.
Configuration
address
common optional string literalThe 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
enabled
common optional boolWhether the GraphQL API is enabled for this Vector instance.
default:
false
graphql
common optional boolWhether the endpoint for receiving and processing GraphQL queries is
enabled for the API. The endpoint is accessible via the
/graphql
endpoint of the address set using the bind
parameter.default:
true
playground
optional boolWhether the GraphQL Playground is enabled
for the API. The Playground is accessible via the
/playground
endpoint
of the address set using the bind
parameter. Note that the playground
endpoint will only be enabled if the graphql
endpoint is also enabled.default:
true
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 enables you
to explore the available queries and manually
run queries.
Responses
Code
Description
200
Vector is initialized and running.
How it works
GraphQL
Vector chose GraphQL for its API because GraphQL is self-documenting and type safe. We believe that 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.