Skip to content

Test helpers

3 endpoints: add a test account, change a test account's behaviour, advance a post.

Add a test account

POST /v1/test_helpers/accounts

Adds a simulated account of a network to a Project in this sandbox, at once. It never reaches the network: posts to it publish through the simulator, following its preset and your caption's magic values. Plan limits per network apply as for real accounts. Test keys only.

Permission: accounts:write · Accepts Idempotency-Key · Answers 201

Body

FieldTypeRequiredDescription
project_idstringYes(up to 128 characters)
networkyoutube, tiktok, instagram, facebook, threads, bluesky, mastodon, pinterest, telegram, twitch, x, discordYes
presethealthy, reauth_required, expiring, slow, flakyNoHow the simulated network behaves: healthy, reauth_required, expiring, slow (publishes 90 seconds late) or flaky (about 3 in 10 targets fail). (default "healthy")
namestringNo(up to 120 characters)

Response

FieldTypeRequiredDescription
object"account"Yes
idstringYes(up to 128 characters)
project_idstring or nullYes
networkyoutube, tiktok, instagram, facebook, threads, bluesky, mastodon, pinterest, telegram, twitch, x, discordYes
namestringYes
handlestring or nullYes
avatar_urlstring or nullYes
followersinteger or nullYes
statusactive, reconnect_required, errorYes
connected_atstringYesISO 8601 date and time, UTC.
curl -X POST https://api.nowscale.com/v1/test_helpers/accounts \
  -H "Authorization: Bearer $NOWSCALE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ ... }'

Change a test account's behaviour

POST /v1/test_helpers/accounts/{account_id}

Switches a test account's preset, for example to reauth_required to see how your integration handles an account that must reconnect, then back to healthy. Test keys only.

Permission: accounts:write

Path parameters

NameDescription
account_idThe account's id.

Body

FieldTypeRequiredDescription
presethealthy, reauth_required, expiring, slow, flakyYes

Response

FieldTypeRequiredDescription
object"account"Yes
idstringYes(up to 128 characters)
project_idstring or nullYes
networkyoutube, tiktok, instagram, facebook, threads, bluesky, mastodon, pinterest, telegram, twitch, x, discordYes
namestringYes
handlestring or nullYes
avatar_urlstring or nullYes
followersinteger or nullYes
statusactive, reconnect_required, errorYes
connected_atstringYesISO 8601 date and time, UTC.
curl -X POST https://api.nowscale.com/v1/test_helpers/accounts/ACCOUNT_ID \
  -H "Authorization: Bearer $NOWSCALE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

Advance a post

POST /v1/test_helpers/posts/{post_id}/advance

Runs the simulator for this post now: every target whose time has come, including ones held by a delay, publishes or fails right away instead of on the next worker run. A target scheduled in the future stays scheduled; publish the post to send it now. Answers with the post after the simulator ran. Test keys only.

Permission: posts:publish · Accepts Idempotency-Key

Path parameters

NameDescription
post_idThe post's id.

Response

FieldTypeRequiredDescription
object"post"Yes
idstringYes(up to 128 characters)
project_idstring or nullYes
statusdraft, scheduled, publishing, published, partial, failed, deletingYes
review_statusnot_required, draft, in_review, approved, rejectedYes
titlestring or nullYes
captionstring or nullYes
visibilitystringYes
scheduled_atstring or nullYes
published_atstring or nullYes
created_atstringYesISO 8601 date and time, UTC.
updated_atstringYesISO 8601 date and time, UTC.
targetsarray of objectYes
targets[].object"post_target"Yes
targets[].idstringYes(up to 128 characters)
targets[].account_idstringYes(up to 128 characters)
targets[].networkyoutube, tiktok, instagram, facebook, threads, bluesky, mastodon, pinterest, telegram, twitch, x, discordYes
targets[].statuspending, uploading, uploaded, published, failedYes
targets[].stagestringYes
targets[].external_idstring or nullYes
targets[].error_codestring or nullYes
targets[].scheduled_atstring or nullYes
curl -X POST https://api.nowscale.com/v1/test_helpers/posts/POST_ID/advance \
  -H "Authorization: Bearer $NOWSCALE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ ... }'