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
| Header | Type | Description |
|---|---|---|
| x-api-key | required | Your API key |
| Content-Type | required | application/json |
Request Body
| Field | Type | Description |
|---|---|---|
| url | string, required | The original URL to shorten (must include https://). |
| alias | string, optional | A 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.