How-tos
Create a Human-Friendly Alias
3 min
Before you start
- Sign up and grab your
OGLI_API_KEY
- Think of a memorable alias (letters, numbers, hyphens only)
1) Create a link with a custom alias
# cURL
curl -X POST https://api.ogli.sh/link \
-H "Authorization: Bearer $OGLI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"targetUrl": "https://yoursite.com/launch",
"title": "Product Launch 2024",
"description": "Join us for the biggest launch of the year",
"alias": "launch-2024"
}'
// Node.js
const response = await fetch("https://api.ogli.sh/link", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.OGLI_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
targetUrl: "https://yoursite.com/launch",
title: "Product Launch 2024",
description: "Join us for the biggest launch of the year",
alias: "launch-2024"
})
});
const link = await response.json();
console.log(link.url); // https://ogli.sh/launch-2024
2) Response with alias URL
{
"url": "https://ogli.sh/launch-2024",
"qrCodeUrl": "https://ogli.sh/qr/launch-2024",
"id": "link-id-123",
"slug": "AbC123",
"alias": "launch-2024"
}
Alias rules
- ✅ 3-50 characters long
- ✅ Letters, numbers, hyphens only
- ✅ Must be unique across all ogli.sh links
- ❌ Cannot start or end with hyphen
- ❌ Cannot use reserved words (api, qr, www, etc.)
Pro tips
- Events: Use dates like
summit-2024
- Campaigns: Use campaign names like
black-friday
- Products: Use product codes like
widget-v2
- Keep it short: Easier to type and remember
← Back to all how-tos