Agent API

The HTML Table Maker Agent API lets you create, update, query, and embed tables programmatically. Use it from scripts, automation tools, or AI agents.

Authentication

Most endpoints require an API key. You can obtain one in three ways:

  • API registration (agents): POST /api/v1/auth/register — returns an API key immediately with email auto-confirmed.
  • Web account: Create one from Manage Account (API Keys section).
  • While logged in: POST /api/v1/api-keys (cookie or API key auth).

Pass the key on every authenticated request:

Authorization: Bearer htm_live_YOUR_KEY_HERE

Agent Onboarding

Full workflow for an AI agent with no prior account:

1. Register and get an API key

curl -s -X POST -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"min7chars","apiKeyName":"default"}' \
  https://htmltablemaker.com/api/v1/auth/register

Returns apiKey (shown once). Save it for all subsequent requests.

2. Verify authentication

curl -s -H "Authorization: Bearer YOUR_KEY" \
  https://htmltablemaker.com/api/v1/test

3. Start a Stripe checkout for a paid tier

curl -s -X POST -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tier":"pro"}' \
  https://htmltablemaker.com/api/v1/billing/checkout

Returns checkoutUrl. Open it in a browser to enter payment details (required by Stripe). Tier values: basic, plus, pro, enterprise, enterprise_trial.

4. Poll until tier is active

curl -s -H "Authorization: Bearer YOUR_KEY" \
  https://htmltablemaker.com/api/v1/account

Or poll checkout status: GET /api/v1/billing/checkout/{sessionId}

Get account info

curl -s -H "Authorization: Bearer YOUR_KEY" \
  https://htmltablemaker.com/api/v1/account

Quick Start

Replace YOUR_KEY and example.xlsx with your values.

List your tables

curl -s -H "Authorization: Bearer YOUR_KEY" \
  https://htmltablemaker.com/api/v1/tables

Create a table from Excel

curl -s -X POST -H "Authorization: Bearer YOUR_KEY" \
  -F "[email protected]" \
  -F "name=My Report" \
  -F 'options={"filter":true,"ordering":true,"paging":true,"itemsPerPage":50}' \
  https://htmltablemaker.com/api/v1/tables

Returns embedUrl, shareUrl, and iframeHtml for embedding on your site.

Get embed code for an existing table

curl -s -H "Authorization: Bearer YOUR_KEY" \
  https://htmltablemaker.com/api/v1/tables/TABLE_ID/embed

Query a table (authenticated)

curl -s -X POST -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":1,"itemsPerPage":50,"filters":[],"sorts":[]}' \
  https://htmltablemaker.com/api/v1/tables/TABLE_ID/query

Update table options

curl -s -X PATCH -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Renamed Table","options":{"filter":true,"ordering":true}}' \
  https://htmltablemaker.com/api/v1/tables/TABLE_ID

Replace table data (re-import Excel)

curl -s -X PUT -H "Authorization: Bearer YOUR_KEY" \
  -F "[email protected]" \
  https://htmltablemaker.com/api/v1/tables/TABLE_ID/data

Delete a table

curl -s -X DELETE -H "Authorization: Bearer YOUR_KEY" \
  https://htmltablemaker.com/api/v1/tables/TABLE_ID

Google Sheets sync

Link a Google Sheet as a live data source in the browser. The account owner must complete OAuth and use Choose Google Sheet on the website (agents cannot open Google Picker). Agents can sync, check status, and disconnect tables that are already linked.

Check Google Sheets connection

curl -s -H "Authorization: Bearer YOUR_KEY" \
  https://htmltablemaker.com/api/v1/google-sheets/connection

If connected is false, send the user to connectUrl. If needsReconnect is true, the owner must reconnect OAuth.

Link a new sheet

Not available via API. Use Excel to HTML Table or My Tables and click Choose Google Sheet.

Sync now

curl -s -X POST -H "Authorization: Bearer YOUR_KEY" \
  https://htmltablemaker.com/api/v1/tables/TABLE_ID/google-sheet/sync

Disconnect sheet

curl -s -X DELETE -H "Authorization: Bearer YOUR_KEY" \
  https://htmltablemaker.com/api/v1/tables/TABLE_ID/google-sheet

Public Endpoints

Published tables can be read without an API key (same access rules as the embed page). Use these when building integrations that display tables owned by others.

Get public table (initial load)

curl -s https://htmltablemaker.com/api/v1/public/tables/TABLE_ID

Query a public table

curl -s -X POST -H "Content-Type: application/json" \
  -d '{"tableId":"TABLE_ID","page":1,"itemsPerPage":50,"filters":[],"sorts":[]}' \
  https://htmltablemaker.com/api/v1/public/tables/TABLE_ID/query

OpenAPI / Swagger

In development, interactive API docs are available at /swagger. Set Api:EnableSwagger to true in configuration to enable in other environments.

AI agents (MCP)

Prefer chat-based tools over REST? Connect Cursor, Claude, ChatGPT, or another MCP client to /mcp with your API key as a Bearer token. Agents can create tables, preview them in chat, and get embed code. See Use with AI Agents (MCP).

Machine-readable overview: /llms.txt