REST API / Credit: Depositphotos
REST API / Credit: Depositphotos

LinkVice REST API: Automate Your Redirect Management

Tomas Rohlena Published Updated

LinkVice is not just a dashboard — it's a fully programmable redirect management platform. With our REST API, you can automate every part of your redirect workflow: add a domain, configure its redirect with every option the dashboard offers, and pull the click statistics back into your own tools.

What's New in API v1.1

Version 1.1 (October 2026) extends the API without breaking existing integrations:

  • Domain + redirect in one request — POST /domains accepts an optional redirect object. If the redirect is invalid, nothing is created.
  • Every redirect option — language rules, path rules, bot blocking with a whitelist, image redirects, favicon/robots.txt/ads.txt/llm.txt handling, URI passing, UTM and custom parameters.
  • Path rules — send individual URLs on a domain to different targets (exact, prefix or regex match).
  • Nested routes — GET and POST /domains/{id}/redirects, and POST /redirects accepts a domain name instead of an ID.
  • Update domains — PUT /domains/{id} turns SSL on or off.
  • Domain health — domain objects now include dns_state, dns_target, error_message and redirect_count.
  • Safe deletes — deleting a domain that still has redirects returns an error unless you pass ?force=1.
  • Clearer errors — 422 for validation errors, 409 for conflicts (duplicate domain, path already mapped).

Old requests keep working: the legacy type parameter for the HTTP code, from/to date parameters in statistics and language rules sent as an object are all still accepted.

Full API Access

  • Domains — list, add, update, check status and remove custom domains
  • Redirects — create, update and delete redirects with all options; partial updates with PUT
  • Statistics — total clicks, unique visitors, clicks by date, response status breakdown, top languages and referrers, and top redirects per domain, filterable by date range
  • Blacklist — manage IP, User-Agent and URI rules

Authentication and Rate Limits

Generate an API key in your Dashboard Settings and send it as a Bearer token:

Authorization: Bearer YOUR_API_KEY

Each key can make 100 requests per minute. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; when you exceed the limit, you get 429 with a retry_after value.

Example: Add a Domain With Its Redirect

One request adds the domain, enables free SSL and configures the redirect — including a German-language target, bot blocking, URI passing and a path rule:

POST /api/v1/domains
{
    "domain": "go.example.com",
    "use_ssl": true,
    "redirect": {
        "target_url": "https://www.mysite.com/",
        "http_code": 301,
        "language_rules": { "de": "https://www.mysite.de/" },
        "block_bots": true,
        "bot_whitelist": ["Googlebot"],
        "pass_uri": true,
        "utm_source": "linkvice",
        "path_rules": [
            { "source_path": "/old-page", "target_url": "https://www.mysite.com/new-page" }
        ]
    }
}

The response contains the domain with status: "pending_dns" and the dns_target to set (A record or nameservers). Once DNS points to us, the domain becomes active and SSL is issued automatically. You can poll GET /domains/{id} or simply wait for the email.

Example: Add a Redirect With PHP

Use the domain name directly — no need to look up its ID first:

<?php
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => 'https://www.linkvice.com/api/v1/redirects',
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_API_KEY',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'domain'        => 'go.example.com',
        'target_url'    => 'https://example.com/landing',
        'redirect_type' => 'hash',   // short link: go.example.com/r/AbC123
        'http_code'     => 302,
        'utm_campaign'  => 'spring-sale',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);

echo $response['data']['redirect_url'];

Path Rules

A redirect that covers a whole domain can route individual URLs elsewhere. Path rules are checked before the main target:

  • exact — only this path, e.g. /old-page
  • prefix — the path and everything below it, e.g. /blog; the rest of the path is appended to the target
  • regex — a pattern such as ^/p/(\d+)$, with $1…$9 available in the target URL

This makes the API a good fit for site migrations: export your old URL map and create the rules in one request.

Domain Status and Monitoring

Domain objects tell you exactly where a domain stands: pending_dns, active, ssl_pending or ssl_active, plus a dns_state. We check every domain daily:

  • ok — DNS points to our server
  • cloudflare — the domain uses the Cloudflare proxy and requests reach us through it (it works like ok)
  • not_pointed — DNS no longer points to us; SSL is paused until it does

SDKs

Early versions of our SDK libraries are available on GitHub: PHP, Python and JavaScript. The API is plain JSON over HTTPS, so any HTTP client works too — including for the v1.1 parameters.

Use Cases

Domain Portfolio Management

Point dozens of domains at the right destinations with a script, then track which ones get real traffic through the statistics endpoints.

Marketing Automation

Create campaign-specific redirects with UTM parameters from your marketing platform and pull clicks back into your reporting.

Site Migrations and CI/CD

Create path rules from your old URL structure, or update redirect targets automatically as part of a deployment.

Multi-Tenant Platforms

Build redirect services on top of LinkVice — each of your clients gets their own domains and redirects, managed through the API.

Full documentation with parameters, responses and code examples for every endpoint: API Documentation →