Skip to content

API reference

Clusters

Clusters endpoints of the SemanticsOn REST API.

List keyword clusters

GET/projects/{projectId}/clusters

Clusters with their keyword counts. List a cluster's keywords with GET /projects/{projectId}/keywords?clusterId=.

Path parameters

  • projectIdstringrequired

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

curl https://semanticson.com/api/v1/projects/PROJECT_ID/clusters \
  -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.

Create a keyword cluster

POST/projects/{projectId}/clusters

Names are unique per project (case-insensitive); a duplicate returns 409 cluster_exists. Assign keywords with PATCH /keywords/{keywordId} or when adding them.

Accepts an Idempotency-Key header for safe retries.

Path parameters

  • projectIdstringrequired

Request body

  • namestringrequired

    1–160 characters

  • intentstringoptional

    One of: , informational, commercial, transactional, navigational

    default ""

  • pageTypestringoptional

    Page type that should target the cluster, e.g. guide, category, product

    at most 80 characters · default ""

  • targetUrlstringoptional

    at most 500 characters · default ""

curl -X POST https://semanticson.com/api/v1/projects/PROJECT_ID/clusters \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Espresso grinders",
  "intent": "commercial",
  "pageType": "category",
  "targetUrl": "https://example.com/grinders"
}'

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 keyword cluster

GET/clusters/{clusterId}

Path parameters

  • clusterIdstringrequired

    The cluster id

    1–64 characters

curl https://semanticson.com/api/v1/clusters/CLUSTER_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.

Update a keyword cluster

PATCH/clusters/{clusterId}

Accepts an Idempotency-Key header for safe retries.

Path parameters

  • clusterIdstringrequired

    The cluster id

    1–64 characters

Request body

  • namestringoptional

    1–160 characters

  • intentstringoptional

    One of: , informational, commercial, transactional, navigational

  • pageTypestringoptional

    Page type that should target the cluster, e.g. guide, category, product

    at most 80 characters

  • targetUrlstringoptional

    at most 500 characters

curl -X PATCH https://semanticson.com/api/v1/clusters/CLUSTER_ID \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Espresso grinders (burr)",
  "targetUrl": "https://example.com/burr-grinders"
}'

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.

Delete a keyword cluster

DELETE/clusters/{clusterId}

The cluster's keywords are kept and become unclustered.

Accepts an Idempotency-Key header for safe retries.

Path parameters

  • clusterIdstringrequired

    The cluster id

    1–64 characters

curl -X DELETE https://semanticson.com/api/v1/clusters/CLUSTER_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.

Merge a cluster into another

POST/clusters/{clusterId}/merge

Moves every keyword of this cluster into intoClusterId (same project) and deletes this cluster. Empty intent, page type and target URL of the target are filled from this cluster. Returns the target cluster and how many keywords moved.

Accepts an Idempotency-Key header for safe retries.

Path parameters

  • clusterIdstringrequired

    The cluster id

    1–64 characters

Request body

  • intoClusterIdstringrequired

    The target cluster id

    1–64 characters

curl -X POST https://semanticson.com/api/v1/clusters/CLUSTER_ID/merge \
  -H "Authorization: Bearer $SEMANTICSON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "intoClusterId": "cm1cluster…"
}'

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.