API Documentation
Everything below reflects the live public API. Every endpoint on this page works today.
Base URL
https://getmicrourl.com/api/v1Authentication
Every request needs an API key in the Authorization header. Generate one from Dashboard → Settings.
Authorization: Bearer ck_live_...Try it
Sign in to try this with a real API key instead of a placeholder.
curl -X POST https://getmicrourl.com/api/v1/links \
-H "Authorization: Bearer ck_live_..." \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/a-very-long-page" }'Response format
Every successful response is wrapped in a data envelope:
{ "data": ... }List endpoints add a pagination key:
{ "data": [...], "pagination": { "nextCursor": "lnk_..." } }Errors follow the same shape, always with a machine-readable code:
{ "error": { "code": "not_found", "message": "Link not found" } }| Error code | HTTP status |
|---|---|
invalid_request | 400 |
unauthenticated | 401 |
forbidden | 403 |
not_found | 404 |
slug_taken | 409 |
domain_not_active | 409 |
plan_limit_reached | 402 |
malicious_url | 400 |
rate_limited | 429 |
internal_error | 500 |
Rate limits
Limits are per API key, per minute, based on your plan. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers. A 429 response also includes Retry-After.
| Plan | Limit |
|---|---|
| Free | 10 requests/min |
| Lite | 30 requests/min |
| Starter | 60 requests/min |
| Growth | 300 requests/min |
| Business | 600 requests/min |
Endpoints
/linksCreate a short link. If no slug is given, one is generated.
curl -X POST https://getmicrourl.com/api/v1/links \
-H "Authorization: Bearer ck_live_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/a-very-long-page",
"slug": "my-link",
"title": "My link",
"utm": { "source": "twitter", "medium": "social" },
"tags": ["Acme Co", "Spring sale"]
}'Body: url (required), slug, title, expiresAt (ISO 8601), utm.{source,medium,campaign,term,content}, domainId, tags are all optional. UTM fields are added to the destination when someone clicks, so your analytics tool credits the right campaign. tags is an array of up to 10 labels (1–40 characters each) for grouping links by client, listing or event; matching ignores case. The destination URL is checked against Google Web Risk before the link is created; a known-malicious URL is rejected with malicious_url.
domainId creates the link on one of your custom domains (Settings → Domains in the dashboard) instead of the default mirl.cc. It must already be verified (“Active” status), or the request is rejected with domain_not_active. There’s no public endpoint to list your domain IDs yet, so copy the ID from the dashboard.
Returns 201 with the created link.
/linksList links for your organization, newest first.
curl "https://getmicrourl.com/api/v1/links?limit=20" \
-H "Authorization: Bearer ck_live_..."Query params: limit (max 100, default 20), cursor (from the previous response’s pagination.nextCursor).
/links/:idFetch a single link by ID.
curl https://getmicrourl.com/api/v1/links/lnk_abc123 \
-H "Authorization: Bearer ck_live_..."/links/:id/analyticsOne link’s clicks, the same numbers as its Analytics tab. range is 7d, 30d (default) or 90d; bots are left out unless you add bots=include.
curl "https://getmicrourl.com/api/v1/links/lnk_abc123/analytics?range=7d" \
-H "Authorization: Bearer ck_live_..."Returns totalClicks, visitors (different devices, once a day each, added up), previousPeriodClicks (the same number of days before; null when your plan keeps less history), daily (one entry per day), and countries, referrers, devices, systems, languages, browsers and aiCrawlers. updates is hourly on the Free plan, whose clicks arrive in hourly batches.
/links/:idUpdate a link. The slug cannot be changed, because editing a slug would break every existing short URL pointing at it. Edit the destination URL instead.
curl -X PATCH https://getmicrourl.com/api/v1/links/lnk_abc123 \
-H "Authorization: Bearer ck_live_..." \
-H "Content-Type: application/json" \
-d '{ "destinationUrl": "https://example.com/new-target", "isActive": true }'Updatable fields: destinationUrl, title, isActive, expiresAt, fallbackUrl, inAppBypassEnabled, tags, slug. Sending tags replaces the link’s whole set; [] removes every tag. A new slug changes the link’s ending and the old one keeps redirecting (up to 5 old endings; a taken ending answers slug_taken). Responses for a single link include its tags.
/links/:idDelete a link. Returns 204 with no body.
curl -X DELETE https://getmicrourl.com/api/v1/links/lnk_abc123 \
-H "Authorization: Bearer ck_live_..."/links/bulkSend up to 100 links in one request. Each row succeeds or fails independently. The first 5 rows are created; any after that come back with the error code not_processed, so send them again in another request (or send 5 at a time). Add domainId next to links to put every link on one of your active custom domains.
curl -X POST https://getmicrourl.com/api/v1/links/bulk \
-H "Authorization: Bearer ck_live_..." \
-H "Content-Type: application/json" \
-d '{
"links": [
{ "url": "https://example.com/one" },
{ "url": "https://example.com/two", "slug": "two" }
]
}'Response: an array with one result per input row.
{
"data": [
{ "index": 0, "status": "success", "link": { ... } },
{ "index": 1, "status": "error", "error": { "code": "slug_taken", "message": "..." } }
]
}/pagesCreate a link-in-bio page and the short link that opens it. Up to 12 buttons and 6 social links; every URL is checked like a link’s destination, and the short link counts toward your plan. Add domainId to use a custom domain.
curl -X POST https://getmicrourl.com/api/v1/pages \
-H "Authorization: Bearer ck_live_..." \
-H "Content-Type: application/json" \
-d '{
"page": {
"title": "Rosa’s Kitchen",
"description": "Austin’s family kitchen since 1998",
"buttons": [{ "label": "Book a table", "url": "https://example.com/book" }],
"socials": ["https://instagram.com/rosaskitchen"]
}
}'Returns the page (id, linkId, content) and its shortUrl. GET /pages lists your pages, GET /pages/:id fetches one, and PATCH /pages/:id replaces its content with the same page fields (send the whole page); the short link and any printed QR code keep working. To delete a page, delete its link.
Questions
Email hello@getmicrourl.com. This API is actively growing, and feedback shapes what we build next.