Skip to content

API reference

Connected sites

Websites linked to a project. A connected site syncs its pages and applies changes that a person approved.

Query parameters

  • limitintegeroptional

    Items per page, 1–100.

    1–100 · default 25

  • cursorstringoptional

    Pass nextCursor from the previous page to get the next one.

    at most 200 characters

  • projectIdstringoptional
  • statusstringoptional

    One of: pending, connected, disconnected, error

curl https://semanticson.com/api/v1/sites \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 200 OK

A list object: { "object": "list", "data": [ … ], "hasMore": false, "nextCursor": null }. See pagination.

Errors use the standard error object.

Registers a website and returns its site key and nudge secret — shown only in this response. Use them in your own integration (the WordPress plugin can also connect this way with an account API key) to sync and receive approved changes. Counts towards your plan's connected-website limit.

If the same address is already connected to this project (in any state), it is reconnected: fresh credentials are issued, the previous site key is revoked, and the response is 200 instead of 201 (reconnected: true). If you already have the address connected to another project, the answer is 409 site_exists naming that project — disconnect it there first.

Request body

  • projectIdstringrequired

    1–64 characters

  • urlstringrequired

    Website address, e.g. https://example.com

    4–500 characters

  • namestringoptional

    at most 120 characters

  • platformstringoptional

    One of: wordpress, custom

    default "custom"

  • settingsobjectoptional

    Sync preferences the plugin reads on every sync

  • settings.postTypesarray of stringsoptional

    at most 20 items

  • settings.includeDraftsbooleanoptional
  • settings.syncIntervalMinutesintegeroptional

    5–1,440

  • settings.nudgeUrlstring or nulloptional

    Custom platforms: HTTPS endpoint that receives signed nudges (same signature as webhooks, using the site's nudge secret). WordPress sites do not need this.

    at most 500 characters · format uri

curl -X POST https://semanticson.com/api/v1/sites \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "projectId": "cm1abc…",
  "url": "https://example.com",
  "name": "Example blog",
  "platform": "custom"
}'

Response · 201 Created

A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.

Errors use the standard error object.

Get a connected site

GET/sites/{siteId}

Path parameters

  • siteIdstringrequired
Response fields Show 19 fields
  • object"site"
  • idstring
  • projectIdstring
  • namestring
  • urlstring
  • platformstring

    One of: wordpress, custom

  • statusstring

    One of: pending, connected, disconnected, error

  • pluginVersionstring or null
  • platformVersionstring or null
  • seoPluginstring or null
  • capabilitiesarray of strings
  • approvalInstring

    Where changes may be approved: only in the site's admin, or also in SemanticsOn and the API. Set by the site.

    One of: wordpress, both

  • settingsobject
  • pageCountnumber
  • lastSeenAtstring or null
  • lastSyncAtstring or null
  • lastErrorstring or null
  • createdAtstring
  • updatedAtstring
curl https://semanticson.com/api/v1/sites/SITE_ID \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 200 OK

A JSON object with the fields listed under Response fields.

Errors use the standard error object.

Update a connected site

PATCH/sites/{siteId}

Accepts an Idempotency-Key header for safe retries.

Path parameters

  • siteIdstringrequired

Request body

  • namestringoptional

    1–120 characters

  • settingsobjectoptional

    Sync preferences the plugin reads on every sync

  • settings.postTypesarray of stringsoptional

    at most 20 items

  • settings.includeDraftsbooleanoptional
  • settings.syncIntervalMinutesintegeroptional

    5–1,440

  • settings.nudgeUrlstring or nulloptional

    Custom platforms: HTTPS endpoint that receives signed nudges (same signature as webhooks, using the site's nudge secret). WordPress sites do not need this.

    at most 500 characters · format uri

curl -X PATCH https://semanticson.com/api/v1/sites/SITE_ID \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Example blog",
  "settings": {
    "postTypes": [
      "post",
      "page"
    ],
    "includeDrafts": true,
    "syncIntervalMinutes": 15
  }
}'

Response · 200 OK

A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.

Errors use the standard error object.

Disconnect a website

DELETE/sites/{siteId}

Revokes the site key and cancels changes waiting for approval. Pass ?purge=true to also delete its synced pages and history.

Accepts an Idempotency-Key header for safe retries.

Path parameters

  • siteIdstringrequired

Query parameters

  • purgestringoptional

    One of: true, false

    default "false"

curl -X DELETE https://semanticson.com/api/v1/sites/SITE_ID \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 204 No Content

