POST/api/v6/urlshortener/links

Create a short link

Publish a short link on one of your domains, with a generated code or your own alias.

Scope and limits

Scope

API key with the urlshortener service enabled

Usage limit

35 requests per second

Idempotency

Supports Idempotency-Key

  • The destination URL allows up to 2048 characters.
  • Destinations pointing to private or reserved hosts are rejected.

Creates a short link on one of your domains. The code is generated automatically (base36, 7 characters) unless you pass your own alias. Codes are unique per domain: the same alias can exist on two different domains.

Headers

Idempotency-Key
stringoptional
Optional idempotency key (1 to 255 characters from A-Za-z0-9_-). Repeating the same operation with the same key returns the original response without running it again. See the idempotency guide.

Request body

application/json
url
stringrequired
Destination URL. Absolute http or https, max 2048 characters. Private or reserved hosts are rejected.
domain
stringoptional
Domain to publish on. Must be available to your account (see GET /api/v6/urlshortener/domains). Defaults to your default domain.
alias
stringoptional
Optional custom code (3 to 32 characters: lowercase letters, digits, - and _). Must be free on the domain and not a reserved word.
expiresAt
stringoptional
Optional expiry in ISO-8601, always in the future. After that date the link returns 410.
{
  "url": "https://example.com/landing?utm_source=sms",
  "domain": "go.acme.co",
  "alias": "spring-sale"
}

Responses

201

Link created. In the extreme case where the immediate re-read fails, data carries only code and domain.

{
  "success": true,
  "data": {
    "id": 1024,
    "code": "a1b2c3d",
    "domain": "go.acme.co",
    "shortUrl": "https://go.acme.co/a1b2c3d",
    "longUrl": "https://example.com/landing?utm_source=sms",
    "alias": false,
    "active": true,
    "expiresAt": null,
    "createdAt": "2026-06-01T15:04:05Z",
    "clicks": 0,
    "uniqueClicks": 0,
    "lastClickAt": null
  },
  "meta": {
    "requestId": "8f0c0e2a4b1d4c8fae2b7a91e0c5d3f6",
    "timestamp": "2026-06-01T15:04:05+00:00",
    "responseTimeMs": 7.2
  }
}
400

Invalid input (destination URL, alias, expiry or domain), or a malformed idempotency key.

401

Invalid or missing credentials.

403

The organization is read-only, or cannot create the link.

409

The alias is already taken on this domain, or a request with the same idempotency key is still in progress.

422

The idempotency key was reused with a different body.

429

Request limit exceeded.

Possible errors

Codes this endpoint can return in error.code. The full detail lives in the catalog.

See the full catalog
POST /api/v6/urlshortener/links
curl -X POST 'https://developers.hablame.co/api/v6/urlshortener/links' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer hk_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  --data '{"url":"https://example.com/landing?utm_source=sms","domain":"go.acme.co","alias":"spring-sale"}'

Try-It

Run the request against the real API with your own API key.

The key is used only in your browser for this request. It is not stored nor sent anywhere else.

Parameters

Optional idempotency key (1 to 255 characters from A-Za-z0-9_-). Repeating the same operation with the same key returns the original response without running it again. See the idempotency guide.

Request body

Destination URL. Absolute http or https, max 2048 characters. Private or reserved hosts are rejected.

Domain to publish on. Must be available to your account (see GET /api/v6/urlshortener/domains). Defaults to your default domain.

Optional custom code (3 to 32 characters: lowercase letters, digits, - and _). Must be free on the domain and not a reserved word.

Optional expiry in ISO-8601, always in the future. After that date the link returns 410.

POST https://developers.hablame.co/api/v6/urlshortener/links

Response

You have not sent a request yet.