GET
/
links
JavaScript
import Codeqr from '@codeqr/ts';

const client = new Codeqr({
  apiKey: 'My API Key',
});

const links = await client.links.list();

console.log(links);
[
  {
    "id": "<string>",
    "domain": "<string>",
    "key": "<string>",
    "url": "<string>",
    "archived": false,
    "expiresAt": "<string>",
    "expiredUrl": "<string>",
    "trackConversion": false,
    "flexible": false,
    "doIndex": false,
    "password": "<string>",
    "externalId": "<string>",
    "proxy": false,
    "title": "<string>",
    "description": "<string>",
    "image": "<string>",
    "video": "<string>",
    "rewrite": false,
    "ios": "<string>",
    "android": "<string>",
    "geo": {},
    "publicStats": false,
    "tagId": "<string>",
    "tags": [
      {
        "id": "<string>",
        "name": "<string>",
        "color": "red"
      }
    ],
    "comments": "<string>",
    "notificationToken": "<string>",
    "shortLink": "<string>",
    "qrCode": "<string>",
    "utm_source": "<string>",
    "utm_medium": "<string>",
    "utm_campaign": "<string>",
    "utm_term": "<string>",
    "utm_content": "<string>",
    "userId": "<string>",
    "projectId": "<string>",
    "clicks": 0,
    "leads": 0,
    "sales": 0,
    "saleAmount": 0,
    "lastClicked": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "preRedirection": false,
    "pageId": "<string>",
    "pageUrl": "<string>",
    "isFormMandatory": false,
    "filled": false
  }
]

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

projectSlug
string

The slug of the project to which the link belongs. For example, for app.codeqr.io/acme, the projectSlug is acme.

domain
string

The domain to filter the links. For example, ac.me. If not provided, all links of the project will be returned.

tagId
string
deprecated

[OBSOLETO (use tagIds em vez disso)]: The unique ID of the tag assigned to the short link.

tagIds

The IDs of the tags to filter the links.

tagNames

The unique name of the tags assigned to the short link (case insensitive).

The search term to filter the links. The search term will be matched against the short link slug and the destination URL.

userId
string

The ID of the user to filter by.

showArchived
boolean
default:false

If should include archived links in the response. The default is false if not provided.

password
string

The password to filter by.

expiresAt
string<date-time> | null

The date and time the short link will expire in ISO-8601 format. Must be in the future.

geo
object | null

Geographic segmentation information for the short link in JSON format {[COUNTRY]: https://example.com }.

ios
string

The iOS device to filter by.

android
string

The Android device to filter by.

comments
string

The comments to filter by.

withTags
boolean
default:false

If should include tags in the response. The default is false if not provided.

trackConversion
boolean
default:false

If should include links with conversion tracking enabled. The default is false if not provided.

hasPassword
boolean

Filter links that have password protection (any password)

hasExpiration
boolean

Filter links that have expiration date (any expiration)

hasUTM
boolean

Filter links that have UTM parameters

hasCustomSocial
boolean

Filter links that have custom social media cards

hasGeo
boolean

Filter links that have geo-targeting

hasDevice
boolean

Filter links that have device targeting

hasComments
boolean

Filter links that have comments (any comments)

hasTags
boolean

Filter links that have tags (any tags)

createdAfter
string<date-time>

Created after date (ISO string)

createdBefore
string<date-time>

Created before date (ISO string)

expiresAfter
string<date-time>

Expires after date (ISO string)

expiresBefore
string<date-time>

Expires before date (ISO string)

clicksMin
integer

Minimum number of clicks

Required range: x >= 0
clicksMax
integer

Maximum number of clicks

Required range: x >= 0
sort
enum<string>
default:createdAt

The field to sort the links by. The default is createdAt, and sort order is always descending.

Available options:
createdAt,
clicks,
lastClicked

Link IDs to filter by.

page
number
default:1

The page number for pagination.

Required range: x > 0
Example:

1

pageSize
number
default:100

The number of items per page.

Required range: 0 < x <= 100
Example:

50

Response

A list of links

id
string
required

The unique ID of the short link.

domain
string
required

The domain of the short link. If not provided, the main domain of the project will be used (or codeqr.link if the project has no domains).

key
string
required

The slug of the short link. If not provided, a random 7-character slug will be generated.

url
string<uri>
required

The destination URL of the short link.

archived
boolean
default:false
required

Whether the short link is archived.

expiresAt
string | null
required

The date and time when the short link will expire in ISO-8601 format. Must be in the future.

expiredUrl
string<uri> | null
required

The URL to redirect to when the short link expires.

trackConversion
boolean
default:false
required

[BETA] Whether to track conversions for the short link.

flexible
boolean
default:false
required

Whether the short link is flexible.

doIndex
boolean
default:false
required

Whether search engines can index the short link.

password
string | null
required

The password required to access the short link destination URL.

externalId
string | null
required

This is the ID of the link in your database.

proxy
boolean
default:false
required

Whether the short link uses the custom link preview feature.

title
string | null
required

The title of the short link generated via api.codeqr.io/metatags. Will be used for custom link preview if proxy is true.

description
string | null
required

The description of the short link generated via api.codeqr.io/metatags. Will be used for custom link preview if proxy is true.

image
string | null
required

The image of the short link generated via api.codeqr.io/metatags. Will be used for custom link preview if proxy is true.

video
string | null
required

The video of the short link.

rewrite
boolean
default:false
required

Whether the short link uses link cloaking.

ios
string | null
required

The iOS destination URL for the short link for iOS device targeting.

android
string | null
required

The Android destination URL for the short link for Android device targeting.

geo
object | null
required

Geographic targeting information for the short link in JSON format {[COUNTRY]: https://example.com }. Learn more: https://codeqr.link/geo

publicStats
boolean
default:false
required

Whether the short link statistics are publicly accessible.

tagId
string | null
required
deprecated

[DEPRECATED (use tags instead)]: The unique ID of the tag assigned to the short link.

tags
Tag · object[] | null
required

The tags assigned to the short link.

comments
string | null
required

The comments for the short link.

notificationToken
string | null
required

The notification token of the short link.

utm_source
string | null
required

The UTM source of the short link.

utm_medium
string | null
required

The UTM medium of the short link.

utm_campaign
string | null
required

The UTM campaign of the short link.

utm_term
string | null
required

The UTM term of the short link.

utm_content
string | null
required

The UTM content of the short link.

userId
string
required

The ID of the user who created the short link.

projectId
string
required

The ID of the project of the short link.

clicks
number
default:0
required

The number of clicks on the short link.

leads
number
default:0
required

The number of leads generated by the short link.

sales
number
default:0
required

The number of sales generated by the short link.

saleAmount
number
default:0
required

The amount of the sale generated by the link.

lastClicked
string | null
required

The date and time when the short link was last clicked.

createdAt
string
required

The date and time when the short link was created.

updatedAt
string
required

The date and time when the short link was last updated.

preRedirection
boolean
default:false
required

Whether the short link has pre-redirection.

isFormMandatory
boolean
default:false
required

If the form is mandatory for the page.

filled
boolean
default:false
required

Whether the link is filled or not.

The complete URL of the short link, including the https protocol (for example, https://codeqr.link/try).

qrCode
string<uri>

The complete QR code URL for the short link (for example, https://api.codeqr.io/qr?url=https://codeqr.link/try).

pageId
string | null

The ID of the page to redirect to before the link destination.

pageUrl
string | null

The URL of the page to redirect to before the link destination.