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

[api]
enabled = false # optional, default
address = "127.0.0.1:8686" # optional, default
playground = true # optional, default
  • commonoptionalstring

    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
  • commonoptionalbool

    enabled

    Whether the GraphQL API is enabled for this Vector instance.

    • Default: false
    • View examples
  • optionalbool

    playground

    Whether the GraphQL Playground is enabled for the API. The Playground is accessible via the /playground endpoint of the address set using the bind parameter.

    • Default: true
    • View examples

Endpoints

POST /graphql

Main endpoint for receiving and processing GraphQL queries.

Responses

CodeDescription
200The 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

CodeDescription
200Vector 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

CodeDescription
200Vector 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.