Developers

API reference

Everything the Lynkio API can do, generated from the live spec.

Base URL: https://lynkio.org/api/v1. Create a key in Developers and send it as Authorization: Bearer lk_…. Starter keys can read; Pro and Agency keys can also write, and any key can be made read-only. The machine-readable spec is at /api/v1/openapi.json: import it into Postman or Insomnia, or generate a client from it.

Pages of resultsLists return data, has_more and next_cursor. Pass ?cursor= for the next page. Up to 100 per page.
Safe retriesSend an Idempotency-Key header on POST. Repeating the request within 24 hours returns the first response instead of creating twice.
Limits120 requests a minute per key, plus a daily limit by plan. Responses carry X-RateLimit-Limit and X-RateLimit-Remaining. Over the limit you get 429 with Retry-After.
ErrorsAlways JSON: {"error": {"type", "message", "status"}}. Types: invalid_request, unauthorized, forbidden, not_found, conflict, rate_limited.
Click IDsAdd {clickid} to a destination URL. Send it back on POST /sales as click_id and the sale is tied to the click, its link and campaign.
Webhookssale.created, sale.updated, lead.created, link.* and alert.triggered are pushed to you, signed with X-Lynkio-Signature-V2. Set them up in Developers.

Account

Who the key belongs to, plan limits and usage.

GET/meYour account, plan and API limits

Example

curl -X GET "https://lynkio.org/api/v1/me" \
  -H "Authorization: Bearer YOUR_KEY"

Create, read, change and delete short links.

POST/linksCreate a link

JSON body

FieldTypeDescription
destination_urlrequiredstring
titlestring
slugstring
slug_autoboolean
rootboolean
domain_idinteger
campaign_idinteger
campaignstring
source_routesarray
rulesarray
og_titlestring
og_descriptionstring
og_imagestring
pixel_idstring
deep_linkboolean
adultboolean
gamblingboolean
block_botsboolean
cloakboolean
utm_sourcestring
utm_mediumstring
utm_campaignstring
utm_termstring
utm_contentstring
sub_id_1string
sub_id_2string
payoutnumber
costnumber
descriptionstring
tagsarray
expires_atstring
passwordstring

Example

curl -X POST "https://lynkio.org/api/v1/links" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 5f0c2a" \
  -d '{"destination_url":"https://example.com/offer","title":"Spring offer"}'

Clicks

Raw click events, newest first.

GET/clicksRaw clicks across all links

Parameters

NameInTypeDescription
limitqueryinteger
cursorquerystring
sincequerystringOnly clicks after this time (ISO 8601, UTC).
botsquerybooleanInclude bot and link-preview visits.

Example

curl -X GET "https://lynkio.org/api/v1/clicks" \
  -H "Authorization: Bearer YOUR_KEY"

Campaigns

Group links, read campaign results and push ad spend.

GET/campaignsList campaigns, newest first

Parameters

NameInTypeDescription
limitqueryinteger
cursorquerystring

Example

curl -X GET "https://lynkio.org/api/v1/campaigns" \
  -H "Authorization: Bearer YOUR_KEY"
POST/campaignsCreate a campaign

JSON body

FieldTypeDescription
namerequiredstring

Example

curl -X POST "https://lynkio.org/api/v1/campaigns" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 5f0c2a" \
  -d '{"name":"Spring launch"}'
GET/campaigns/{campaign_id}Get one campaign

Parameters

NameInTypeDescription
campaign_idrequiredpathinteger

Example

curl -X GET "https://lynkio.org/api/v1/campaigns/{campaign_id}" \
  -H "Authorization: Bearer YOUR_KEY"
GET/campaigns/{campaign_id}/analyticsAnalytics for one campaign

Parameters

NameInTypeDescription
campaign_idrequiredpathinteger
rangequeryintegerDays back, within your plan's history.
endquerystringLast day of the period (YYYY-MM-DD). Defaults to today.

Example

curl -X GET "https://lynkio.org/api/v1/campaigns/{campaign_id}/analytics" \
  -H "Authorization: Bearer YOUR_KEY"
