# Airtable

### Overview

The Stacksync Airtable API Proxy provides centralized access to Airtable APIs through a single HTTPS endpoint.\
You authenticate with your Stacksync service token. Stacksync manages the underlying Airtable OAuth connection.

Use it for on‑demand operational tasks and low‑volume reads/writes.\
For continuous, high‑volume sync, use Stacksync Syncs instead.

Operations:

* [Pass Through](#pass-through)
* Attachements

### Pass Through

The Airtable Pass Through operation is the primary way to interact with Airtable through the Stacksync API Proxy. It lets you invoke any Airtable API endpoint that supports your configured authentication by specifying the full Airtable URL, HTTP method, and optional request body.

Use this operation for all Airtable use cases, including working with bases, tables, records, views, and custom fields, as well as newly released endpoints. Authentication and routing are managed by Stacksync, so your services, scripts, and internal tools can call Airtable securely with a single integration pattern, without embedding Airtable credentials or implementing authentication flows in each system.

```bash
curl -X [GET | POST | PUT | PATCH | DELETE] \
  https://eu.api-proxy.stacksync.com/v1/proxy/INSERT_REQUEST_URL_HERE \
  -H "Authorization: Bearer your_api_proxy_service_token" \
  -d 'Optional'
```

#### Example request

**Read records from a table**

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.airtable.com/v0/<baseId>/<tableId>?maxRecords=5&view=Grid%20view" \
  -H "Authorization: Bearer your_api_proxy_service_token"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.airtable.com/v0/<baseId>/<tableId>?maxRecords=5&view=Grid%20view"

headers = {
    "Authorization": "Bearer your_api_proxy_service_token",
}

response = requests.get(url, headers=headers)
print(response.json())
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const url =
  "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.airtable.com/v0/<baseId>/<tableId>?maxRecords=5&view=Grid%20view";

fetch(url, {
  method: "GET",
  headers: {
    Authorization: "Bearer your_api_proxy_service_token",
  },
})
  .then((r) => r.json())
  .then((json) => console.log(json))
  .catch((e) => console.error(e));
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.airtable.com/v0/<baseId>/<tableId>?maxRecords=5&view=Grid%20view" \
  -H "Authorization: Bearer your_api_proxy_service_token"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.airtable.com/v0/<baseId>/<tableId>?maxRecords=5&view=Grid%20view"

headers = {
    "Authorization": "Bearer your_api_proxy_service_token",
}

response = requests.get(url, headers=headers)
print(response.json())
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const url =
  "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.airtable.com/v0/<baseId>/<tableId>?maxRecords=5&view=Grid%20view";

fetch(url, {
  method: "GET",
  headers: {
    Authorization: "Bearer your_api_proxy_service_token",
  },
})
  .then((r) => r.json())
  .then((json) => console.log(json))
  .catch((e) => console.error(e));
```

{% endtab %}
{% endtabs %}

#### Example response

```json
{
  "records": [
    {
      "id": "recXXXXXXXXXXXXXX",
      "createdTime": "2023-07-28T15:01:14.000Z",
      "fields": {
        "Name": "Sample Record 1",
        "Status": "In Progress",
        "Email": "sample1@example.com",
        "Amount": 1000,
        "Due Date": "2024-07-31",
        "Tags": ["Important", "Client"]
      }
    },
    {
      "id": "recYYYYYYYYYYYYYY",
      "createdTime": "2024-07-28T15:19:21.000Z",
      "fields": {
        "Name": "Sample Record 2",
        "Status": "Completed",
        "Email": "sample2@example.com",
        "Amount": 4000,
        "Due Date": "2024-07-25",
        "Tags": ["Important", "Partner"]
      }
    }
  ],
  "offset": "itrXXXXXXXXXXXXXX"
}
```

### Attachements

Airtable provides signed URLs for attachments that expire after approximately 2 hours. This endpoint solves that problem by providing persistent URLs that automatically redirect to fresh Airtable-signed URLs.

This is to be used along a Stacksync syncs, more details [here](https://docs.stacksync.com/two-way-sync/connectors/airtable/attachments-fields).

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET "https://eu.api-proxy.stacksync.com/v1/airtable_attachment?dt=eyJiYXNlX2lXUGdEIiwgInBhdGgiOiAiIn0=" \
  -H "Authorization: Bearer your_api_proxy_service_token"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.airtable.com/v0/<baseId>/<tableId>?maxRecords=5&view=Grid%20view"

headers = {
    "Authorization": "Bearer your_api_proxy_service_token",
}

response = requests.get(url, headers=headers)
print(response.json())
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const url =
  "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.airtable.com/v0/<baseId>/<tableId>?maxRecords=5&view=Grid%20view";

fetch(url, {
  method: "GET",
  headers: {
    Authorization: "Bearer your_api_proxy_service_token",
  },
})
  .then((r) => r.json())
  .then((json) => console.log(json))
  .catch((e) => console.error(e));
```

{% endtab %}
{% endtabs %}

The API proxy will then:

* Fetch the current attachment URL from Airtable
* Redirect you to the updated link automatically


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stacksync.com/api-proxy/airtable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
