Skip to Content
APIEndpointsStart a social scan

Start a social scan

Scan one channel for new discussions relevant to this brand — the same scan the “Run a scan” button in the product triggers. One call scans one channel; to scan both Reddit and LinkedIn, make two calls.

Only one scan may run per brand per channel at a time. A second call while one is already running is refused, not queued.

POST /brands/{brand_id}/social/scans

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required
Idempotency-Keystringrequired on every write. See Idempotency

Path parameters

ParameterTypeRequiredDescription
brand_iduuidrequiredFrom List brands

Body parameters

ParameterTypeRequiredDescription
channelstringrequiredOne of: reddit, linkedin.
result_countintegerconditional5 to 50, must be a multiple of 5. Required unless this is the brand’s first scan on this channel, which is free at a fixed count and ignores this field.

Request

curl --request POST \ --url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/social/scans' \ --header 'Authorization: Bearer <api-key>' \ --header 'Idempotency-Key: 3f9a1c2e-8b4d-4a6f-9c1e-2d5b7a8f9e01' \ --header 'Content-Type: application/json' \ --data '{"channel": "reddit", "result_count": 10}'

Response

{ "data": { "job_id": "7c9e1f3a-4b2d-4e6f-8a1c-9d3e5b7f2a10", "channel": "reddit", "result_count": 10, "credit_cost": 20, "is_free_scan": false }, "request_id": "req_5a3c8d0e2f4b46a1bc9d" }

Response fields

FieldTypeDescription
data.job_iduuidrequired. Pass to Get scan status
data.channelstringrequired. reddit or linkedin
data.result_countintegerrequired. The count actually used — the free-scan fixed count if this was free, otherwise what you requested
data.credit_costintegerrequired. 0 when is_free_scan is true
data.is_free_scanbooleanrequired
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
400invalid_requestNo active keywords, or result_count outside 5-50 / not a multiple of 5
401invalid_tokenThe key is missing, malformed, or does not exist
401token_expiredThe key passed its expiry date
401token_revokedThe key was revoked
403plan_requiredLinkedIn discovery is not included in this workspace’s plan
403quota_exceededInsufficient credits for this scan’s cost
404not_foundThe brand does not exist, or this key is not allowed to reach it
409conflictA scan is already running for this brand and channel
429rate_limitedOver 300 requests per minute. See the Retry-After header

Notes

Only one scan per brand per channel at a time, enforced at the database level. Reddit and LinkedIn scans for the same brand run independently and do not block each other.

Credits and free-scan eligibility are always computed server-side. result_count is ignored on a qualifying free first scan; do not rely on it to predict credit_cost, read the response instead.

This endpoint only starts the scan. Poll Get scan status with the returned job_id, then read the results from List social discussions once it completes.

Last updated on