GET/campaigns/{campaign_id}/spendAd spend entries for a campaign

Parameters

NameInTypeDescription
campaign_idrequiredpathinteger

Example

curl -X GET "https://lynkio.org/api/v1/campaigns/{campaign_id}/spend" \
  -H "Authorization: Bearer YOUR_KEY"
POST/campaigns/{campaign_id}/spendAdd ad spend to a campaign

Parameters

NameInTypeDescription
campaign_idrequiredpathinteger

JSON body

FieldTypeDescription
amountrequirednumberAmount spent, in USD.
datestringDay of the spend (YYYY-MM-DD). Defaults to today.
sourcestringWhere the money went, for example facebook, google or tiktok.
notestring

Example

curl -X POST "https://lynkio.org/api/v1/campaigns/{campaign_id}/spend" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 5f0c2a" \
  -d '{"amount":120.5,"date":"2026-11-20","source":"facebook"}'

Sales

Read sales, record new ones and refunds.

GET/salesList sales, newest first

Parameters

NameInTypeDescription
limitqueryinteger
cursorquerystring
sincequerystringOnly sales after this time (ISO 8601, UTC).
link_idqueryinteger
campaign_idqueryinteger
statusquerystringcounted (default: all), or one status such as refunded.

Example

curl -X GET "https://lynkio.org/api/v1/sales" \
  -H "Authorization: Bearer YOUR_KEY"
POST/salesRecord a sale

JSON body

FieldTypeDescription
amountrequirednumberSale amount in `currency`.
currencystringISO currency code. Converted to USD with the day's rate.
event_idstringYour unique ID for this sale. Sending the same ID again never adds a second sale; a new status (for example refunded or rejected) updates it.
click_idstringThe {clickid} value Lynkio added to your destination URL. Ties the sale to the click.
linkstringShort link slug or URL, used when there is no click_id.
event_namestringFor example purchase, subscription or upsell.
statusstringapproved (default), pending, rejected, cancelled or refunded.
occurred_atstringWhen the sale happened (ISO 8601; without a time zone it is read as UTC). Defaults to now. Cannot be in the future.
emailstringCustomer email (optional). Hashed with SHA-256 at once and only used to match the sale in Meta, Google and TikTok. Never stored as text.
phonestringCustomer phone with country code (optional). Hashed like email.

Example

curl -X POST "https://lynkio.org/api/v1/sales" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 5f0c2a" \
  -d '{"amount":49,"currency":"USD","event_id":"order_8812","click_id":"1a2b3c-9f8e7d6c5b"}'
GET/sales/{sale_id}Get one sale

Parameters

NameInTypeDescription
sale_idrequiredpathinteger

Example

curl -X GET "https://lynkio.org/api/v1/sales/{sale_id}" \
  -H "Authorization: Bearer YOUR_KEY"
POST/sales/{sale_id}/refundRefund a sale (full or partial)

Parameters

NameInTypeDescription
sale_idrequiredpathinteger

JSON body

FieldTypeDescription
amountnumberRefunded amount in the sale's currency. Leave out or 0 for a full refund.

Example

curl -X POST "https://lynkio.org/api/v1/sales/{sale_id}/refund" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 5f0c2a" \
  -d '{"amount":10}'

Leads

Leads collected by your landing pages.

GET/leadsList leads, newest first

Parameters

NameInTypeDescription
page_idqueryinteger
qquerystring
limitqueryinteger
cursorquerystring

Example

curl -X GET "https://lynkio.org/api/v1/leads" \
  -H "Authorization: Bearer YOUR_KEY"

Stats

Account totals for a period.

GET/statsAccount totals for a period

Parameters

NameInTypeDescription
rangequeryintegerDays back, within your plan's history.

Example

curl -X GET "https://lynkio.org/api/v1/stats" \
  -H "Authorization: Bearer YOUR_KEY"

Domains

Your custom domains.

GET/domainsList your custom domains

Example

curl -X GET "https://lynkio.org/api/v1/domains" \
  -H "Authorization: Bearer YOUR_KEY"