Skip to Content
APIEndpointsGet prompt-suggestion run

Get prompt-suggestion run

Status of one Generate prompt suggestions call. The app never calls this itself — its modal subscribes to the same underlying row over Supabase Realtime — but polling is the only option available to an API caller.

GET /v1/brands/{brand_id}/prompts/suggestions/runs/{request_id}

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands
request_iduuidrequiredFrom Generate prompt suggestions’s data.request_id

Request

curl --request GET \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/prompts/suggestions/runs/3f1a9c2b-7e40-4b17-8e6a-3c05b91e7d22' \ --header 'Authorization: Bearer <api-key>'

Response

{ "data": { "request_id": "3f1a9c2b-7e40-4b17-8e6a-3c05b91e7d22", "topic_ids": ["9c2b1a4e-5d3f-4b8c-9e1a-2f7c6d8b3a10"], "status": "completed", "total_suggestions": 8, "error": null, "created_at": "2026-08-30T09:15:22.401Z", "updated_at": "2026-08-30T09:16:47.118Z", "completed_at": "2026-08-30T09:16:47.118Z" }, "request_id": "req_8f21c0aa47b1490d2e63" }

Response fields

FieldTypeDescription
data.request_iduuidrequired
data.topic_idsuuid[]required. The topics this run generated for
data.statusstringrequired. One of queued, running, completed, failed
data.total_suggestionsinteger | nullnull until the run finishes
data.errorstring | nullSet only when status is failed
data.created_attimestamptzrequired
data.updated_attimestamptzrequired
data.completed_attimestamptz | nullnull while queued or running
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
401invalid_tokenThe key is missing, malformed, or does not exist
401token_expiredThe key passed its expiry date
401token_revokedThe key was revoked
404not_foundThe run does not exist for this brand, or this key is not allowed to reach it
429rate_limitedOver 300 requests per minute

Notes

Poll, do not assume a fixed latency. Generation runs in the background and its duration depends on topic size and load. queued and running both mean “not yet”; back off between polls rather than tightening a loop.

Last updated on