HmzShort

API Documentation

Integrate HmzShort into your applications with our simple REST API.

Authentication

All API requests require an API key passed via the x-api-key header.

Get your API key
POST

Shorten a URL

Create a shortened link using your API key.

Endpoint

https://hmzshort.biz.id/api/v1/shorten

Headers

HeaderTypeDescription
x-api-keyrequiredYour API key
Content-Typerequiredapplication/json

Request Body

FieldTypeDescription
urlstring, requiredThe original URL to shorten (must include https://).
aliasstring, optionalA custom short code (alphanumeric, 3-30 chars). Auto-generated if omitted.

Example

curl -X POST https://hmzshort.biz.id/api/v1/shorten \
-H "Content-Type: application/json" \
-H "x-api-key: hmz_your_api_key_here" \
-d '{"url": "https://example.com/very/long/path", "alias": "my-link"}'

Response

{
"shortCode": "my-link",
"shortUrl": "https://hmzshort.biz.id/my-link"
}

shortCode — the generated short code.

shortUrl — the full shortened URL.