Skip to content

Shorten and measure links from your application with the Hablame URL shortener

An API to create short links, manage them and know how many people open them. You use it with your API key, like the rest of the Hablame APIs.

  • Up to 1,000 links per request
  • Aliases of 3 to 32 characters
  • Statistics by country and device

What you can do

  • Create a short link

    If you do not choose the code, the service generates a 7-character one. If you choose it, it becomes an alias, unique on its domain.

  • Aliases of 3 to 32 characters

    Lowercase letters, digits, hyphen and underscore, for example promo-septiembre.

  • Up to 1,000 links per request

    Bulk creation returns one result per link: an invalid one does not bring down the rest.

  • h0b.co or your own domain

    You publish on the platform domains, such as h0b.co, or on an own domain that is already verified.

  • Optional expiry

    Once expired, the link stops redirecting and whoever opens it gets a 404.

  • Change the destination, keep the link

    You edit the destination, the status or the expiry. Domain and code do not change, so links already handed out keep working.

  • Delete and restore

    A deleted link can be restored for 90 days, with the same code and no new charge.

  • Visit statistics

    Range totals, a daily or hourly series and a breakdown by country, device, OS, browser or source, per link or for your whole organization.

  • Retries without duplicates

    With an idempotency key, repeating a creation that was cut off returns the same link, without creating another one or charging twice.

How it works

Four steps, from creating the link to reading its visits.

  1. POST /api/v6/urlshortener/links

    Your application creates the link

    You send the destination URL and, if you want, an alias, a domain and an expiry.

  2. 201 · shortUrl

    You get the short link

    The response carries the link ready to share, for example inside an SMS.

  3. h0b.co/…

    A person opens it

    They land on your destination. If the link expired or you deleted it, they get a 404.

  4. GET …/stats

    You read the visits

    You read totals, series and breakdowns per link, or the summary of your whole organization.

Your first link

Replace hk_YOUR_API_KEY with your API key. This example creates a link and, like any creation, it is charged unless your plan includes it.

curl -X POST https://developers.hablame.co/api/v6/urlshortener/links \
  -H "Authorization: Bearer hk_YOUR_API_KEY" \
  -H "Idempotency-Key: 5f3b2c10-9a7e-4b2d-8c1f-0a1b2c3d4e5f" \
  -H "Content-Type: application/json" \
  -d '{
  "longUrl": "https://example.com/landing?utm_source=sms",
  "domain": "h0b.co",
  "code": "promo-septiembre",
  "expiresAt": "2026-12-31T23:59:59-05:00"
}'

What you need

  • An API key of your organization with the URL shortener enabled.
  • With the URL shortener service, the key reads, creates and edits links: the service is granted in full. Only the owner of your organization creates keys.
  • Available balance or an active monthly URL shortener plan. With neither, the API does not create the link.
  • If you want to use your own domain, write to us: the API does not register or verify domains, and it only publishes on verified ones.

What is charged

We do not publish prices here. You can read your organization’s current one with GET /api/v6/urlshortener/pricing or ask the sales team.

  • Creating a link is charged, unless you have a monthly URL shortener plan that includes it.
  • After that, every visit by a person to the link is also charged. Visits by bots and link previews are not.
  • Editing, deleting, restoring and reading statistics are free.

Want to integrate it?

Tell us what you need and we will guide you on how to get your API key.

Need help?

Was this page helpful?

See all support channels

Your cookie preferences

You decide what we measure. You can change your choice at any time. Rejecting takes no feature away from the documentation.

Privacy policy