Calling the API

Once you've added a base and configured access to it, you'll want to call the base API from your app.


AirQL uses OAuth to authenticate API requests. We recommend that you use an OAuth2 client implementation appropriate for your language (e.g. NextAuth.js,, etc.) with the following configuration:

Authorization endpoint

Token endpoint

Client ID

Your BASE_ID (e.g. appGSRaZVwoOoAbQB)

The access token returned by the token endpoint should be used as a bearer token in the Authorization header when calling the base API.

The base API endpoint

The GraphQL API for your base is accessible at where BASE_ID is the ID you see in Airtable URLs, e.g. appGSRaZVwoOoAbQB.

You can explore this API from the Playground tab in the AirQL UI. For more information about the shape of the base API and the playground, see GraphQL base API.

Here's an example of making a simple GraphQL query using curl. Note the that you'll need to replace YOUR_AUTH_TOKEN with a real OAuth token. The easiest way to get that is to look at the API calls made by the playground in your browser developer tools.

echo '{"query":"{ employees { records { name } } }"}' | \
  curl \
  -H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
  -H 'Content-Type: application/json' \
  -X POST -d @-

To make GraphQL API calls from a custom web app, we recommend using a library like graphql-request or

Last updated