Skip to content

GraphQL Queries

lnkifyConnection

Paginated list of shortlinks owned by the authenticated user, with optional search and total count.

ArgumentTypeDescription
skipIntNumber of items to skip (for pagination)
takeIntNumber of items to return (max 100)
searchStringFree-text search across slug, target URL, and title
ReturnsLnkifyConnection!
AuthRequired
graphql
query {
  lnkifyConnection(skip: 0, take: 10) {
    items {
      id
      lnkify
      target
      title
      hitCount
      enableTracking
      createdAt
    }
    totalCount
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { lnkifyConnection(skip: 0, take: 10) { items { id lnkify target title hitCount enableTracking createdAt } totalCount } }"}'

getLnkifyInfo

Get a single shortlink by its ID. Includes hit data and country breakdown.

ArgumentTypeDescription
idID!ID of the shortlink to fetch
Returnslnkify
AuthRequired
graphql
query {
  getLnkifyInfo(id: "1") {
    id
    lnkify
    target
    title
    hitCount
    enableTracking
    hits {
      id
      ip
      browser { name version }
      os { name version }
      location { city country { name } }
      createdAt
    }
    byCountryGraph {
      country { name code }
      count
    }
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { getLnkifyInfo(id: \"1\") { id lnkify target hitCount hits { id browser { name } location { city } } byCountryGraph { count country { name } } } }"}'

getUserInfo

Get the authenticated user's profile and their shortlinks.

ReturnsUser
AuthRequired
graphql
query {
  getUserInfo {
    id
    name
    email
    createdAt
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { getUserInfo { id name email createdAt } }"}'

getApiKeys

List all API keys for the authenticated user. The secret is never returned.

Returns[ApiKey!]!
AuthRequired
graphql
query {
  getApiKeys {
    id
    label
    prefix
    last4
    lastUsedAt
    expiresAt
    createdAt
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { getApiKeys { id label prefix last4 lastUsedAt expiresAt createdAt } }"}'

hit

Get a single hit/click event by its ID.

ArgumentTypeDescription
idID!ID of the hit event to fetch
Returnshit
AuthRequired
graphql
query {
  hit(id: "1") {
    id
    ip
    type
    isp
    browser { name version }
    os { name version }
    timezone { name offset abbreviation }
    location { city postal country { name code } continent { name code } }
    createdAt
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { hit(id: \"1\") { id ip browser { name } os { name } location { city country { name } } createdAt } }"}'

targetUrl

Resolve a shortlink slug to its target URL. Records a hit when the link has tracking enabled. This is the canonical replacement for the deprecated getTargetByLnkify mutation.

ArgumentTypeDescription
lnkifyString!The shortlink slug to resolve
ReturnsString
AuthNone (public)
graphql
query {
  targetUrl(lnkify: "my-link")
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -d '{"query": "query { targetUrl(lnkify: \"my-link\") }"}'

Response:

json
{
  "data": {
    "targetUrl": "https://example.com/very-long-url"
  }
}

ping

Health check. Returns "pong". Does not require authentication.

ReturnsString!
AuthNone
graphql
query {
  ping
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -d '{"query": "query { ping }"}'

Response:

json
{
  "data": {
    "ping": "pong"
  }
}

getTargetByLnkify

Resolve a shortlink slug to its target URL. Records a hit when the link has tracking enabled. Also available as the deprecated mutation of the same name.

ArgumentTypeDescription
lnkifyString!The shortlink slug to resolve
hostnameStringOptional custom domain hostname
ReturnsString
AuthNone (public)
graphql
query {
  getTargetByLnkify(lnkify: "my-link")
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -d '{"query": "query { getTargetByLnkify(lnkify: \"my-link\") }"}'

Response:

json
{
  "data": {
    "getTargetByLnkify": "https://example.com/very-long-url"
  }
}

lnkifyAnalytics

Aggregate analytics across all links owned by the authenticated user (totals and top links).

ReturnsLnkifyAnalytics!
AuthRequired
graphql
query {
  lnkifyAnalytics {
    totalLinks
    trackedLinks
    totalClicks
    topLinks {
      id
      lnkify
      hostname
      hitCount
    }
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { lnkifyAnalytics { totalLinks trackedLinks totalClicks topLinks { id lnkify hitCount } } }"}'

bioPages

List all bio pages owned by the authenticated user.

Returns[BioPage!]!
AuthRequired
graphql
query {
  bioPages {
    id
    slug
    title
    theme
    links { id label url order }
    createdAt
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { bioPages { id slug title links { label url } } }"}'

bioPage

Get a single bio page by its slug.

ArgumentTypeDescription
slugString!URL slug of the bio page
ReturnsBioPage
AuthNone
graphql
query {
  bioPage(slug: "my-links") {
    id
    slug
    title
    theme
    links { id label url order }
    createdAt
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -d '{"query": "query { bioPage(slug: \"my-links\") { id slug title links { label url } } }"}'

domains

List all custom domains owned by the authenticated user.

Returns[Domain!]!
AuthRequired
graphql
query {
  domains {
    id
    hostname
    verified
    verifiedAt
    sslStatus
    txtToken
    createdAt
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { domains { id hostname verified sslStatus createdAt } }"}'

meSub

Get the authenticated user's current subscription details.

ReturnsSubscription
AuthRequired
graphql
query {
  meSub {
    id
    plan
    status
    currentPeriodStart
    currentPeriodEnd
    cancelAtPeriodEnd
    anchorDay
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { meSub { plan status currentPeriodEnd cancelAtPeriodEnd } }"}'

meUsage

Get the authenticated user's current billing period usage.

ReturnsUsageMeter
AuthRequired
graphql
query {
  meUsage {
    periodStart
    periodEnd
    linksCreated
    refillLinks
    allowance
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { meUsage { periodStart periodEnd linksCreated refillLinks allowance } }"}'

meAutoRefill

Get the authenticated user's auto-refill settings.

ReturnsAutoRefillSetting
AuthRequired
graphql
query {
  meAutoRefill {
    enabled
    thresholdPercent
    refillPackLinks
    maxMonthlySpend
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { meAutoRefill { enabled thresholdPercent refillPackLinks maxMonthlySpend } }"}'

webhooks

List all webhooks owned by the authenticated user.

Returns[Webhook!]!
AuthRequired
graphql
query {
  webhooks {
    id
    url
    events
    enabled
    createdAt
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { webhooks { id url events enabled createdAt } }"}'

webhookDeliveries

List recent delivery attempts for a specific webhook.

ArgumentTypeDescription
webhookIdID!ID of the webhook to get deliveries for
Returns[WebhookDelivery!]!
AuthRequired
graphql
query {
  webhookDeliveries(webhookId: "1") {
    id
    event
    status
    response
    createdAt
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "query { webhookDeliveries(webhookId: \"1\") { id event status createdAt } }"}'

plans

List all available billing plans.

Returns[BillingPlan!]!
AuthNone
graphql
query {
  plans {
    plan
    interval
    displayPrice
    displayPerMonth
    yearlyTotal
    links
    description
    features
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -d '{"query": "query { plans { plan interval displayPrice displayPerMonth links features } }"}'

Released under the MIT License.