API docs

Using the bity API

Turn any link into a short bity link from your own code. Here's your key, the endpoint, and what comes back.

1. Get your API key

Every account gets an API key automatically — it's generated the first time you log in, and shown on your account page. If you don't have an account yet, sign up first, it's free.

Keep your key private. It identifies you to the API the same way a password does.

2. Create a short link

Send a POST request to /API/new with your key, the destination URL, and (optionally) when the link should expire.

FieldTypeRequiredNotes
api_keystringYesFrom your account page.
destination_urlstringYesMust start with http:// or https://.
expire_datestring (date)NoAny date format JavaScript's Date can parse, e.g. 2026-12-31. Leave it out for a link that never expires.
request
curl -X POST https://bity.au/API/new \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "your-api-key-here",
    "destination_url": "https://example.com/campaigns/spring-sale",
    "expire_date": "2026-12-31"
  }'
response — 201 Created
{
  "url": "https://bity.au/aZ3k9q",
  "code": "aZ3k9q",
  "destination_url": "https://example.com/campaigns/spring-sale",
  "expire_date": "2026-12-31T00:00:00.000Z"
}

3. Share the short link

Visiting https://bity.au/aZ3k9q sends people straight to your destination URL with a standard 302 redirect, no interstitial page.

Once a link's expire_date has passed, it stops redirecting and shows a plain "link expired" page with a 410 Gone status instead.

Errors

  • 401 — your api_key is missing or doesn't match an account.
  • 400 — destination_url is missing, isn't a valid http(s) link, or expire_date couldn't be parsed as a date.
  • 410 — the short link you're visiting has expired.

Need a key?

Sign up, log in, and your API key will be waiting on your account page.

Sign up