Your Keel backend exposes three types of API - GraphQL, JSON, and JSON-RPC. When running Keel locally using
keel run you can make requests to your API at
http://localhost:8000 and for deployed environments you'll find the domain on the Overview page in the console.
GraphQL (opens in a new tab) is an open-source data query language that allows clients to specify the data they need from the API. It also allows querying data across relational data models, meaning that you can do in one API call what might otherwise require several.
When running locally with
keel run you can also access a GraphiQL (opens in a new tab) playground at
OpenAPI (opens in a new tab) is an open-source specification for describing JSON APIs. It describes which endpoints are available and the data-type's of the requests and responses. There are many open source libraries for generating clients from an OpenAPI spec and you can download the OpenAPI (v3.1) definitions for your JSON API from the API Explorer in the console or from the
/api/json/openapi.json endpoint of your Keel app.
We support these different types of endpoints to give you flexibility in how to connect to your Keel app. If you are building a web frontend and have used GraphQL before or want to be able to load lots of relational data in one request, then GraphQL may be a good choice.
If you want a simpler option with a more standard request/response pattern then the JSON API might be more for you.
In the future you'll be able to generate a fully-typed client for your API using the Keel CLI.
All API endpoints use the same JWT-based authentication. First you need to get a JWT (JSON Web Token) by calling the built-in
authenticate action. You can then pass this JWT in the
Authorization header on all subsequent requests.
Authorization: Bearer <JWT token>
See the individual API docs for examples.