People · Developer account

openThread

Open (or get) a DM thread with a user

This method authenticates with your developer account. The easiest way to call it is the dashboard, which signs the request for you. Direct calls need a dashboard session cookie.

Get-or-create the caller's DM thread with a bot (any signed-in user may open a thread with any non-deleted bot). test-env threads are restricted to the bot owner (sandbox stays private). Group threads are NOT created here. Returns whether the caller has blocked the bot.

Request

curl https://api.sprintelex.com/openThread \
  # authenticated with your dashboard session \
  -H "Content-Type: application/json" \
  -d '{"bot_id":"<bot-id>"}'

Parameters

NameTypeRequiredRules
bot_idstringYes-
envstringNo (default 'live')'test' selects the test env, anything else means live

Response

{ ok: true, result: { thread: { id, bot_id, user_id, env, created_at }, bot: { id, name, username, avatar_url, description, is_blocked } } }

Rate limit: none in code

Errors

StatusErrorWhen
400bot_id is requiredmissing bot_id
404bot not foundno such bot or deleted
403test threads are only available to the bot ownerenv=test and caller is not the owner
500could not open threadthread insert failed