Quickstart¶
Get an API key and create your first short link in under five minutes.
1. Get an API key¶
API keys are created from your GoByte dashboard.
- Open the dashboard. Sign in at app.gobyte.io.
- Create a key. Go to Settings → API Keys and create a new key. Give it
a name and pick the scopes it needs (for creating links you need
links:write). - Copy it now. Your key is shown once, at creation time. It looks like
gb_live_sk_xxxxxxxxxxxx. Copy it and store it securely — GoByte only keeps a hashed copy and cannot show it to you again.
Warning
Treat your API key like a password. Never commit it to source control or ship it in client-side code. See Authentication for the full security model.
2. Create your first short link¶
Send a POST request to /api/v1/public/links with your destination URL.
const res = await fetch("https://api.gobyte.io/api/v1/public/links", {
method: "POST",
headers: {
Authorization: "Bearer gb_live_sk_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
destinationUrl: "https://example.com/a-very-long-url-to-shorten",
}),
});
const link = await res.json();
console.log(link.shortUrl);
A successful call returns 201 Created with the new link:
{
"id": "01J8XABCDEF...",
"shortCode": "aB3xY",
"shortUrl": "https://lnk.gobyte.io/aB3xY",
"destinationUrl": "https://example.com/a-very-long-url-to-shorten",
"status": "ACTIVE",
"totalClicks": 0,
"createdAt": "2026-01-01T12:00:00Z"
}
Open the shortUrl in a browser — it redirects to your destination.
3. Customize the link¶
Pass optional fields to control the alias, expiry, and click limit:
curl -X POST https://api.gobyte.io/api/v1/public/links \
-H "Authorization: Bearer gb_live_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"destinationUrl": "https://example.com/summer-sale",
"customAlias": "summer-sale",
"expiresAt": "2026-09-01T00:00:00Z",
"maxClicks": 1000
}'
| Field | Description |
|---|---|
destinationUrl |
Required. Where the short link redirects to. |
customAlias |
Custom slug (3–50 chars, lowercase letters, numbers, hyphens). |
password |
Require a password to open the link. |
expiresAt |
ISO-8601 timestamp after which the link stops working. |
maxClicks |
Deactivate the link after this many clicks. |
workspaceId |
Create the link in a specific workspace. |
4. Read analytics¶
Once your link gets traffic, fetch its stats:
curl https://api.gobyte.io/api/v1/public/links/{id}/analytics?period=7d \
-H "Authorization: Bearer gb_live_sk_your_key_here"
Next steps¶
-
Authentication
Scopes, rotation, and key security.
-
API Reference
Every endpoint, parameter, and response.