API Reference

Brevix REST API — create, manage and get stats for short links.

All /api/v1 endpoints require an X-Api-Key: bvx_… header. Generate a key from your Dashboard → API Key.
POST /api/v1/links

Create a short link.

FieldTypeRequired
destinationstringYes
aliasstringNo
expires_atISO 8601No
max_clicksintegerNo
link_passwordstringNo

Example

curl -X POST https://brevix.in/api/v1/links \
  -H "X-Api-Key: bvx_your_key" \
  -H "Content-Type: application/json" \
  -d '{"destination":"https://example.com","alias":"mybrand"}'
{
  "link": { "id": 1, "code": "mybrand", ... },
  "short_url": "https://brevix.in/mybrand"
}
GET /api/v1/links

List your short links.

Query paramDefault
page1
limit20 (max 100)

Example

curl https://brevix.in/api/v1/links?page=1&limit=20 \
  -H "X-Api-Key: bvx_your_key"
PATCH /api/v1/links/:code

Update a link's destination, expiry or click limit.

FieldType
destinationstring (required)
expires_atISO 8601 / null
max_clicksinteger / null

Example

curl -X PATCH https://brevix.in/api/v1/links/mybrand \
  -H "X-Api-Key: bvx_your_key" \
  -H "Content-Type: application/json" \
  -d '{"destination":"https://new-target.com"}'
DELETE /api/v1/links/:code

Delete a short link permanently.

Example

curl -X DELETE https://brevix.in/api/v1/links/mybrand \
  -H "X-Api-Key: bvx_your_key"
GET /api/v1/links/:code/stats

Full click breakdown: daily, by country, device, browser, and top referrers.

Example

curl https://brevix.in/api/v1/links/mybrand/stats \
  -H "X-Api-Key: bvx_your_key"
GET /api/v1/links/:code/qr

Get QR code as PNG or SVG.

Query paramDefault
formatpng
fg000000
bgffffff
size300 (100–1000)

Example

curl "https://brevix.in/api/v1/links/mybrand/qr?format=svg&size=400" \
  -H "X-Api-Key: bvx_your_key" \
  -o mybrand.svg
POST /api/v1/keys

Generate or rotate your API key. Requires cookie auth (call from the dashboard or a browser session).

Returns {"api_key":"bvx_…"}. The raw key is shown once — the server stores a SHA-256 hash.

Rate limits