Success returns an empty body (204) or a small confirmation object.

Errors use the standard error object.

Issue a new site key

POST/sites/{siteId}/rotate-key

Revokes the current site key and returns a new one (shown once). The website stops syncing until the new key is entered.

Path parameters

  • siteIdstringrequired

No request body. Send an empty body or {}.

curl -X POST https://semanticson.com/api/v1/sites/SITE_ID/rotate-key \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 200 OK

A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.

Errors use the standard error object.

List synced pages

GET/sites/{siteId}/pages

Pages and posts the website reported, including drafts when the site syncs them.

Path parameters

  • siteIdstringrequired

Query parameters

  • limitintegeroptional

    Items per page, 1–100.

    1–100 · default 25

  • cursorstringoptional

    Pass nextCursor from the previous page to get the next one.

    at most 200 characters

  • typestringoptional

    Post type, e.g. post, page, product (comma-separated for several)

  • statusstringoptional
  • searchstringoptional

    at most 200 characters

  • includeTextstringoptional

    One of: true, false

    default "false"

curl https://semanticson.com/api/v1/sites/SITE_ID/pages \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 200 OK

A list object: { "object": "list", "data": [ … ], "hasMore": false, "nextCursor": null }. See pagination.

Errors use the standard error object.

Get a synced page

GET/sites/{siteId}/pages/{pageId}

One page with every synced field (SEO, social, terms, featured image, structured data, product). The raw HTML content is included only with ?include=content. Pass ?by=externalId to look the page up by its ID on the website.

Path parameters

  • siteIdstringrequired
  • pageIdstringrequired

    at most 64 characters

Query parameters

  • includestringoptional

    Comma-separated: content, text

    at most 100 characters

  • bystringoptional

    One of: id, externalId

    default "id"

curl https://semanticson.com/api/v1/sites/SITE_ID/pages/PAGE_ID \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 200 OK

A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.

Errors use the standard error object.

List synced redirects

GET/sites/{siteId}/redirects

Redirects the website reported (both those created through SemanticsOn and manual ones), with hit counts.

Path parameters

  • siteIdstringrequired

Query parameters

  • limitintegeroptional

    Items per page, 1–100.

    1–100 · default 25

  • cursorstringoptional

    Pass nextCursor from the previous page to get the next one.

    at most 200 characters

  • searchstringoptional

    Matches from or to

    at most 200 characters

  • sourcestringoptional

    One of: semanticson, manual

curl https://semanticson.com/api/v1/sites/SITE_ID/redirects \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 200 OK

A list object: { "object": "list", "data": [ … ], "hasMore": false, "nextCursor": null }. See pagination.

Errors use the standard error object.

Path parameters

  • siteIdstringrequired

Query parameters

  • limitintegeroptional

    Items per page, 1–100.

    1–100 · default 25

  • cursorstringoptional

    Pass nextCursor from the previous page to get the next one.

    at most 200 characters

  • taxonomystringoptional

    e.g. category, post_tag, product_cat

    at most 64 characters

  • searchstringoptional

    at most 200 characters

curl https://semanticson.com/api/v1/sites/SITE_ID/terms \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 200 OK

A list object: { "object": "list", "data": [ … ], "hasMore": false, "nextCursor": null }. See pagination.

Errors use the standard error object.

List synced media

GET/sites/{siteId}/media

Path parameters

  • siteIdstringrequired

Query parameters

  • limitintegeroptional

    Items per page, 1–100.

    1–100 · default 25

  • cursorstringoptional

    Pass nextCursor from the previous page to get the next one.

    at most 200 characters

  • missingAltbooleanoptional

    Only images without alt text

  • searchstringoptional

    Matches title or URL

    at most 200 characters

  • mimeTypestringoptional

    Prefix, e.g. image/ or application/pdf

    at most 100 characters

curl https://semanticson.com/api/v1/sites/SITE_ID/media \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 200 OK

A list object: { "object": "list", "data": [ … ], "hasMore": false, "nextCursor": null }. See pagination.

Errors use the standard error object.

Ask the website to sync now

POST/sites/{siteId}/sync

Sends a signed nudge to a WordPress site so the plugin syncs pages and picks up approved changes immediately. Best effort: the plugin also syncs on its own schedule.

Accepts an Idempotency-Key header for safe retries.

Path parameters

  • siteIdstringrequired

No request body. Send an empty body or {}.

curl -X POST https://semanticson.com/api/v1/sites/SITE_ID/sync \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY"

Response · 200 OK

A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.

Errors use the standard error object.