API Reference

Available APIs

API Endpoint Access
GraphQL /v1/graphql Permission rules
Legacy GraphQL /v1alpha1/graphql Permission rules
Schema/Metadata /v1/query Admin only
Version /v1/version Public
Health /healthz Public
PG Dump /v1alpha1/pg_dump Admin only
Config /v1alpha1/config Admin only

GraphQL API

All GraphQL requests for queries, subscriptions and mutations are made to the GraphQL API.

See details at GraphQL API Reference.

Schema / metadata API

Hasura exposes a schema / metadata API for managing metadata for permissions/relationships or for directly executing SQL on the underlying Postgres.

This is primarily intended to be used as an admin API to manage the Hasura schema and metadata.

See details at Schema / Metadata API Reference.

Version API

A GET request to the public /v1/version endpoint responds with the current server version in JSON format:

{"version": "v1.0.0-alpha01"}

Health check API

A GET request to the public /healthz endpoint will respond with 200 if the GraphQL engine is ready to serve requests and there are no inconsistencies with the metadata. The response will be 500 if there are metadata inconsistencies and you should use the console or check the server logs to find out what the errors are.

pg_dump API

The /v1alpha1/pg_dump is an admin-only endpoint that can be used to execute pg_dump on the Postgres instance connected to Hasura. The pg_dump CLI tool’s argument can be passed as a POST request body to the API and the response is sent back to the client.

See details at PG Dump API Reference.

Config API

v1alpha1/config is an admin-only endpoint to get the current server configuration.

See details at Config API Reference.

Supported PostgreSQL types

You can refer to the following to know about all PostgreSQL types supported by the Hasura GraphQL engine: