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.
| Field | Type | Required | Notes |
|---|---|---|---|
api_key | string | Yes | From your account page. |
destination_url | string | Yes | Must start with http:// or https://. |
expire_date | string (date) | No | Any date format JavaScript's Date can parse, e.g. 2026-12-31. Leave it out for a link that never expires. |
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"
}'{
"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— yourapi_keyis missing or doesn't match an account.400—destination_urlis missing, isn't a validhttp(s)link, orexpire_datecouldn't be parsed as a date.410— the short link you're visiting has expired.