Links and bio pages

Short links with UTM parameters and click stats by country, device, browser and referrer, and link-in-bio pages with blocks, themes and an email signup. Both need the links scope and cost nothing.

Shorten a link

POST /v1/links creates a short link at /l/SLUG. The response has the shortUrl to share and the finalUrl visitors are sent to, with your UTM parameters added.

NameTypeDescription
destinationrequiredurlWhere the link goes.
slugstringCustom back half, 2 to 41 letters, numbers, dashes or underscores. Random when left out. Taken slugs return 409 conflict.
titlestringA name for your own reference.
utm{ source?, medium?, campaign?, term?, content? }UTM parameters to add, without the utm_ prefix.
expiresAtdate-timeAfter this time the link stops redirecting.
curl -X POST "https://postkea.com/api/v1/links" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "destination": "https://studiolumen.com/workshops",
  "slug": "spring",
  "utm": {
    "source": "instagram",
    "medium": "social",
    "campaign": "spring-workshop"
  }
}'
Response
{
  "success": true,
  "data": {
    "id": "lnk_2Vb7",
    "slug": "spring",
    "destination": "https://studiolumen.com/workshops",
    "shortUrl": "https://postkea.com/l/spring",
    "finalUrl": "https://studiolumen.com/workshops?utm_source=instagram&utm_medium=social&utm_campaign=spring-workshop",
    "clicks": 0
  }
}

Click stats

GET /v1/links/{id}/stats returns the total and daily clicks of the last days days, broken down by country, device, browser and referrer. GET /v1/links lists links with their click counts; PATCH and DELETE /v1/links/{id} change or remove one.

curl "https://postkea.com/api/v1/links/lnk_2Vb7/stats?days=30" \
  -H "Authorization: Bearer $POSTKEA_API_KEY"

Links in posts

In the workspace settings (PATCH /v1/workspace), defaultUtm adds UTM parameters to every link in your posts, with utm_source set to the network, and shortenLinks turns every link into a trackable short link before the post goes out.

Link-in-bio pages

A bio page is a small public page at /b/SLUG to put in your profiles. Create it with POST /v1/bio-pages; GET /v1/bio-pages/{id} returns the page with its subscriber count and the click stats of the last 30 days, including clicks per block.

NameTypeDescription
slugrequiredstringThe page address.
titlerequiredstringName shown at the top.
biostring | nullA short description.
avatarUrlurl | nullProfile picture.
theme{ preset, accent?, background?, font?, buttonStyle? }Look of the page: a preset and optional accent color, background, font and button style.Default: { "preset": "plume" }
blocksBlock[]The content, in order, see below.Default: []
publishedbooleanUnpublished pages are not shown to visitors.Default: true
curl -X POST "https://postkea.com/api/v1/bio-pages" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "slug": "studiolumen",
  "title": "Studio Lumen",
  "bio": "Handmade ceramics from Berlin.",
  "blocks": [
    {
      "id": "b1",
      "type": "link",
      "label": "Book a workshop",
      "url": "https://studiolumen.com/workshops"
    },
    {
      "id": "b2",
      "type": "social",
      "url": "https://instagram.com/studio.lumen"
    },
    {
      "id": "b3",
      "type": "email",
      "label": "Get the monthly newsletter"
    }
  ]
}'

Blocks

Every block has an id, a type and optional label, url, text, imageUrl and hidden.

TypeDescription
linkA button that opens url. Clicks are counted per block.
headerA section heading.
textA paragraph of text.
imageAn image, optionally linked.
videoAn embedded video from its url.
socialAn icon link to one of your profiles.
emailAn email signup form for your list.

Email subscribers

Emails collected by an email block are listed by GET /v1/bio-pages/{id}/subscribers. The form on the page posts to the public POST /v1/public/bio/{slug}/subscribe endpoint.