Skip to main content
Version: v2.x

API Reference | General Info

Available APIs

APIEndpointAccess
GraphQL/v1/graphqlPermission rules
Relay/v1beta1/relayPermission rules
Legacy GraphQL/v1alpha1/graphqlPermission rules
Schema (> v2.0)/v2/queryAdmin only
Metadata (> v2.0)/v1/metadataAdmin only
Schema/Metadata (deprecated)/v1/queryAdmin only
Restified GQL/api/restGQL REST Routes
Version/v1/versionPublic
Health/healthzPublic
PG Dump/v1alpha1/pg_dumpAdmin only
Config/v1alpha1/configAdmin only
Explain/v1/graphql/explainAdmin only

GraphQL API

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

See details at GraphQL API Reference.

Relay API

Hasura exposes a Relay schema for GraphQL requests for queries, subscriptions and mutations.

See docs at Postgres: Relay schema.

See details at Relay GraphQL API Reference.

Schema API

Hasura exposes a schema API for directly executing SQL on the underlying Postgres.

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

See details at Schema API Reference.

Metadata API

Hasura exposes a Metadata API for managing metadata.

This is primarily intended to be used as an admin API to manage the Hasura Metadata.

See details at Metadata API Reference.

Schema / Metadata API (Deprecated)

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 (Deprecated).

RESTified GraphQL API

Hasura allows saved GraphQL queries and mutations to be accessed through a REST interface.

See details at RESTified GraphQL Endpoints API Reference.

Version API

The /v1/version is a public endpoint that responds with the current server version in JSON format.

See details at Version API Reference.

Health Check API

The /healthz is a public endpoint that returns the server health status. There's also /hasura/healthz available as an alternative, which mirrors /healthz completely.

See details at Health Check API Reference.

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.

Explain API

v1/graphql/explain returns the Postgres plan for a query or subscription based on the defined permissions.

See details at Explain API Reference.