Short Links API
Create and retrieve hashb.ink short links programmatically using your HashBack API key. Links redirect instantly and track click counts automatically.
Base URL
All API requests are HTTPS-only. Pass your API key as the X-API-Key header or as a api_key body field.
Create a Short Link
Shortens a URL and returns the compact hashb.ink link. Deducts 1 credit per new creation. If the same URL was previously shortened with your key the existing code is returned at no extra cost.
Accepts application/json or application/x-www-form-urlencoded. Rate limit: 10 requests / minute per API key.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your HashBack developer API key |
| url | string | Yes | The long URL to shorten (must be a valid URL, max 2048 chars) |
Example request
Success response 200
Get Link Info
Returns the original URL and click count for a given short code.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your HashBack developer API key |
| code | string | Yes | The short code (e.g. xk3p2f) |
Example request
Success response 200
Public Short Link Redirect
No authentication needed. Visiting a short link:
- Real visitors — redirected instantly (0ms) to the destination URL
- Crawlers & bots (WhatsApp, Slack, Facebook, Twitter) — receive the page with full OG metadata from your Link Branding settings
- Click counter is incremented for real visitor hits
OG tags served: og:title, og:description, og:image — populated from your Link Branding settings in the HashBack portal.
Error Codes
| HTTP | message | Meaning |
|---|---|---|
| 400 | Missing url parameter | The url field was empty or missing |
| 400 | Invalid URL | The URL failed validation |
| 400 | URL too long | URL exceeds 2048 characters |
| 401 | Unauthorized | Missing or invalid API key |
| 402 | Insufficient credits | Account has 0 credits remaining |
| 404 | Link not found | No short link exists for the given code |
| 429 | Rate limit exceeded | Too many requests — max 10/min per API key |
Configure your business name, logo, and OG description in the HashBack portal so every short link preview shows your brand on WhatsApp, Slack, and iMessage.