Skip to main content

Link management API

Seven endpoints for managing your organization's deep links from any HTTP client — no SDK required. Every request authenticates with your Server API Key:

Authorization: Bearer opl_api_…

A mobile SDK key (opl_sdk_…) on these routes returns 403. Plan and org rules match the portal: links count against your plan's quota, and your org must have a registered app config before the first link. See Plans & pricing for the limits.

Endpoints​

MethodPathPurpose
POST/linksCreate a deep link
GET/linksList links (paginated)
GET/links/:idRead one link
PATCH/links/:idUpdate a link
DELETE/links/:idDelete a link
GET/links/:id/qr.svgQR code as SVG
GET/links/:id/qr.pngQR code as PNG
curl -X POST https://<your-optolink-host>/links \
-H "Authorization: Bearer opl_api_…" \
-H "Content-Type: application/json" \
-d '{
"path": "/product/123",
"domainId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}'

path (the in-app destination, e.g. /product/123) is the one required field. Omit domainId to use your organization's default domain. Optional fields mirror the portal's create form: shortCode, channel, UTM fields (utmSource, utmMedium, utmCampaign, utmTerm, utmContent), fallbackUrl, OG tags (og.title, og.description, og.imageUrl), title, tags, expiry, templateId, params.

Returns 201 with the created link, including its id and the resolved short URL.

curl "https://<your-optolink-host>/links?page=1&limit=20&isActive=true" \
-H "Authorization: Bearer opl_api_…"
QueryDefaultNotes
page11-based
limit20Max 100
isActivealltrue or false

Returns 200 with a paginated body: { data: [...], total, page, limit }.

PATCH /links/:id accepts the same optional fields as create. Returns 200 with the updated link, 404 if the ID isn't in your organization.

DELETE /links/:id returns 200 on success, 404 if not found. Deletion is permanent — resolution stops immediately.

QR codes​

GET /links/:id/qr.svg and GET /links/:id/qr.png return the QR image for the link's short URL with the matching Content-Type. Use these to regenerate QR assets after rotating artwork without re-creating the link.

Errors​

StatuscodeWhen
400—Validation error (bad field, unknown channel, malformed UUID)
401—Missing/invalid key, or organization suspended
402QUOTA_EXCEEDEDLink quota for your plan reached (quota: "links" in the body)
403—Wrong key tier for the route
404—Link or domain not in your organization
428APP_CONFIG_REQUIREDNo app config registered — set up your app first

Rate limits apply per key: reads and QR generation use the resolution-tier limit, writes the creation-tier limit (see Rate limits & errors).