Getting started overview
To begin using Airtable programmatically, developers primarily interact with its REST API. This API allows for the creation, reading, updating, and deletion (CRUD) of records within an Airtable base. The core components for initiating this interaction are an Airtable account, a personal access token for authentication, and the specific IDs for the base and table you intend to access.
Airtable structures data within bases, which are analogous to entire databases, and within each base, data is organized into tables, similar to spreadsheet tabs or database tables. Each table consists of records, which are individual rows, and these records have fields, representing columns. Understanding this hierarchy is fundamental to constructing correct API requests, as each request targets a specific base and table.
The developer experience with Airtable's API is supported by comprehensive documentation and an official JavaScript SDK, which abstracts some of the HTTP request complexities. While the JavaScript SDK is available, direct curl requests or other HTTP clients can also be used, offering flexibility for various programming environments. For a detailed reference on available API endpoints and parameters, consult the Airtable Web API introduction.
Create an account and get keys
Accessing the Airtable API requires an active account and appropriate authentication credentials. The process involves signing up for an Airtable account, creating a base, and then generating a personal access token.
1. Sign up for an Airtable account
If you do not already have an Airtable account, navigate to the Airtable homepage and complete the registration process. Airtable offers a free plan which is sufficient for initial API exploration and development. This plan allows you to create bases and tables to experiment with API calls without cost. For details on available plans, refer to the Airtable pricing page.
2. Create a base and table
After creating an account, log in and create a new base. Within this base, create at least one table. For example, you might create a base named "My First API Project" and a table named "Tasks" with fields like "Task Name" (Single line text), "Status" (Single select: To Do, In Progress, Done), and "Due Date" (Date). Populate this table with a few sample records; for instance, "Buy groceries" (To Do), "Write API docs" (In Progress).
To find your Base ID, navigate to your base in the Airtable web interface. The Base ID is part of the URL. For example, in a URL like https://airtable.com/appXXXXXXXXXXXXX/tblYYYYYYYYYYYYY/viwZZZZZZZZZZZZZ, appXXXXXXXXXXXXX is your Base ID. Similarly, the Table ID (tblYYYYYYYYYYYYY) can often be found in the URL when viewing a specific table, or by using the Airtable API playground tool for your base, which explicitly lists base and table IDs.
3. Generate a Personal Access Token
Airtable uses Personal Access Tokens (PATs) for API authentication. These tokens grant granular permissions to specific bases and scopes. To generate a PAT:
- Log in to Airtable.
- Navigate to your developer hub tokens page.
- Click "Create new token".
- Provide a descriptive name for your token (e.g., "API Spine Tutorial Token").
- Define the Scopes: For initial read/write access to a table, you will need at least
data.records:readanddata.records:writepermissions for the specific base. You might also addschema.bases:readif you plan to inspect your base's schema programmatically. - Select the Access: Choose "All current and future bases in this workspace" for broad access, or "Add a base" to specify only the base you created for this tutorial.
- Click "Create token".
- Copy the generated token immediately. It will only be shown once. Treat this token like a password; do not expose it in client-side code or public repositories.
This token will be used in the Authorization header of your API requests, prefixed with Bearer.
Your first request
With an account, a base, and a personal access token, you are ready to make your first API call. This example demonstrates how to retrieve records from a table using curl, a common command-line tool for making HTTP requests. Remember to replace placeholder values with your actual Base ID, Table ID, and Personal Access Token.
Prerequisites:
- Your Airtable Personal Access Token (e.g.,
patXXXXXXXXXXXXXXXX) - Your Base ID (e.g.,
appYYYYYYYYYYYYY) - Your Table ID or Name (e.g.,
tblZZZZZZZZZZZZZor "Tasks")
Example: List records from a table
To list all records from your "Tasks" table within your "My First API Project" base, use the following curl command. Ensure your token has data.records:read scope for the target base.
curl -X GET \
"https://api.airtable.com/v0/appYYYYYYYYYYYYY/tblZZZZZZZZZZZZZ" \
-H "Authorization: Bearer patXXXXXXXXXXXXXXXX"
In this example:
appYYYYYYYYYYYYYshould be replaced with your actual Base ID.tblZZZZZZZZZZZZZshould be replaced with your actual Table ID. You can also use the Table Name (e.g.,Tasks), but using the Table ID is generally more robust for programmatic access as names can change.patXXXXXXXXXXXXXXXXshould be replaced with your generated Personal Access Token.
A successful response will return a JSON object containing an array of records from your table. Each record will include an id, createdTime, and a fields object containing the data from your table's columns.
{
"records": [
{
"id": "recAAAAAAAAAAAAAA",
"createdTime": "2026-05-29T12:00:00.000Z",
"fields": {
"Task Name": "Buy groceries",
"Status": "To Do"
}
},
{
"id": "recBBBBBBBBBBBBBB",
"createdTime": "2026-05-29T12:05:00.000Z",
"fields": {
"Task Name": "Write API docs",
"Status": "In Progress"
}
}
],
"offset": "itrCCCCCCCCCCCC"
}
If you encounter an error, verify your token, Base ID, Table ID, and ensure the token has the necessary read permissions. For more example requests, refer to the Airtable API documentation.
Common next steps
After successfully making your first API call, you can explore more advanced interactions and integrations:
-
Create, Update, and Delete Records: Experiment with the POST, PATCH, and DELETE methods to manage your data programmatically. For example, to create a new task, you would send a POST request to the same endpoint with a JSON body containing the new record's fields.
curl -X POST \ "https://api.airtable.com/v0/appYYYYYYYYYYYYY/tblZZZZZZZZZZZZZ" \ -H "Authorization: Bearer patXXXXXXXXXXXXXXXX" \ -H "Content-Type: application/json" \ --data '{"records":[{"fields":{"Task Name":"Schedule meeting","Status":"To Do"}}]}' - Use the JavaScript SDK: For web applications, consider using the official Airtable JavaScript SDK. It simplifies API interactions and handles authentication and request formatting for you. This can be particularly useful for building client-side applications that interact with Airtable.
-
Explore Advanced Query Parameters: The Airtable API supports various parameters for filtering, sorting, and selecting specific fields in your requests. This allows you to retrieve precisely the data you need, optimizing API usage. Examples include
filterByFormula,sort, andfieldsparameters, as detailed in the Airtable retrieve records guide. - Webhooks and Automation: For real-time updates and integrations, investigate Airtable's webhook capabilities. Webhooks allow external systems to be notified when changes occur in your Airtable bases, enabling powerful automation workflows. You can configure webhooks to trigger external services, as described in the Airtable webhooks documentation.
- Integrate with other services: Airtable's API can be integrated with various other platforms. For example, you might connect it with a communication platform like Twilio for sending SMS notifications based on Airtable data, or with a payment processor like Stripe for managing customer subscriptions. For broader API integration patterns, resources like Microsoft's API Gateway pattern guide can provide architectural insights.
Troubleshooting the first call
When making your initial API request, several common issues can arise. Reviewing these points can help diagnose and resolve problems quickly.
| Issue | Possible Cause | Resolution |
|---|---|---|
AUTHENTICATION_REQUIRED (401 Unauthorized) |
Missing or incorrect Personal Access Token. | Ensure the Authorization: Bearer patXXXXXXXXXXXXXXXX header is correctly included and the token is valid. Verify there are no typos in the token string. |
NOT_FOUND (404 Not Found) |
Incorrect Base ID or Table ID/Name in the URL. | Double-check your Base ID (appXXXXXXXXXXXXX) and Table ID (tblYYYYYYYYYYYYY) against the values found in your Airtable interface or the Airtable API Playground. Remember that Table IDs are more reliable than names. |
PERMISSION_DENIED (403 Forbidden) |
Personal Access Token lacks necessary permissions (scopes). | Review the scopes assigned to your Personal Access Token. For reading records, the token must have at least data.records:read permissions for the specific base. If you need to write, update, or delete, ensure data.records:write and corresponding delete scopes are granted. |
Empty records array in response |
No records in the specified table, or filter is too restrictive. | Check your Airtable table to ensure it contains data. If using filtering parameters (e.g., filterByFormula), temporarily remove them to see if records are returned. |
| CORS errors (in browser development) | Browser security preventing cross-origin requests. | Airtable's API supports CORS. Ensure your client-side application is making requests correctly. For development, consider using a proxy or a local development server that handles CORS. This is typically not an issue for server-side or curl requests. |
| Invalid JSON in POST/PATCH request | Malformed JSON body when creating or updating records. | Ensure your request body for POST/PATCH operations is valid JSON and adheres to the expected structure (e.g., {"records":[{"fields":{"Field Name":"Value"}}]}). Verify field names exactly match those in your Airtable table, including capitalization. |
For persistent issues, consult the Airtable support documentation or the Airtable developer community forums.