Links API
Operations
| Method | Path | Key scope |
|---|---|---|
| POST | /api/v1/links | links:write |
| GET | /api/v1/links | links:read |
| GET | /api/v1/links/{identifier} | links:read |
| PUT | /api/v1/links/{identifier} | links:write |
| DELETE | /api/v1/links/{identifier} | links:write, links:delete |
| GET | /api/v1/links/{shortCode}/qr | links:read |
Use the link identifier or short code accepted by the server's identifier resolver. For authentication, see project scope.
Create
{
"originalUrl": "https://example.com/offer",
"behavior": "STANDARD",
"utmSource": "newsletter",
"utmMedium": "email",
"utmCampaign": "example"
}
originalUrl and behavior are required. Other documented fields include customAlias, expiresAt (ISO 8601), ogTitle, ogDescription, ogImageUrl, doIndex, targeting, deep-link configuration and the five UTM values. Only use advanced fields after checking the current schema. tags and title are not creation fields.
Creation returns 201; listing returns a page with content, totalElements, totalPages, number and size. page is zero-based. Supported list filters include search, status, behavior, from, to, campaignId, hasCampaign and tagIds.
List links
tagIds keeps the links carrying at least one of the given tags (OR). Send it comma-separated (tagIds=t1,t2) or repeated (tagIds=t1&tagIds=t2); the result is the same. At most 20 tag IDs per call: beyond that the server answers 400 TAG_FILTER_TOO_LARGE. A tag ID that does not belong to the project matches nothing and returns an empty page, not an error.
curl -H "Authorization: Bearer $SLNK_API_KEY" \
"https://api.recette.slnk.ma/api/v1/links?tagIds=$TAG_SMS,$TAG_EMAIL"
Search engine indexing
doIndex (boolean, default false) controls whether search engines may index the short link. While it is false, every public response of the link (redirect, social preview, password page, expired page, interstitial) carries X-Robots-Tag: noindex. Set it to true on create or update for a public page you want listed under its short link; LinkResponse.doIndex returns the current value. Channel variants follow their parent link. Unknown codes, suspended links and the inspect page are always noindex.
Update and expiry
Use PUT on an existing identifier. To remove an expiry, send clearExpiresAt: true; an omitted expiry preserves the existing value. A transition to STANDARD or ROUTING clears mobile deep-link configuration and structured payload. Do not combine an explicit expiry and a request to clear it.
The expiry fallback, when configured, applies after expiry. Without a fallback the expired-link response is used. Do not treat link deletion as an analytics privacy erasure.
QR code
GET renders a QR code for the existing short code. For a logo image, prefer POST on the same QR path with the documented render request. Only supported PNG/JPEG logo input and server size limits are accepted.