Skip to Content
APIEndpointsList topics

List topics

The full topic tree in one response, flat. A subtopic is a topic with a parent_topic_id — there is no separate subtopic resource, and no separate endpoint for one.

These ids are the values for every topic_id filter on the surface, so this is the lookup call before filtering anything by topic.

GET /v1/brands/{brand_id}/topics

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Query parameters

ParameterTypeRequiredDescription
limitintegeroptionalRows per page, 1 to 100. Defaults to 20.
cursorstringoptionalOpaque cursor from the previous response. Treat it as a token, never construct one.

Request

curl --request GET \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/topics' \ --header 'Authorization: Bearer <api-key>'

Response

{ "data": [ { "id": "4beb0694-7c2e-488b-84c1-613738e7eaf6", "name": "AI Visibility Tracking", "description": null, "parent_topic_id": null, "is_subtopic": false, "is_selected": true }, { "id": "3249738e-6af1-4d5c-9fb3-65de7ac15199", "name": "Share of Voice in AI search", "description": null, "parent_topic_id": "4beb0694-7c2e-488b-84c1-613738e7eaf6", "is_subtopic": true, "is_selected": true } ], "pagination": { "limit": 20, "has_more": true, "next_cursor": "eyJ2IjoxLCJvIjoyMCwibCI6MjB9" }, "request_id": "req_6d2b81f04ca749e3b0ff" }

Response fields

FieldTypeDescription
data.topicsobject[]required. Roots and subtopics together, flat
data.topics[].iduuidrequired
data.topics[].namestringrequired
data.topics[].descriptionstring | nullRarely populated
data.topics[].parent_topic_iduuid | nullnull for a root topic
data.topics[].is_subtopicbooleanrequired. Convenience for parent_topic_id !== null
data.topics[].is_selectedbooleanrequired. Whether the topic is included in the brand’s active tracking set
data.countintegerrequired
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestA parameter is unknown or malformed. The message names it
401invalid_tokenThe key is missing, malformed, or does not exist
401token_expiredThe key passed its expiry date
401token_revokedThe key was revoked
404not_foundThe brand does not exist, or this key is not allowed to reach it. The two are deliberately indistinguishable
429rate_limitedOver 300 requests per minute. See the Retry-After header

Notes

The tree is two levels deep in practice: root topics and their subtopics. The schema permits deeper nesting, so treat parent_topic_id as the source of truth rather than assuming two levels.

Not paginated. A brand carries at most a few dozen topics.

A prompt can hang off either a root topic or a subtopic, so when filtering by a root you usually want its subtopics included too. See Filtering.

Last updated on