# Clusters

Keyword cluster management

## Generate a content cluster

> Create an interlinked content cluster with a pillar article and supporting articles.\
> All articles are automatically interlinked using Link Engine.\
> Requires Power plan or higher and Link Engine to be configured.<br>

```json
{"openapi":"3.1.0","info":{"title":"Cuppa API","version":"1.0.0"},"tags":[{"name":"Clusters","description":"Keyword cluster management"}],"servers":[{"url":"https://api.cuppa.ai"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}}},"paths":{"/v1/clusters/generate":{"post":{"summary":"Generate a content cluster","description":"Create an interlinked content cluster with a pillar article and supporting articles.\nAll articles are automatically interlinked using Link Engine.\nRequires Power plan or higher and Link Engine to be configured.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["site_id","pillar_keyword","supporting_keywords"],"properties":{"site_id":{"type":"string","format":"uuid"},"pillar_keyword":{"type":"string","maxLength":200,"description":"The main topic/keyword for the pillar article"},"pillar_title":{"type":"string","maxLength":200,"description":"Optional custom title for pillar article"},"pillar_secondary_keywords":{"type":"array","items":{"type":"string"},"maxItems":5},"supporting_keywords":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":10,"description":"Keywords for supporting articles that link to the pillar"},"options":{"type":"object","properties":{"article_type":{"type":"string","enum":["general","listicle","review","howto"]},"word_count":{"type":"number","minimum":500,"maximum":5000},"language":{"type":"string"},"model":{"type":"string"}}}}}}}},"responses":{"202":{"description":"Cluster generation started","content":{"application/json":{"schema":{"type":"object","properties":{"cluster_id":{"type":"string"},"total_articles":{"type":"number"},"status":{"type":"string","enum":["queued"]},"message":{"type":"string"}}}}}}},"tags":["Clusters"]}}}}
```

## List keyword clusters

> Returns keyword clusters for content planning. Requires Power plan or higher.

```json
{"openapi":"3.1.0","info":{"title":"Cuppa API","version":"1.0.0"},"tags":[{"name":"Clusters","description":"Keyword cluster management"}],"servers":[{"url":"https://api.cuppa.ai"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"Cluster":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"site_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"in_plan":{"type":"boolean","description":"Whether this cluster is active in content planning"},"pillar_page":{"type":"string","nullable":true,"description":"URL of the pillar page for this cluster"},"total_keywords":{"type":"integer"},"total_search_volume":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time","nullable":true}}}}},"paths":{"/v1/clusters":{"get":{"summary":"List keyword clusters","description":"Returns keyword clusters for content planning. Requires Power plan or higher.","parameters":[{"in":"query","name":"page","schema":{"type":"integer"}},{"in":"query","name":"site","schema":{"type":"string","format":"uuid"},"description":"Filter by site ID"},{"in":"query","name":"in_plan","schema":{"type":"boolean"},"description":"Filter by active clusters"}],"responses":{"200":{"description":"A list of clusters","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Cluster"}}}}}},"tags":["Clusters"]}}}}
```

## GET /v1/clusters/{id}

> Get a cluster with keywords

```json
{"openapi":"3.1.0","info":{"title":"Cuppa API","version":"1.0.0"},"tags":[{"name":"Clusters","description":"Keyword cluster management"}],"servers":[{"url":"https://api.cuppa.ai"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"ClusterDetail":{"allOf":[{"$ref":"#/components/schemas/Cluster"},{"type":"object","properties":{"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"keyword":{"type":"string"},"search_volume":{"type":"integer","nullable":true},"keyword_difficulty":{"type":"number","nullable":true},"cpc":{"type":"number","nullable":true},"search_intent":{"type":"string","nullable":true},"article_id":{"type":"string","nullable":true,"description":"Article ID if content has been generated for this keyword"}}}}}}]},"Cluster":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"site_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"in_plan":{"type":"boolean","description":"Whether this cluster is active in content planning"},"pillar_page":{"type":"string","nullable":true,"description":"URL of the pillar page for this cluster"},"total_keywords":{"type":"integer"},"total_search_volume":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time","nullable":true}}}}},"paths":{"/v1/clusters/{id}":{"get":{"summary":"Get a cluster with keywords","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"The cluster ID"}],"responses":{"200":{"description":"Cluster with keywords","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterDetail"}}}}},"tags":["Clusters"]}}}}
```

## Activate a cluster

> Mark a cluster as "In Plan" for content planning. Requires Power plan or higher.

```json
{"openapi":"3.1.0","info":{"title":"Cuppa API","version":"1.0.0"},"tags":[{"name":"Clusters","description":"Keyword cluster management"}],"servers":[{"url":"https://api.cuppa.ai"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"Cluster":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"site_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"in_plan":{"type":"boolean","description":"Whether this cluster is active in content planning"},"pillar_page":{"type":"string","nullable":true,"description":"URL of the pillar page for this cluster"},"total_keywords":{"type":"integer"},"total_search_volume":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time","nullable":true}}}}},"paths":{"/v1/clusters/{id}/activate":{"post":{"summary":"Activate a cluster","description":"Mark a cluster as \"In Plan\" for content planning. Requires Power plan or higher.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"The cluster ID"}],"responses":{"200":{"description":"Cluster activated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cluster"}}}}},"tags":["Clusters"]}}}}
```

## Deactivate a cluster

> Remove a cluster from "In Plan". Requires Power plan or higher.

```json
{"openapi":"3.1.0","info":{"title":"Cuppa API","version":"1.0.0"},"tags":[{"name":"Clusters","description":"Keyword cluster management"}],"servers":[{"url":"https://api.cuppa.ai"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"Cluster":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"site_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"in_plan":{"type":"boolean","description":"Whether this cluster is active in content planning"},"pillar_page":{"type":"string","nullable":true,"description":"URL of the pillar page for this cluster"},"total_keywords":{"type":"integer"},"total_search_volume":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time","nullable":true}}}}},"paths":{"/v1/clusters/{id}/deactivate":{"post":{"summary":"Deactivate a cluster","description":"Remove a cluster from \"In Plan\". Requires Power plan or higher.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"The cluster ID"}],"responses":{"200":{"description":"Cluster deactivated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cluster"}}}}},"tags":["Clusters"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.cuppa.ai/rest-api/clusters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
