Skip to content

REST API endpoints

The WordPress REST API (wp-json) endpoints Whalesync calls to list post types, read and write records, and upload media, for network-level debugging.

Whalesync talks to your site through the standard WordPress REST API (the wp-json endpoints). This page lists the specific endpoints we call and what each one is for. It's mostly here for the curious and for anyone debugging a connection at the network level — you don't need to know any of this to set up a sync.

Throughout, {type} is a post type slug (for example posts, pages, or a custom post type) and {id} is a record's ID.

FunctionMethodPathKey query params
Auth / connection probeGETwp/v2/postsper_page=5&context=edit
Discover REST rootHEAD / GETsite root (reads Link header) → wp-json/—
List available post types (tables)GETwp/v2/types—
Fetch a table's field schemaOPTIONSwp/v2/{type}—
Poll / list recordsGETwp/v2/{type}per_page=100 + page=n&orderby=id&order=asc (or offset=n); status=any
Get one recordGETwp/v2/{type}/{id}status=any
Create record (new row)POSTwp/v2/{type}—
Update recordPATCHwp/v2/{type}/{id}—
Delete recordDELETEwp/v2/{type}/{id}force=true
Upload mediaPOSTwp/v2/mediaraw file body + Content-Disposition
Get mediaGETwp/v2/media/{id}—