Marketplace

api

Use the Glide API for programmatic data operations - REST API v2 and @glideapps/tables npm package. Use when importing data, bulk operations, automating data sync, or building integrations with Glide tables.

$ Instalar

git clone https://github.com/glideapps/glide-code /tmp/glide-code && cp -r /tmp/glide-code/glide/skills/api ~/.claude/skills/glide-code

// tip: Run this command in your terminal to install the skill


name: api description: | Use the Glide API for programmatic data operations - REST API v2 and @glideapps/tables npm package. Use when importing data, bulk operations, automating data sync, or building integrations with Glide tables.

Glide API

API Overview

Two Ways to Access Data

  1. REST API v2 - Direct HTTP calls to api.glideapps.com
  2. @glideapps/tables - Official npm package (simpler for JavaScript/TypeScript)

Important Limitations

  • Big Tables Only: API v2 only works with Glide Big Tables, not native app tables
  • Team Scope: API operates at team level, not app level
  • Quota Costs: Read/write operations consume updates from your plan

Getting Your API Token

  1. Open any app in Glide Builder
  2. Go to Data tab
  3. Click Show API button (bottom of data grid)
  4. Click Copy secret token

Store token securely - never commit to version control.

REST API v2

Base URL

https://api.glideapps.com/

Authentication

Authorization: Bearer YOUR_API_TOKEN

Endpoints

MethodEndpointDescription
GET/tablesList all Big Tables
POST/tablesCreate new Big Table
GET/tables/{tableID}/rowsGet rows
GET/tables/{tableID}/rows/{rowID}Get single row
HEAD/tables/{tableID}/rowsGet table version
POST/tables/{tableID}/rowsAdd rows
PATCH/tables/{tableID}/rows/{rowID}Update row
PUT/tables/{tableID}Overwrite table
DELETE/tables/{tableID}/rows/{rowID}Delete row

Example: List Tables

curl -X GET "https://api.glideapps.com/tables" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example: Get Rows

curl -X GET "https://api.glideapps.com/tables/TABLE_ID/rows" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example: Create Table

Create a new Big Table with schema and initial data. See official docs.

curl -X POST "https://api.glideapps.com/tables" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Contacts",
    "appsToLink": ["APP_ID_HERE"],
    "schema": {
      "columns": [
        {"id": "fullName", "displayName": "Full Name", "type": "string"},
        {"id": "email", "displayName": "Email", "type": "string"},
        {"id": "photo", "displayName": "Photo", "type": "uri"},
        {"id": "createdAt", "displayName": "Created", "type": "dateTime"}
      ]
    },
    "rows": [
      {
        "fullName": "Alex Bard",
        "email": "alex@example.com",
        "photo": "https://randomuser.me/api/portraits/men/32.jpg",
        "createdAt": "2024-07-29T14:04:15.561Z"
      }
    ]
  }'

Response:

{
  "data": {
    "tableID": "2a1bad8b-cf7c-44437-b8c1-e3782df6",
    "rowIDs": ["zcJWnyI8Tbam21V34K8MNA"],
    "linkedAppIDs": ["APP_ID_HERE"]
  }
}

Column Types for Schema:

TypeDescription
stringText data
numberNumeric values
dateTimeISO 8601 dates
uriURLs (images, links)
booleanTrue/false

Key Points:

  • appsToLink: Array of app IDs to automatically link the table to
  • schema.columns: Each has id (used in row data), displayName (shown in UI), type
  • rows: Use column id values as keys, NOT displayName

Example: Add Rows

Use column IDs (not display names) as keys. Column IDs are defined in the schema when creating the table.

curl -X POST "https://api.glideapps.com/tables/TABLE_ID/rows" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rows": [
      {"fullName": "Alice", "email": "alice@example.com"},
      {"fullName": "Bob", "email": "bob@example.com"}
    ]
  }'

Example: Update Row

curl -X PATCH "https://api.glideapps.com/tables/TABLE_ID/rows/ROW_ID" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Name"
  }'

