Quick start
- Sign up free. Every account can use the API: 100 links a month to try it, and 10,000 a month on mylinq Pro.
- Create a key in Dashboard → Short links → API. Copy it: it's shown once.
- Make a request with the key in the
Authorizationheader:
curl -X POST "https://mylinq.cc/api/v1/links" \
-H "Authorization: Bearer $MYLINQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://shop.example.com/sale/diwali-offer?utm_source=instagram",
"style": "personal",
"slug": "diwali",
"preview": "auto",
"expires_at": "2026-11-02T18:29:00Z"
}'Authentication
Send your key as a Bearer token on every request. Keys look like mlq_live_ followed by 32 characters.
Authorization: Bearer mlq_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxTreat keys like passwords: call the API from your server, never from a website or mobile app that others can inspect. Make one key per app so you can revoke them separately. We store only a hash of each key.
Limits
| Free | Pro | |
|---|---|---|
| Requests | 10 per minute per key | 60 per minute per key |
| Links created | 100 per month | 10,000 per month |
| Bulk size | 10 links per request | 100 links per request |
| Keys | 1 active key | 5 active keys |
Links created count per account per calendar month (UTC). When Pro ends, the account goes back to the Free limits; keys keep working.
Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix seconds). When you're limited you get 429 with a Retry-After header.
Safe retries. Add an Idempotency-Key header (any unique string, like your order id) to create requests. If you send the same request again within 24 hours, you get the original response back instead of a duplicate link.
Errors
Errors use normal HTTP status codes and always have the same shape:
{
"error": {
"code": "slug_taken",
"message": "That ending is already taken. Try another.",
"param": "slug"
}
}| Status | code | Meaning |
|---|---|---|
| 400 | invalid_request | A field is missing or wrong. param names the field. |
| 400 | invalid_json | The body isn't valid JSON. |
| 401 | invalid_api_key | No key, or a key that doesn't exist. |
| 401 | key_revoked | The key was revoked in the dashboard. |
| 404 | not_found | No link with that id on your account. |
| 409 | slug_taken | That ending is already used. |
| 422 | idempotency_mismatch | An Idempotency-Key was reused with a different body. |
| 429 | rate_limited | More than 60 requests in a minute. Wait for Retry-After seconds. |
| 429 | quota_exceeded | This month's 10,000 links are used up. |
| 500 | internal_error | Our fault. Retry, and quote the X-Request-Id if it keeps happening. |
The link object
{
"id": "6ac7dd31e0f3ba3b07e96f5d",
"short_url": "https://mylinq.cc/nila/diwali",
"slug": "diwali",
"style": "personal",
"url": "https://shop.example.com/sale/diwali-offer?utm_source=instagram",
"preview": {
"title": "Diwali sale: 50% off everything",
"description": "Only till Sunday. Free delivery across India.",
"image": "https://shop.example.com/og/diwali.jpg"
},
"expires_at": "2026-11-02T18:29:00.000Z",
"max_clicks": null,
"clicks": 0,
"disabled": false,
"source": "api",
"created_at": "2026-10-08T10:15:00.000Z"
}source is "api" for links made through the API and "web" for links made in the dashboard. Both are returned by the list endpoint.
Create a short link
POST/api/v1/links
Shortens one URL. Only url is required; everything else is optional.
| Field | Type | Description |
|---|---|---|
url | string, required | The long link. http or https. |
style | "short" | "personal" | "short" gives https://mylinq.cc/s/x7k2qp. "personal" puts your username in it: https://mylinq.cc/you/slug. Default "short". |
slug | string | Your own ending: 3–40 lowercase letters, numbers or hyphens. Random if left out (personal links need one or get a random one). |
preview | "auto" | object | Link preview for WhatsApp, X, LinkedIn and others. "auto" copies the page's own title, description and image. Or send { title, description, image }. |
expires_at | ISO 8601 date | The link stops working after this moment. |
max_clicks | integer | The link stops working after this many clicks. |
curl -X POST "https://mylinq.cc/api/v1/links" \
-H "Authorization: Bearer $MYLINQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://shop.example.com/sale/diwali-offer?utm_source=instagram",
"style": "personal",
"slug": "diwali",
"preview": "auto",
"expires_at": "2026-11-02T18:29:00Z"
}'Response 201
{
"id": "6ac7dd31e0f3ba3b07e96f5d",
"short_url": "https://mylinq.cc/nila/diwali",
"slug": "diwali",
"style": "personal",
"url": "https://shop.example.com/sale/diwali-offer?utm_source=instagram",
"preview": {
"title": "Diwali sale: 50% off everything",
"description": "Only till Sunday. Free delivery across India.",
"image": "https://shop.example.com/og/diwali.jpg"
},
"expires_at": "2026-11-02T18:29:00.000Z",
"max_clicks": null,
"clicks": 0,
"disabled": false,
"source": "api",
"created_at": "2026-10-08T10:15:00.000Z"
}Create links in bulk
POST/api/v1/links/bulk
Up to 100 links per request, each with the same fields as a single create. A bad item doesn't stop the others: every result has either a link or an error, in the same order you sent them.
| Field | Type | Description |
|---|---|---|
links | array, required | 1–100 link objects, as in Create. |
curl -X POST "https://mylinq.cc/api/v1/links/bulk" \
-H "Authorization: Bearer $MYLINQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"links": [
{
"url": "https://shop.example.com/p/kurta-blue"
},
{
"url": "https://shop.example.com/p/saree-red",
"preview": "auto"
},
{
"url": "not a link"
}
]
}'Response 200
{
"created": 2,
"failed": 1,
"results": [
{
"index": 0,
"link": {
"id": "6ac7…5e",
"short_url": "https://mylinq.cc/s/k7m2qp",
"slug": "k7m2qp",
"style": "short",
"url": "https://shop.example.com/p/kurta-blue",
"preview": {
"title": "Diwali sale: 50% off everything",
"description": "Only till Sunday. Free delivery across India.",
"image": "https://shop.example.com/og/diwali.jpg"
},
"expires_at": "2026-11-02T18:29:00.000Z",
"max_clicks": null,
"clicks": 0,
"disabled": false,
"source": "api",
"created_at": "2026-10-08T10:15:00.000Z"
}
},
{
"index": 1,
"link": {
"id": "6ac7…5f",
"short_url": "https://mylinq.cc/s/x9w4ta",
"slug": "x9w4ta",
"style": "short",
"url": "https://shop.example.com/p/saree-red",
"preview": {
"title": "Diwali sale: 50% off everything",
"description": "Only till Sunday. Free delivery across India.",
"image": "https://shop.example.com/og/diwali.jpg"
},
"expires_at": "2026-11-02T18:29:00.000Z",
"max_clicks": null,
"clicks": 0,
"disabled": false,
"source": "api",
"created_at": "2026-10-08T10:15:00.000Z"
}
},
{
"index": 2,
"error": {
"code": "invalid_request",
"message": "That doesn't look like a web link. Paste one starting with https://",
"param": "url"
}
}
]
}List your links
GET/api/v1/links
Newest first. Pass next_cursor as cursor to get the next page; it's null on the last page.
| Query | Type | Description |
|---|---|---|
limit | integer | 1–100, default 20. |
cursor | string | next_cursor from the previous page. |
q | string | Only links whose ending or destination contains this text. |
curl "https://mylinq.cc/api/v1/links?limit=20&q=diwali" \
-H "Authorization: Bearer $MYLINQ_API_KEY"Response 200
{
"data": [
{
"id": "6ac7dd31e0f3ba3b07e96f5d",
"short_url": "https://mylinq.cc/nila/diwali",
"slug": "diwali",
"style": "personal",
"url": "https://shop.example.com/sale/diwali-offer?utm_source=instagram",
"preview": {
"title": "Diwali sale: 50% off everything",
"description": "Only till Sunday. Free delivery across India.",
"image": "https://shop.example.com/og/diwali.jpg"
},
"expires_at": "2026-11-02T18:29:00.000Z",
"max_clicks": null,
"clicks": 0,
"disabled": false,
"source": "api",
"created_at": "2026-10-08T10:15:00.000Z"
}
],
"next_cursor": null
}Get a link
GET/api/v1/links/{id}
One link by id, with its current click count.
curl "https://mylinq.cc/api/v1/links/6ac7dd31e0f3ba3b07e96f5d" \
-H "Authorization: Bearer $MYLINQ_API_KEY"Response 200
{
"id": "6ac7dd31e0f3ba3b07e96f5d",
"short_url": "https://mylinq.cc/nila/diwali",
"slug": "diwali",
"style": "personal",
"url": "https://shop.example.com/sale/diwali-offer?utm_source=instagram",
"preview": {
"title": "Diwali sale: 50% off everything",
"description": "Only till Sunday. Free delivery across India.",
"image": "https://shop.example.com/og/diwali.jpg"
},
"expires_at": "2026-11-02T18:29:00.000Z",
"max_clicks": null,
"clicks": 0,
"disabled": false,
"source": "api",
"created_at": "2026-10-08T10:15:00.000Z"
}Update a link
PATCH/api/v1/links/{id}
Send only what changes. Change the destination any time: the short link and its QR code keep working. Use preview: "auto" to re-read the (new) page.
| Field | Type | Description |
|---|---|---|
url | string | New destination. |
slug | string | New ending. The old one stops working. |
preview | "auto" | object | New link preview. |
expires_at | ISO date | null | New expiry, or null for never. |
max_clicks | integer | null | New click limit, or null for none. |
disabled | boolean | Switch the link off or back on. |
curl -X PATCH "https://mylinq.cc/api/v1/links/6ac7dd31e0f3ba3b07e96f5d" \
-H "Authorization: Bearer $MYLINQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://shop.example.com/sale/diwali-final-hours",
"preview": "auto",
"max_clicks": null
}'Response 200
{
"id": "6ac7dd31e0f3ba3b07e96f5d",
"short_url": "https://mylinq.cc/nila/diwali",
"slug": "diwali",
"style": "personal",
"url": "https://shop.example.com/sale/diwali-final-hours",
"preview": {
"title": "Diwali sale: 50% off everything",
"description": "Only till Sunday. Free delivery across India.",
"image": "https://shop.example.com/og/diwali.jpg"
},
"expires_at": "2026-11-02T18:29:00.000Z",
"max_clicks": null,
"clicks": 0,
"disabled": false,
"source": "api",
"created_at": "2026-10-08T10:15:00.000Z"
}Delete a link
DELETE/api/v1/links/{id}
Removes the link and its click history. The short URL stops working.
curl -X DELETE "https://mylinq.cc/api/v1/links/6ac7dd31e0f3ba3b07e96f5d" \
-H "Authorization: Bearer $MYLINQ_API_KEY"Response 200
{
"id": "6ac7dd31e0f3ba3b07e96f5d",
"deleted": true
}Click stats
GET/api/v1/links/{id}/stats
Clicks per day (UTC) for the last 1–90 days, plus the top sources and countries. Bots and link-preview crawlers are never counted.
| Query | Type | Description |
|---|---|---|
days | integer | 1–90, default 30. |
curl "https://mylinq.cc/api/v1/links/6ac7dd31e0f3ba3b07e96f5d/stats?days=7" \
-H "Authorization: Bearer $MYLINQ_API_KEY"Response 200
{
"id": "6ac7dd31e0f3ba3b07e96f5d",
"clicks_total": 1284,
"total": 412,
"days": [
{
"day": "2026-10-02",
"clicks": 38
},
{
"day": "2026-10-03",
"clicks": 51
},
{
"day": "…",
"clicks": 0
}
],
"sources": [
{
"name": "instagram.com",
"n": 230
},
{
"name": "Direct",
"n": 98
},
{
"name": "web.whatsapp.com",
"n": 61
}
],
"countries": [
{
"name": "IN",
"n": 371
},
{
"name": "AE",
"n": 22
}
]
}Check your key
GET/api/v1/me
Who the key belongs to, this month's usage and your limits. Perfect for a “Test connection” button.
curl "https://mylinq.cc/api/v1/me" \
-H "Authorization: Bearer $MYLINQ_API_KEY"Response 200
{
"username": "nila",
"plan": "pro",
"usage": {
"links_created_this_month": 312,
"resets_at": "2026-11-01T00:00:00.000Z"
},
"limits": {
"requests_per_minute": 60,
"links_per_month": 10000,
"bulk_max": 100
}
}Try it
Paste a key from your dashboard and send a real request.
Questions or need higher limits? Email support@mylinq.cc.