πŸ”’
⭐ PREMIUM FEATURE

API is available with Premium or annual subscription only

The API documentation and API access are available only to paying users with a monthly or annual subscription.

Upgrade now

API Documentation

Use our API to create and manage links programmatically.

πŸ” Authentication

Two options: (a) JWT from the login (ritter-systems.de account) or (b) API key (30 characters, granted to Premium users by the administrator). Programmatic API access is reserved for Premium/Overall-Premium users β€” Free/Registered users use the web interface.

Authorization: Bearer <JWT from the login>
X-API-Key: <30-character API token (Premium)>

πŸ”— Create link

Create a new short link.

POST /directlink/api/create.php

Request body

{
  "target_url": "https://example.com/very/long/url",
  "custom_code": "my-link",    // Optional, 3-50 chars (Premium)
  "payment_type": "free"
}

Response (success)

{
  "success": true,
  "message": "Link created successfully",
  "link": {
    "id": 123,
    "short_code": "abc123",
    "short_url": "https://ritter-systems.de/directlink/r/abc123",
    "target_url": "https://example.com/very/long/url",
    "payment_type": "free",
    "is_paid": false
  }
}

πŸ“¦ Quotas (Admin 15.09.2026)

Free (unregistered)10 links, each valid for 1 month β€” then an "expired" page. Notice mail after 21 days (if an email is on file).
Registered20 links valid permanently.
Premium100 links valid permanently (€2.99/month).
Overall PremiumUnlimited links valid permanently (€20/month).

New links are rejected once the quota is exhausted (HTTP 429). Only active links are counted β€” expired links do not consume quota. Expired links are deactivated daily and marked as "expired" in the overview (no data loss).

πŸ“Š Statistics

Fetch general statistics.

GET /directlink/api/stats.php

Response

{
  "success": true,
  "links": 150,
  "clicks": 2450,
  "users": 42
}

πŸ“‹ Fetch my links

Fetch all links of the logged-in user.

GET /directlink/api/dashboard.php

Response

{
  "success": true,
  "links": [
    {
      "id": 1,
      "short_code": "abc123",
      "target_url": "https://example.com",
      "click_count": 42,
      "created_at": "2026-08-27 10:00:00"
    }
  ]
}

πŸ“ˆ Fetch quota (usage.php)

Active links vs. the quota of your own plan.

POST /directlink/api/usage.php

Response (success)

{
  "success": true,
  "plan": "guest",
  "usage": { "active": 3, "limit": 10, "remaining": 7 },
  "pricing": { ... }
}

πŸ—‘οΈ Delete link (delete.php) β€” once, soft delete

POST /directlink/api/delete.php

Request body

{ "code": "abc123" }

Marks the link as "deleted" once (is_deleted): no longer shown in the dashboard, no more redirects, data stays in the database (billing-relevant history).

πŸ” Check target validity (check-links.php)

POST /directlink/api/check-links.php

Request body

{ "code": "abc123" }    // optional β€” without code: all own links

Checks every target via HTTP (HEAD, fallback GET, 12 s timeout) and sets last_check/check_status/fail_count. Status: ok (2xx/3xx), invalid (404/410), unreachable (timeout/DNS).

Daily job (05:15): checks all active links, deactivates expired ones, automatically deletes links that failed 3 times in a row.

⚠️ Error codes

Code Meaning
400 Invalid request (missing parameters)
401 Unauthorized (invalid token)
404 Link not found
409 Conflict (e.g. code already taken)
401 Not logged in (guests use the web interface)
403 No access (foreign link)
429 Quota reached (Free 10 Β· Registered 20 Β· Premium 100)
500 Server error