Skip to content

GraphQL Mutations

createLnkify

Create a single shortlink. Returns the generated or provided slug.

ArgumentTypeDescription
targetString!Destination URL (required)
lnkifyStringCustom slug (optional, auto-generated if omitted)
titleStringDisplay title
enableTrackingBooleanEnable click tracking
domainIdStringCustom domain ID to attach the shortlink to
rules[LinkRuleInput!]Routing rules (type, value, target)
ReturnsString!
AuthOptional (required only when REQUIRE_AUTH_FOR_CREATE=true)

By default, anonymous link creation is allowed; title and enableTracking are only applied for authenticated callers. Operators can require authentication with REQUIRE_AUTH_FOR_CREATE.

Validation. target must be an absolute http(s):// URL of at most 2048 characters — other schemes (javascript:, data:, file:, …) and relative paths are rejected. A custom lnkify slug may contain only A-Z a-z 0-9 _ - (max 100 chars) and may not be a reserved path (e.g. graphql, manage, mcp, healthz, llms.txt). The same rules apply to createLnkifies and the MCP create tool.

graphql
mutation {
  createLnkify(target: "https://example.com/very-long-url", lnkify: "short", title: "Example", enableTracking: true)
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { createLnkify(target: \"https://example.com\", lnkify: \"my-link\") }"}'

Response:

json
{
  "data": {
    "createLnkify": "my-link"
  }
}

createLnkifies

Bulk-create multiple shortlinks. Each item returns its own success/failure result.

ArgumentTypeDescription
inputs[CreateLnkifyInput!]!Array of input objects
Returns[BulkLnkifyResult!]!
AuthRequired
graphql
mutation {
  createLnkifies(inputs: [
    { target: "https://example.com/page1", lnkify: "page-1" }
    { target: "https://example.com/page2", title: "Page Two", enableTracking: true }
  ]) {
    index
    ok
    lnkify { id lnkify target }
    error
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { createLnkifies(inputs: [{ target: \"https://a.com\" }, { target: \"https://b.com\" }]) { index ok lnkify { id lnkify } error } }"}'

Partial success response:

json
{
  "data": {
    "createLnkifies": [
      { "index": 0, "ok": true, "lnkify": { "id": "1", "lnkify": "a1b2c3" }, "error": null },
      { "index": 1, "ok": false, "lnkify": null, "error": "Target URL is required" }
    ]
  }
}

updateLnkifies

Bulk-update multiple shortlinks. Only provided fields are changed; omitted fields retain their current values.

ArgumentTypeDescription
inputs[UpdateLnkifyInput!]!Array of update objects

Each item in inputs:

FieldTypeDescription
idID!Shortlink ID (required)
targetStringNew destination URL
titleStringNew display title
enableTrackingBooleanToggle click tracking
rules[LinkRuleInput!]Routing rules
Returns[BulkLnkifyResult!]!
AuthRequired
graphql
mutation {
  updateLnkifies(inputs: [
    { id: "1", target: "https://new-url.com" }
    { id: "2", title: "Updated Title", enableTracking: false }
  ]) {
    index
    ok
    lnkify { id lnkify target title enableTracking }
    error
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { updateLnkifies(inputs: [{ id: \"1\", target: \"https://updated.com\" }]) { index ok lnkify { id lnkify target } error } }"}'

deleteLnkifies

Bulk-delete multiple shortlinks by ID. Each ID returns its own result.

ArgumentTypeDescription
ids[ID!]!Array of shortlink IDs to delete
Returns[BulkDeleteResult!]!
AuthRequired
graphql
mutation {
  deleteLnkifies(ids: ["1", "2", "999"]) {
    index
    id
    ok
    error
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { deleteLnkifies(ids: [\"1\", \"2\"]) { index id ok error } }"}'

createApiKey

Create a new API key. The secret is only returned once — store it immediately.

ArgumentTypeDescription
labelString!Human-readable label (required)
expiresAtStringISO 8601 expiration timestamp (optional)
ReturnsCreatedApiKey!
AuthRequired
graphql
mutation {
  createApiKey(label: "CI/CD Pipeline", expiresAt: "2026-12-31T23:59:59Z") {
    apiKey { id label prefix last4 createdAt }
    secret
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { createApiKey(label: \"My Script\") { apiKey { id label } secret } }"}'

Response:

json
{
  "data": {
    "createApiKey": {
      "apiKey": {
        "id": "1",
        "label": "My Script",
        "prefix": "lf_live_",
        "last4": "xyz1",
        "createdAt": "2026-06-12T00:00:00.000Z"
      },
      "secret": "lf_live_a1b2c3d4e5f6g7h8i9j0klmnopqrst"
    }
  }
}

revokeApiKey

Revoke an API key by its ID. Returns true on success. The key stops working immediately.

ArgumentTypeDescription
idID!ID of the API key to revoke
ReturnsBoolean!
AuthRequired
graphql
mutation {
  revokeApiKey(id: "1")
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { revokeApiKey(id: \"1\") }"}'

login

Authenticate with email and password. Returns a JWT and user object.

ArgumentTypeDescription
emailString!User's email address
passwordString!User's password
ReturnsAuthPayload!
AuthNone
graphql
mutation {
  login(email: "user@example.com", password: "secure-password") {
    token
    user { id name email }
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -d '{"query": "mutation { login(email: \"user@example.com\", password: \"pass\") { token user { id name email } } }"}'

Error (invalid credentials):

json
{
  "data": null,
  "errors": [{
    "message": "Invalid email or password.",
    "extensions": { "code": "UNAUTHENTICATED" }
  }]
}

signup

Register a new user account. Returns a JWT and user object.

ArgumentTypeDescription
nameString!Display name
emailString!Email address
passwordString!Password
ReturnsAuthPayload!
AuthNone
graphql
mutation {
  signup(name: "Jane Doe", email: "jane@example.com", password: "secure-pass") {
    token
    user { id name email }
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -d '{"query": "mutation { signup(name: \"Jane\", email: \"jane@example.com\", password: \"pass\") { token user { id name } } }"}'

resetPassword

Change the authenticated user's password. Requires the current password.

ArgumentTypeDescription
oldPasswordString!Current password
newPasswordString!New password to set
ReturnsAuthPayload
AuthRequired
graphql
mutation {
  resetPassword(oldPassword: "old-pass", newPassword: "new-secure-pass") {
    token
    user { id name }
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { resetPassword(oldPassword: \"old\", newPassword: \"new\") { token } }"}'

logout

Invalidate the caller's current JWT. The token's jti is added to a revocation list so it can no longer authenticate, even before its 7-day expiry. Returns true when a token was revoked, false when the request carried no revocable JWT (e.g. unauthenticated, or API-key auth). Safe to call repeatedly.

ReturnsBoolean!
AuthRequired (uses the bearer JWT on the request)
graphql
mutation {
  logout
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { logout }"}'

createCheckoutSession

Create a Stripe checkout session for plan upgrade or subscription purchase.

ArgumentTypeDescription
priceIdString!Stripe price ID for the desired plan
ReturnsCheckoutSessionResult!
AuthRequired
graphql
mutation {
  createCheckoutSession(priceId: "price_abc123") {
    url
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { createCheckoutSession(priceId: \"price_abc123\") { url } }"}'

createPortalSession

Create a Stripe customer portal session for managing billing and subscription.

ReturnsPortalSessionResult!
AuthRequired
graphql
mutation {
  createPortalSession {
    url
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { createPortalSession { url } }"}'

addDomain

Register a new custom domain for branded shortlinks.

ArgumentTypeDescription
hostnameString!The custom domain hostname (e.g. links.example.com)
ReturnsDomain!
AuthRequired
graphql
mutation {
  addDomain(hostname: "links.example.com") {
    id
    hostname
    verified
    txtToken
    createdAt
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { addDomain(hostname: \"links.example.com\") { id hostname verified txtToken } }"}'

verifyDomain

Trigger DNS verification for a custom domain.

ArgumentTypeDescription
idID!ID of the domain to verify
ReturnsDomain!
AuthRequired
graphql
mutation {
  verifyDomain(id: "1") {
    id
    hostname
    verified
    verifiedAt
    sslStatus
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { verifyDomain(id: \"1\") { id hostname verified sslStatus } }"}'

deleteDomain

Delete a custom domain.

ArgumentTypeDescription
idID!ID of the domain to delete
ReturnsBoolean!
AuthRequired
graphql
mutation {
  deleteDomain(id: "1")
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { deleteDomain(id: \"1\") }"}'

deleteAccount

Permanently delete the authenticated user's account and all associated data.

ReturnsBoolean!
AuthRequired
graphql
mutation {
  deleteAccount
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { deleteAccount }"}'

updateAutoRefill

Update the auto-refill settings for the authenticated user's subscription.

ArgumentTypeDescription
inputUpdateAutoRefillInput!Auto-refill configuration
ReturnsAutoRefillSetting!
AuthRequired
graphql
mutation {
  updateAutoRefill(input: {
    enabled: true
    thresholdPercent: 80
    refillPackLinks: 100
    maxMonthlySpend: 5000
  }) {
    enabled
    thresholdPercent
    refillPackLinks
    maxMonthlySpend
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { updateAutoRefill(input: { enabled: true thresholdPercent: 80 refillPackLinks: 100 maxMonthlySpend: 5000 }) { enabled thresholdPercent refillPackLinks maxMonthlySpend } }"}'

createWebhook

Create an outgoing webhook endpoint for link events.

ArgumentTypeDescription
inputCreateWebhookInput!Webhook configuration
ReturnsWebhook!
AuthRequired
graphql
mutation {
  createWebhook(input: {
    url: "https://myapp.example.com/webhook"
    events: ["link.created", "link.clicked", "bio.viewed"]
  }) {
    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": "mutation { createWebhook(input: { url: \"https://myapp.example.com/webhook\" events: [\"link.created\" \"link.clicked\"] }) { id url events enabled createdAt } }"}'

updateWebhook

Update an existing webhook endpoint.

ArgumentTypeDescription
idID!ID of the webhook to update
inputUpdateWebhookInput!Updated webhook configuration
ReturnsWebhook!
AuthRequired
graphql
mutation {
  updateWebhook(id: "1", input: {
    url: "https://myapp.example.com/new-webhook"
    events: ["link.created", "link.clicked", "bio.viewed"]
    enabled: true
  }) {
    id
    url
    events
    enabled
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { updateWebhook(id: \"1\", input: { url: \"https://new.example.com\" }) { id url events enabled } }"}'

deleteWebhook

Delete a webhook endpoint.

ArgumentTypeDescription
idID!ID of the webhook to delete
ReturnsBoolean!
AuthRequired
graphql
mutation {
  deleteWebhook(id: "1")
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { deleteWebhook(id: \"1\") }"}'

createBioPage

Create a link-in-bio page.

ArgumentTypeDescription
inputCreateBioPageInput!Bio page configuration
ReturnsBioPage!
AuthRequired
graphql
mutation {
  createBioPage(input: {
    slug: "my-links"
    title: "My Links"
    theme: "default"
  }) {
    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": "mutation { createBioPage(input: { slug: \"my-links\" title: \"My Links\" }) { id slug title } }"}'

updateBioPage

Update an existing bio page.

ArgumentTypeDescription
idID!ID of the bio page to update
inputUpdateBioPageInput!Updated bio page configuration
ReturnsBioPage!
AuthRequired
graphql
mutation {
  updateBioPage(id: "1", input: {
    title: "Updated Title"
    theme: "dark"
  }) {
    id
    slug
    title
    theme
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { updateBioPage(id: \"1\", input: { title: \"New Name\" }) { id slug title } }"}'

deleteBioPage

Delete a bio page.

ArgumentTypeDescription
idID!ID of the bio page to delete
ReturnsBoolean!
AuthRequired
graphql
mutation {
  deleteBioPage(id: "1")
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { deleteBioPage(id: \"1\") }"}'

Add a link to a bio page.

ArgumentTypeDescription
bioPageIdID!ID of the bio page
inputAddBioLinkInput!Bio link configuration
ReturnsBioLink!
AuthRequired
graphql
mutation {
  addBioLink(bioPageId: "1", input: {
    label: "My Website"
    url: "https://example.com"
    order: 0
  }) {
    id
    label
    url
    order
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { addBioLink(bioPageId: \"1\", input: { label: \"My Site\" url: \"https://example.com\" order: 0 }) { id label url order } }"}'

Update an existing bio link.

ArgumentTypeDescription
idID!ID of the bio link to update
inputUpdateBioLinkInput!Updated bio link configuration
ReturnsBioLink!
AuthRequired
graphql
mutation {
  updateBioLink(id: "1", input: {
    label: "Updated Label"
    url: "https://new-url.com"
    order: 1
  }) {
    id
    label
    url
    order
  }
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { updateBioLink(id: \"1\", input: { label: \"Updated\" }) { id label url order } }"}'

Delete a bio link.

ArgumentTypeDescription
idID!ID of the bio link to delete
ReturnsBoolean!
AuthRequired
graphql
mutation {
  deleteBioLink(id: "1")
}
bash
curl -X POST https://lnkify.io/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"query": "mutation { deleteBioLink(id: \"1\") }"}'

Released under the MIT License.