Plinkly API Reference

Build reliable link workflows with our robust HTTP API. Create short links, track analytics, and manage QR codes programmatically. Designed for developers.

Quickstart

The fastest way to integrate Plinkly into your application. All you need is your API token.

Base URL
https://plink.ly/apiv
Auth Header
Authorization: Bearer <token>
Content-Type
application/json

1. Create a Short Link

BASH (cURL)
curl -X POST "https://plink.ly/apiv/shorten" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/my-long-page",
    "slug": "custom-alias",
    "domain_id": 0
  }'

Authentication

Authenticate your requests by including your secret API token in the Authorization header. You can generate or manage your tokens from your Dashboard Settings.

HTTP Header
Authorization: Bearer 0123456789abcdef0123456789abcdef...

Note: API tokens carry many privileges, so be sure to keep them secure! Do not share your secret API tokens in publicly accessible areas such as GitHub, client-side code, and so forth.

POST /shorten

Create a new shortened link. If no slug is provided, a random one will be generated.

  • url (required): The destination URL.
  • slug (optional): Custom alias (e.g. 'summer-sale').
  • expire_days (optional): Days until link expires (0 = forever).

GET /stats

Retrieve analytics for a specific link. Returns click counts, browser data, and referrers.

BASH
curl "https://plink.ly/apiv/stats?slug=abc12" \
  -H "Authorization: Bearer YOUR_TOKEN"

DELETE /delete

Permanently remove a short link and its associated data.

BASH
curl -X DELETE "https://plink.ly/apiv/delete?slug=abc12" \
  -H "Authorization: Bearer YOUR_TOKEN"

Integrations (Signed Requests)

For server-to-server communication (like activating plans from external payment gateways), we use HMAC signatures instead of Bearer tokens for enhanced security.

Signature Algorithm

Compute the HMAC SHA-256 of timestamp + rawBody using your shared secret.

Pseudo Code
signature = HMAC_SHA256(secret, timestamp + rawJSONBody)

// Headers to send:
X-G2PICK-TIMESTAMP: {timestamp}
X-G2PICK-SIGNATURE: {signature}