Skip to content
ShapelessAI← Back
Publishing

Count clicks with short links

Swap every http(s) link in a post and in each item of its comment chain for a shapelessai.com/l/ short link that redirects to the original and counts the people who click, so a post's outcome is clicks, not only likes.

View as Markdown

Set shortenLinks on the post; reading the post back answers links[] with each url, its shortUrl, clicks and lastClickAt. Link-preview fetchers and bots are not counted, and a bare domain without http(s) is left as it is.

Part of Publish a post: the same call, one more field. Every field and refusal is on that page.

Ask in plain words

  • "track clicks on the link in this post"
  • "how many people clicked my launch link"
  • "shorten the links in tomorrow's posts"

From an agent host (MCP)

Server: https://shapelessai.com/mcp (add it to your host).

  • posts_create: PUBLISHES CONTENT: puts a post you wrote on the rail for one connected account (connections_list), or with group for every account of a group (posts_setup lists groups and their defaults; the answer's posts lists each account's post, id and status are the first's), at a time, in the account's next free queue slot, or now. Optional tags, a saved signature, repeatEveryDays and shortenLinks. Read platforms_list first for the platform's limits and settings schema. Free plan: 10 posts a day and 60 a month, and X only once a day without links, because X bills per post (402 free_daily_cap / free_monthly_cap / free_x_daily_cap / free_x_link carry the reset time and what to do instead). Needs the publish scope.

From code (REST)

Bearer API key with the scope each call names (auth, OpenAPI).

  • POST /api/posts (publish scope): Queue a post: at a time, in the next free queue slot, or now, on one account (connectionId) or every account of a group (group: its id or name; the group's defaults fill what the post leaves out, and the answer is {group, posts, skipped?}). Optional tags, signature, repeatEveryDays and shortenLinks. Send an Idempotency-Key so a retry never makes a second post.
  • GET /api/posts/cap (read scope): The Free plan's day: how many posts already go out on the UTC day ?at= falls on, and the cap. Paid plans answer { cap: null }.

From a terminal (CLI)

  • shapeless posts create

Example

curl -s https://shapelessai.com/api/posts -H "Authorization: Bearer $SHAPELESS_API_KEY" -H "Content-Type: application/json" -d '{"connectionId":"<id>","postText":"The full write-up is on our blog.","shortenLinks":true}'
// MCP tool call
{ "tool": "posts_create", "arguments": { "connectionId": "<id>", "text": "The full write-up is on our blog.", "shortenLinks": true } }
shapeless posts create --to <connectionId> --text "The full write-up is on our blog." --shorten-links

Where else

More in Publishing

Publish a post · Comment under a post, in a chain · Plug a post once it takes off · Add alt text and pick a video cover · Use each platform's own post options · Repeat a post every N days · Post to a set of accounts · Tag posts and sign them · Share a post preview · Get post events by webhook · Attach a sound to an Instagram Reel · Review the queue · Set the posting schedule · Answer comments and work the inbox

Every capability · Docs · /llms.txt