Short Links

Short Links

Manage your short links — create, retrieve, update, and delete.

Endpoints

MethodPathDescription
GET/v1/client/short-linksList all short links
POST/v1/client/short-linksCreate a short link
GET/v1/client/short-links/{short_code}Get a short link
PUT/v1/client/short-links/{short_code}Update a short link
DELETE/v1/client/short-links/{short_code}Delete a short link

List Short Links

Returns a paginated list of short links belonging to the authenticated user.

GET /client/short-links

Query parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger10Items per page
sort_columnstringcreated_atColumn to sort by
sort_typestringdescSort direction: asc or desc

Example request

curl "https://api.linx.ly/v1/client/short-links?page=1&per_page=10&sort_column=created_at&sort_type=desc" \
  -H "Authorization: Bearer your_access_token_here" \
  -H "Accept: application/json"

Response 200 OK

{
  "data": [
    {
      "id": 45,
      "utm_id": null,
      "short_code": "a7b8c9d",
      "status": true,
      "destination_url": "https://google.com",
      "created_at": "2026-06-04 12:20:00",
      "clicks_count": 0,
      "utm": null
    }
  ],
  "links": {
    "first": "https://api.linx.ly/v1/client/short-links?page=1",
    "last": "https://api.linx.ly/v1/client/short-links?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      { "url": null, "label": "« Previous", "active": false },
      { "url": "https://api.linx.ly/v1/client/short-links?page=1", "label": "1", "active": true },
      { "url": null, "label": "Next »", "active": false }
    ],
    "path": "https://api.linx.ly/v1/client/short-links",
    "per_page": 10,
    "to": 1,
    "total": 1
  }
}

Short link object fields

FieldTypeDescription
idintegerUnique identifier
short_codestringThe short code used in the URL
statusbooleanWhether the link is active
destination_urlstringThe URL the short link redirects to
clicks_countintegerTotal number of clicks
utm_idinteger | nullAssociated UTM config ID, if any
utmobject | nullUTM parameters, if configured
created_atstringISO 8601 creation timestamp

Create Short Link

Creates a new short link. The short code can be auto-generated or custom.

POST /client/short-links

Request body

FieldTypeDescription
destination_urlstringThe destination URL to redirect to
short_codestringCustom short code. Omit to auto-generate.

Auto-generated short code

Omit short_code to let the API generate a random code.

curl -X POST https://api.linx.ly/v1/client/short-links \
  -H "Authorization: Bearer your_access_token_here" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"destination_url": "https://google.com"}'

Response 200 OK

{
  "data": {
    "id": 45,
    "short_code": "a7b8c9d",
    "destination_url": "https://google.com",
    "user_id": 12,
    "created_at": "2026-06-04 12:20:00",
    "updated_at": "2026-06-04 12:20:00",
    "utm": null,
    "schedules": []
  }
}

Error responses

CodeReason
400Tariff limit reached
401Invalid or missing token
422Short code already taken (custom code only)

See Error Codes for response bodies.


Get Short Link

Returns details of a specific short link by its short code.

GET /client/short-links/{short_code}

Path parameters

ParameterTypeDescription
short_codestringThe short code of the link

Example request

curl https://api.linx.ly/v1/client/short-links/mycustom \
  -H "Authorization: Bearer your_access_token_here" \
  -H "Accept: application/json"

Response 200 OK

{
  "data": {
    "id": 46,
    "short_code": "mycustom",
    "destination_url": "https://google.com",
    "user_id": 12,
    "created_at": "2026-06-04 12:20:00",
    "updated_at": "2026-06-04 12:20:00",
    "utm": null,
    "schedules": []
  }
}

Error responses

404 — resource not found. See Error Codes.


Update Short Link

Updates the destination URL or other metadata of an existing short link.

PUT /client/short-links/{short_code}

Path parameters

ParameterTypeDescription
short_codestringThe short code of the link to update

Request body

FieldTypeDescription
destination_urlstringNew destination URL

Example request

curl -X PUT https://api.linx.ly/v1/client/short-links/mycustom \
  -H "Authorization: Bearer your_access_token_here" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"destination_url": "https://github.com"}'

Response 200 OK

{
  "data": {
    "id": 46,
    "short_code": "mycustom",
    "destination_url": "https://github.com",
    "user_id": 12,
    "created_at": "2026-06-04 12:20:00",
    "updated_at": "2026-06-04 12:25:00",
    "utm": null,
    "schedules": []
  }
}

Error responses

422 — plan does not allow editing destination URL. See Error Codes.


Delete Short Link

Permanently deletes a short link along with its click logs and schedules.

DELETE /client/short-links/{short_code}

Path parameters

ParameterTypeDescription
short_codestringThe short code of the link to delete

Example request

curl -X DELETE https://api.linx.ly/v1/client/short-links/mycustom \
  -H "Authorization: Bearer your_access_token_here" \
  -H "Accept: application/json"

Response 200 OK

{
  "message": "Short link deleted successfully."
}
🚫

Deletion is permanent. Click logs and schedule data associated with the link are also removed and cannot be recovered.