📘
Lynx
GitHub
  • Welcome
  • Installation
    • Installation
      • Native
      • Docker
    • Post Installation
    • Environment Variables
  • Guides
    • Backups
  • API
    • Using the API
    • API Reference
      • Accounts
      • Users
      • Links
      • Import
      • Export
      • About
      • ShareX
  • Roadmap
Powered by GitBook
On this page
  • Link Retrieval
  • Get link destination by slug
  • Get full link by slug
  • Retrieve paginated links
  • Link Management
  • Create link
  • Update link
  • Delete link

Was this helpful?

Edit on GitHub
  1. API
  2. API Reference

Links

Link Retrieval

Get link destination by slug

GET https://demo.getlynx.dev/api/link

Retrieves the destination of link by its slug (unauthed).

Query Parameters

Name
Type
Description

slug*

String

The slug of the link

{
    "success": true,
    "result": {
        "destination": "https://github.com/Lynx-Shortener/Docs",
    }
}

Get full link by slug

GET https://demo.getlynx.dev/api/link

Retrieves the full link information by its slug.

Query Parameters

Name
Type
Description

id*

String

The slug of the link

Headers

Name
Type
Description

Authorization

String

Your API key

Cookies

Name
Type
Description

token

String

Your JWT Session

{
    "success": true,
    "result": {
        "id": "6023f6ec-4283-4ece-a4de-5acbb30357d9",
        "slug": "qKK0AR34",
        "destination": "https://github.com/Lynx-Shortener/Docs",
        "author": "be8881ce-af01-433b-a675-fe02e8a48a88",
        "creationDate": "2023-05-26T13:21:31.803Z",
        "modifiedDate": "2023-05-26T13:21:31.803Z",
        "visits": 0
    }
}

Retrieve paginated links

GET https://demo.getlynx.dev/api/link/list

Retrieve a list of paginated links that the user has permission to see. An admin can see all links but a standard user can only see their own.

Query Parameters

Name
Type
Description

pagesize*

String

Items to return in a page, up to 100.

page*

String

The current page to return, 0-base indexed.

sortType*

Intege

Order to sort by. -1 or 1.

sortField*

String

Field to sort by. id, slug, destination, author, creationDate, modifiedDate or visits.

search

String

Value to search slug and destination by.

Headers

Name
Type
Description

Authorization

String

Your API key

Cookies

Name
Type
Description

token

String

Your JWT Session

{
    "success": true,
    "result": {
        "remaining": 0,
        "links": [
            {
                "id": "f03eb6f5-d9ce-42ab-9506-f0e438304308",
                "slug": "author",
                "destination": "https://jackbailey.dev",
                "author": "be8881ce-af01-433b-a675-fe02e8a48a88",
                "creationDate": "2023-05-26T13:47:54.168Z",
                "modifiedDate": "2023-05-26T13:47:54.168Z",
                "visits": 0,
                "account": "demo"
            },
            {
                "id": "2fabe8c4-374e-458f-b8ad-9ef72badb2b3",
                "slug": "website",
                "destination": "https://getlynx.dev",
                "author": "be8881ce-af01-433b-a675-fe02e8a48a88",
                "creationDate": "2023-05-26T13:47:32.752Z",
                "modifiedDate": "2023-05-26T13:47:40.649Z",
                "visits": 1,
                "account": "demo"
            },
            {
                "id": "e845ff19-c3c3-4cd0-8e54-f932809a3126",
                "slug": "website-source",
                "destination": "https://github.com/Lynx-Shortener/Website",
                "author": "be8881ce-af01-433b-a675-fe02e8a48a88",
                "creationDate": "2023-05-26T13:47:23.016Z",
                "modifiedDate": "2023-05-26T13:47:23.016Z",
                "visits": 0,
                "account": "demo"
            }
        ]
    }
}

Link Management

Create link

POST https://demo.getlynx.dev/api/link

Creates a a link.

Headers

Name
Type
Description

Authorization

String

Your API key

Cookies

Name
Type
Description

token

String

Your JWT Session

Request Body

Name
Type
Description

slug*

string

The slug of the new link

destination*

string

The destination of the new link

{
    "success": true,
    "result": {
        "id": "6023f6ec-4283-4ece-a4de-5acbb30357d9",
        "slug": "qKK0AR34",
        "destination": "https://github.com/Lynx-Shortener/Docs",
        "author": "be8881ce-af01-433b-a675-fe02e8a48a88",
        "creationDate": "2023-05-26T13:21:31.803Z",
        "modifiedDate": "2023-05-26T13:21:31.803Z",
        "visits": 0,
        "account": "demo"
    }
}

Destination conflict only occurs when URL_ONLY_UNIQUE is set

Update link

PATCH https://demo.getlynx.dev/api/link

Updates a a link.

Headers

Name
Type
Description

Authorization

String

Your API key

Cookies

Name
Type
Description

token

String

Your JWT Session

Request Body

Name
Type
Description

slug*

string

The slug of the link to set

destination*

string

The destination of the link to set

id*

String

The id of the link

{
    "success": true,
    "result": {
        "id": "6023f6ec-4283-4ece-a4de-5acbb30357d9",
        "slug": "qKK0AR34",
        "destination": "https://github.com/Lynx-Shortener/Website",
        "author": "be8881ce-af01-433b-a675-fe02e8a48a88",
        "creationDate": "2023-05-26T13:21:31.803Z",
        "modifiedDate": "2023-05-26T13:28:21.642Z",
        "visits": 0,
        "account": "demo"
    }
}

Destination conflict only occurs when URL_ONLY_UNIQUE is set

Delete link

DELETE https://demo.getlynx.dev/api/link

Deletes a a link.

Headers

Name
Type
Description

Authorization

String

Your API key

Cookies

Name
Type
Description

token

String

Your JWT Session

Request Body

Name
Type
Description

ids*

Array

The id of links to remove

{
    "success": true
}

Last updated 1 year ago

Was this helpful?