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
| Name | Type | Required | Rules |
|---|---|---|---|
| bot_id | string | Yes | - |
| env | string | No (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
| Status | Error | When |
|---|---|---|
| 400 | bot_id is required | missing bot_id |
| 404 | bot not found | no such bot or deleted |
| 403 | test threads are only available to the bot owner | env=test and caller is not the owner |
| 500 | could not open thread | thread insert failed |