Skip to content
BrainyShorts Docs
Esc
↑↓navigate↵open⌘Jpreview

Get a link to connect or reconnect a channel

Connecting a channel needs a person in a browser. Give the returned url to the user, then poll GET /api/cli/accounts until the account appears. The same link reconnects an account whose token_valid is false. For devto and hashnode the page opens with the token field focused. MCP: brainy_get_connect_link.

POST/api/cli/accounts/connect-links
Authorization
AuthorizationBearer token (ba_sk_...) · headerrequired

API key from /dashboard/api-keys. Keys expire after 365 days.

or
AuthorizationBearer token (ba_mcp_access_...) · headerrequired

The OAuth access token the hosted MCP server issues (brainy:read for GET routes, brainy:write for everything else). One login serves MCP, the CLI and the desktop app. A token without the needed scope gets 403 Insufficient scope.

Request body
requiredapplication/json
platformstringrequired
Allowed:instagramtiktokyoutubelinkedinxdevtohashnodereddit
Responses
200

OK

urlstring<uri>required

Login-gated dashboard link. Contains no token; it signs in whoever opens it as themselves.

platformstringrequired
Allowed:instagramtiktokyoutubelinkedinxdevtohashnodereddit
account_limitobjectrequired
Show properties
usedintegerrequired
limitinteger | nullrequired

null on an unlimited plan

next_stepstring
400

Unknown platform; the body lists the allowed ones

errorstringrequired
codestring
401

Missing, invalid, expired, or revoked API key

errorstringrequired
codestring
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST "https://www.brainyshorts.com/api/cli/accounts/connect-links" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "platform": "instagram"
}'
Response
{
  "url": "http://example.com",
  "platform": "instagram",
  "account_limit": {
    "used": 0,
    "limit": 0
  },
  "next_step": "string"
}