Barion
API Documentation

Use the QRW API to create short links programmatically from your own applications.

Base URL:https://qrw.io/api/v1

Authentication

Every request must include your API key in the request header. You can obtain your API key from the Settings → API Keys page.

HeaderValue
X-Api-KeyYour API key

If the key is missing, invalid, or inactive the request is rejected with 401 Unauthorized.

Endpoints

POST/api/v1/link/create

Creates a short link with a redirect URL and optional labels.

Link reuse: If the authenticated user has an existing unused link (no redirect URL set) whose slug length matches the requested length, the oldest matching one is automatically reused — no new link is created and no credits are charged. Otherwise a new link slug is generated and credits are deducted as normal.

Query Parameters

NameTypeRequiredDefaultDescription
redirecturlstringYesThe destination URL to redirect to
labelsstringNonullComma-separated labels/tags for the link
lengthintegerNo20Slug length (min: 3, longer = cheaper). Also used to match existing unused links for reuse.

Responses

200 OKNew link created
{
  "link": "aB3kR7mN2xQpLsYt4vZw",
  "url": "https://qrw.io/aB3kR7mN2xQpLsYt4vZw",
  "linkId": 42,
  "cost": 10,
  "message": "success"
}
200 OKExisting unused link reused (0 credits charged)
{
  "link": "aB3kR7mN2xQpLsYt4vZw",
  "url": "https://qrw.io/aB3kR7mN2xQpLsYt4vZw",
  "linkId": 17,
  "cost": 0,
  "message": "success"
}
FieldTypeDescription
linkstringThe short link slug
urlstringFull short URL (https://qrw.io/{slug})
linkIdintegerInternal link ID
costintegerCredits deducted. 0 when an unused link was reused
messagestring"success"
200Insufficient credits
{ "error": "Not enough credits! Required: 10, available: 3" }
400Bad Request — Invalid length
{ "error": "Length must be at least 3" }
401Unauthorized — Invalid API key
{ "error": "Invalid or inactive API key" }
404Not Found — User not found
{ "error": "User not found" }

Credit Pricing

Shorter slugs cost more credits. The length parameter controls the slug length and its credit cost.

LengthCredits
312,500
47,000
52,000
6800
7300
8160
980
1040
11–1912–30
20+10

Examples

Create a new link (no unused links available):

curl -X POST "https://api.qrw.io/api/v1/link/create" \
  -H "X-Api-Key: your_api_key_here" \
  -d "redirecturl=https://example.com/my-page" \
  -d "labels=marketing,summer" \
  -d "length=8"
{
  "link": "aB3kRm7N",
  "url": "https://qrw.io/aB3kRm7N",
  "linkId": 42,
  "cost": 160,
  "message": "success"
}

Reuse an existing unused link of the same length (credits: 0):

curl -X POST "https://api.qrw.io/api/v1/link/create" \
  -H "X-Api-Key: your_api_key_here" \
  -d "redirecturl=https://example.com/new-campaign" \
  -d "length=20"
{
  "link": "xQpLsYt4vZwaB3kR7mN2",
  "url": "https://qrw.io/xQpLsYt4vZwaB3kR7mN2",
  "linkId": 17,
  "cost": 0,
  "message": "success"
}

Need an API key? Generate one from your account settings.

Go to Settings → API Keys