Example: Delete Row

curl -X DELETE "https://api.glideapps.com/tables/TABLE_ID/rows/ROW_ID" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

@glideapps/tables Package

Installation

npm install @glideapps/tables

Setup

import * as glide from "@glideapps/tables";

const myTable = glide.table({
  token: "YOUR_API_TOKEN",
  app: "APP_ID",           // Optional for Big Tables
  table: "TABLE_ID",
  columns: {
    name: { type: "string", name: "Name" },
    email: { type: "email-address", name: "Email" },
    photo: { type: "image-uri", name: "Photo" },
    active: { type: "boolean", name: "Active" }
  }
});

Column Types

TypeDescription
stringText
numberNumeric
booleanTrue/False
date-timeDate and time
image-uriImage URL
email-addressEmail
phone-numberPhone
uriURL

Get Rows

// Get all rows
const rows = await myTable.get();

// With query parameters
const filtered = await myTable.get({
  where: { active: true },
  limit: 10
});

Add Rows

// Add single row
await myTable.add({
  name: "Alice",
  email: "alice@example.com"
});

// Add multiple rows
await myTable.add([
  { name: "Alice", email: "alice@example.com" },
  { name: "Bob", email: "bob@example.com" }
]);

Update Row

await myTable.update(rowId, {
  name: "Updated Name"
});

Delete Row

await myTable.delete(rowId);

Data Versioning

The API supports optimistic locking via ETags:

# Get current version
HEAD /tables/{tableID}/rows

# Update with version check
PATCH /tables/{tableID}/rows/{rowID}
If-Match: "version-etag"

If the version has changed, you'll get HTTP 412 Precondition Failed.

Pricing

OperationCost
Write (per row)0.01 updates
Read (per row)0.001 updates
List tablesFree
Get versionFree

Additional updates beyond quota: $0.02 each

Best Practices

  1. Use Big Tables for API access - native tables aren't supported
  2. Batch operations - Add multiple rows in one call
  3. Use versioning - Prevent data conflicts with If-Match
  4. Cache tokens - Don't request new tokens repeatedly
  5. Handle errors - Check for 4xx/5xx responses
  6. Respect rate limits - Don't hammer the API

Common Patterns

Sync External Data to Glide

import * as glide from "@glideapps/tables";

const targetTable = glide.table({
  token: process.env.GLIDE_TOKEN,
  table: "my-big-table-id",
  columns: {
    externalId: { type: "string", name: "External ID" },
    name: { type: "string", name: "Name" },
    updatedAt: { type: "date-time", name: "Updated At" }
  }
});

async function syncData(externalData) {
  // Get existing rows
  const existing = await targetTable.get();
  const existingMap = new Map(existing.map(r => [r.externalId, r]));

  // Process updates and inserts
  const toAdd = [];
  for (const item of externalData) {
    if (!existingMap.has(item.id)) {
      toAdd.push({
        externalId: item.id,
        name: item.name,
        updatedAt: new Date().toISOString()
      });
    }
  }

  if (toAdd.length > 0) {
    await targetTable.add(toAdd);
  }
}

Bulk Import from CSV

import * as glide from "@glideapps/tables";
import { parse } from "csv-parse/sync";
import fs from "fs";

const table = glide.table({
  token: process.env.GLIDE_TOKEN,
  table: "target-table-id",
  columns: {
    col1: { type: "string", name: "Column 1" },
    col2: { type: "string", name: "Column 2" }
  }
});

const csvContent = fs.readFileSync("data.csv", "utf-8");
const records = parse(csvContent, { columns: true });

// Batch in chunks of 100
const chunkSize = 100;
for (let i = 0; i < records.length; i += chunkSize) {
  const chunk = records.slice(i, i + chunkSize);
  await table.add(chunk.map(r => ({
    col1: r["Column 1"],
    col2: r["Column 2"]
  })));
}

Documentation