Skip to main content

Retrieve a list of links

GET 

/links

Retrieve a list of links for the authenticated project. The list will be paginated and the provided query parameters allow filtering the returned links.

Request

Query Parameters

    projectSlug stringrequired

    The slug for the project to retrieve links for. E.g. for app.zli.bz/acme, the projectSlug is acme.

    domain string

    The domain to filter the links by. E.g. ac.me. If not provided, all links for the project will be returned.

    tagId string

    The tag ID to filter the links by.

    search string

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

    sort string

    Possible values: [createdAt, clicks, lastClicked]

    Default value: createdAt

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

    page number

    The page number for pagination (each page contains 100 links).

    userId string

    The user ID to filter the links by.

    showArchived boolean

    Possible values: [true, false]

    Whether to include archived links in the response. Defaults to false if not provided.

Responses

A list of links

Schema
  • Array [
  • id cuid

    The unique ID of the short link.

    domain string

    The domain of the short link. If not provided, the primary domain for the project will be used (or zli.cx if the project has no domains).

    key string

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

    url string

    The destination URL of the short link.

    archived boolean

    Default value: false

    Whether the short link is archived.

    expiresAt date-timenullable

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

    password stringnullable

    The password required to access the destination URL of the short link.

    proxy boolean

    Default value: false

    Whether the short link uses Custom Social Media Cards feature.

    title stringnullable

    The title of the short link generated via api.zli.bz/metatags. Will be used for Custom Social Media Cards if proxy is true.

    description stringnullable

    The description of the short link generated via api.zli.bz/metatags. Will be used for Custom Social Media Cards if proxy is true.

    image stringnullable

    The image of the short link generated via api.zli.bz/metatags. Will be used for Custom Social Media Cards if proxy is true.

    rewrite boolean

    Default value: false

    Whether the short link uses link cloaking.

    ios stringnullable

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

    android stringnullable

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

    geo objectnullable

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

    property name* uri
    publicStats boolean

    Default value: false

    Whether the short link's stats are publicly accessible.

    tagId cuidnullable

    The unique id of the tag assigned to the short link.

    comments stringnullable

    The comments for the short link.

    shortLink string

    The full URL of the short link, including the https protocol (e.g. https://zli.cx/try).

    qrCode string

    The full URL of the QR code for the short link (e.g. https://api.zli.bz/qr?url=https://zli.cx/try).

    utm_source stringnullable

    The UTM source of the short link.

    utm_medium stringnullable

    The UTM medium of the short link.

    utm_campaign stringnullable

    The UTM campaign of the short link.

    utm_term stringnullable

    The UTM term of the short link.

    utm_content stringnullable

    The UTM content of the short link.

    userId cuid

    The user ID of the creator of the short link.

    projectId cuid

    The project ID of the short link.

    clicks number

    The number of clicks on the short link.

    lastClicked date-timenullable

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

    createdAt date-time

    The date and time when the short link was created.

    updatedAt date-time

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

  • ]
Loading...