Links API

Create, list, update, and delete short links programmatically

The Links API gives you full programmatic control over your short links — create them with custom slugs and UTM parameters, list and search them, update their destinations, and delete them when no longer needed.

Create a Short Link

POST /api/createShort

Creates a new short link. The destination URL must be Base64-encoded in the long field.

Request body

Field Type Required Description
long string Yes Base64-encoded destination URL
customSlug string No Custom alias for the short link (Pro plan). Must be unique. Returns 409 if taken.
expiry ISO 8601 No Expiry date and time after which the link will no longer redirect (e.g. 2026-12-31T23:59:59Z)
password string No Password gate — visitors must enter this password before being redirected (Pro plan)
utmSource string No UTM source parameter appended to the destination URL
utmMedium string No UTM medium parameter appended to the destination URL
utmCampaign string No UTM campaign name appended to the destination URL
folderId string No ID of an existing folder to place this link in

Response

{
  "shortUrl": "abc123",
  "fullPath": "abc123",
  "url": "https://awsys.co/abc123"
}

Use the url field for the full clickable URL. shortUrl returns the slug only.

curl example

curl -X POST https://awsys.co/api/createShort \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "long": "aHR0cHM6Ly9leGFtcGxlLmNvbS9sYW5kaW5nLXBhZ2U=",
    "customSlug": "my-campaign",
    "utmSource": "newsletter",
    "utmMedium": "email",
    "utmCampaign": "spring2026"
  }'

List Links

GET /api/links

Returns a paginated list of your short links.

Query parameters

Parameter Type Description
page integer Page number (1-indexed, default 1)
limit integer Results per page (default 20, max 100)
folderId string Filter by folder ID
search string Full-text search across slug and destination URL

curl example

curl "https://awsys.co/api/links?page=1&limit=20&search=campaign" \
  -H "Authorization: Bearer YOUR_API_KEY"

Update a Link

PATCH /api/links/:id

Update one or more fields on an existing link. All body fields are optional — only the fields you provide will be updated.

curl example

curl -X PATCH "https://awsys.co/api/links/LINK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "long": "aHR0cHM6Ly9leGFtcGxlLmNvbS9uZXctZGVzdGluYXRpb24=",
    "expiry": "2026-12-31T23:59:59Z"
  }'

Delete a Link

DELETE /api/links/:id

Permanently deletes a short link. Deleted links return 404 when visited. This action cannot be undone.

curl example

curl -X DELETE "https://awsys.co/api/links/LINK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"

On success, the response is 204 No Content.