Skip to content
Gaurav TiwariDocs

REST API Reference

Version 1.1.1 Updated October 26, 2026

Core Tables keeps its admin screens, blocks and table scripts on one REST API under /wp-json/core-tables/v1/. You can use the same routes from your own code.

2 routes are public. Everything else needs a logged-in user with the right capability, through a cookie with a nonce or an Application Password.

Public Routes

These need no login and only ever return the published revision’s public columns.

Method and routePurpose
GET /public/datasets/{id}Published rows
GET /public/datasets/{id}/exportThe public CSV, as {csv}. It returns not found unless the published revision allows CSV downloads.

/public/datasets/{id} takes these parameters:

ParameterValuesDefault
searchText up to 200 characters, matched anywhere in public text cellsnone
filters[key]An exact value for a public column, up to 2,000 bytesnone
sortA public column keysource order
directionasc or descasc
pagePage number1
per_page1 to 10010
all_rowsReturn every row instead of a pageoff
curl "https://example.com/wp-json/core-tables/v1/public/datasets/12?search=pro&sort=price&direction=desc&per_page=20"

Trashed, deleted and unpublished datasets return not found here.

Authenticated Routes

“Edit access” means the edit_core_tables capability plus ownership of the dataset, or the manage_core_tables capability, on a dataset that isn’t in Trash.

Datasets

Method and routePermissionPurpose
GET /dataset-browseredit_posts, or edit_core_tables with editable=truePaged list: page, per_page up to 100 (default 20), search, status (all, published, draft, trash), orderby (id, name)
GET /datasetsedit_posts, or edit_core_tables for editable or trash listsOlder list, first 100
POST /datasetsedit_core_tablesCreate a dataset
GET /datasets/{id}Edit accessRead the draft
PUT /datasets/{id}Edit accessSave a draft, with expected_version
GET /datasets/{id}/accessedit_postsWhether you can edit it
POST /datasets/{id}/publishEdit access and publish_core_tablesPublish, with expected_version and revision_id
POST /datasets/{id}/unpublishEdit access and publish_core_tablesUnpublish
GET /datasets/{id}/revisionsEdit accessRevision list, 20 per page
GET /datasets/{id}/revisions/{revision}Edit accessOne snapshot
GET /datasets/{id}/activityEdit accessThe last 50 events
POST /datasets/{id}/retentionmanage_core_tables and edit accessPreview with confirm=false, or prune keeping keep (2 to 1,000, default 20)
POST /datasets/{id}/trashEdit accessMove to Trash
POST /datasets/{id}/restoreOwner or administrator, dataset in TrashRestore
DELETE /datasets/{id}/permanentmanage_core_tables, dataset in TrashDelete for good, with confirmation set to DELETE id
GET /datasets/{id}/trash-exportexport_core_tables, dataset in TrashCSV of the draft
GET /datasets/{id}/exportEdit access and export_core_tablesformat (csv, json, html, markdown) and public_only

Imports

Method and routePermissionPurpose
POST /imports/previewedit_core_tablesParse a CSV, with csv and delimiter
POST /imports/convertedit_core_tablesConvert content in format (csv, html, markdown, json), with first_row_header and delimiter
POST /convert/previewedit_core_tablesOlder HTML-only conversion, kept for clients built before 1.0
GET /imports/pluginsmanage_core_tablesList tables in other table plugins
POST /imports/pluginsmanage_core_tablesImport 1 table, with source and table

Google Sheets

Method and routePermissionPurpose
GET /datasets/{id}/sourceEdit accessConnection state and recent jobs
PUT /datasets/{id}/sourcemanage_core_tablesSave the connection and mapping
DELETE /datasets/{id}/sourcemanage_core_tablesDisconnect
POST /datasets/{id}/source/previewmanage_core_tablesPreview the range
POST /datasets/{id}/source/refreshEdit accessQueue a refresh, with expected_version
POST /datasets/{id}/source/refresh-nowEdit accessRun a refresh now, with expected_version
POST /datasets/{id}/source/pausemanage_core_tablesPause or resume, with paused
POST /datasets/{id}/source/jobs/{job}/cancelEdit accessCancel a job

Settings

Method and routePermissionPurpose
GET /appearanceedit_postsSite appearance and whether you can manage it
POST /appearancemanage_core_tablesSave appearance
GET and POST /aimanage_core_tablesAI & MCP settings, the MCP endpoint and Site Agent status
GET /licensemanage_core_tablesLicense status
POST /license/activate, /license/check, /license/disconnectmanage_core_tablesLicense actions

Saving Safely

Saves and publishes take the expected_version you last read. If someone saved in between, the request fails with stale_version and “This dataset changed in another editor. Reload before trying again.”

You can also send an Idempotency-Key header on POST /datasets, PUT /datasets/{id} and POST /datasets/{id}/publish. Use 16 to 128 letters, digits, _ or -. A retried request with the same key returns the first result instead of saving twice. Reusing a key with different content is refused.

curl -X POST "https://example.com/wp-json/core-tables/v1/datasets/12/publish" \
  -u "editor:application-password" \
  -H "Idempotency-Key: publish-plans-2026-10-26" \
  -H "Content-Type: application/json" \
  -d '{"expected_version": 4, "revision_id": 31}'

Take expected_version and the draft’s revision ID from a GET /datasets/{id} response just before you publish.

Responses and Errors

Every response is sent with Cache-Control: private, no-store. A request body can be up to 16 MB plus 64 KB.

HTTP statusCodeMeaning
422invalid_datasetA value, column or limit failed validation
409stale_versionSomeone saved the dataset after you read it
404not_foundMissing, unpublished or trashed, or you can’t see it
413too_largeOver the 16 MB limit
500storage_errorThe database write failed

AI tools can reach the same work through the commands in Build Tables with Site Agent. Actions you can hook into are in Hooks, Data, Privacy and Uninstall.

Share

Was this helpful?

Still stuck? Open a support ticket