Create short links programmatically. Get your API key from Admin → Settings.
https://digital.cortexhost.in/api.php
Accepts both GET and POST requests.
| Param | Required | Description |
|---|---|---|
| key | Yes | Your secret API key |
| url | Yes | The destination URL to shorten |
| alias | No | Custom short code (letters, numbers, - and _) |
| expiry | No | Expiry datetime, e.g. 2026-12-31 23:59:59 |
https://digital.cortexhost.in/api.php?key=YOUR_API_KEY&url=https://example.com
{
"success": true,
"short_url": "https://digital.cortexhost.in/abc123",
"code": "abc123",
"original_url": "https://example.com"
}
{
"success": false,
"message": "Invalid or missing API key."
}
HTTP status codes used: 401 invalid key, 400 missing url, 422 invalid url/alias taken, 429 rate limited.