GraphQL Mutations
createLnkify
Create a single shortlink. Returns the generated or provided slug.
| Argument | Type | Description |
|---|---|---|
target | String! | Destination URL (required) |
lnkify | String | Custom slug (optional, auto-generated if omitted) |
title | String | Display title |
enableTracking | Boolean | Enable click tracking |
domainId | String | Custom domain ID to attach the shortlink to |
rules | [LinkRuleInput!] | Routing rules (type, value, target) |
| Returns | String! |
| Auth | Optional (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.
mutation {
createLnkify(target: "https://example.com/very-long-url", lnkify: "short", title: "Example", enableTracking: true)
}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:
{
"data": {
"createLnkify": "my-link"
}
}createLnkifies
Bulk-create multiple shortlinks. Each item returns its own success/failure result.
| Argument | Type | Description |
|---|---|---|
inputs | [CreateLnkifyInput!]! | Array of input objects |
| Returns | [BulkLnkifyResult!]! |
| Auth | Required |
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
}
}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:
{
"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.
| Argument | Type | Description |
|---|---|---|
inputs | [UpdateLnkifyInput!]! | Array of update objects |
Each item in inputs:
| Field | Type | Description |
|---|---|---|
id | ID! | Shortlink ID (required) |
target | String | New destination URL |
title | String | New display title |
enableTracking | Boolean | Toggle click tracking |
rules | [LinkRuleInput!] | Routing rules |
| Returns | [BulkLnkifyResult!]! |
| Auth | Required |
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
}
}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.
| Argument | Type | Description |
|---|---|---|
ids | [ID!]! | Array of shortlink IDs to delete |
| Returns | [BulkDeleteResult!]! |
| Auth | Required |
mutation {
deleteLnkifies(ids: ["1", "2", "999"]) {
index
id
ok
error
}
}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.
| Argument | Type | Description |
|---|---|---|
label | String! | Human-readable label (required) |
expiresAt | String | ISO 8601 expiration timestamp (optional) |
| Returns | CreatedApiKey! |
| Auth | Required |
mutation {
createApiKey(label: "CI/CD Pipeline", expiresAt: "2026-12-31T23:59:59Z") {
apiKey { id label prefix last4 createdAt }
secret
}
}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:
{
"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.
| Argument | Type | Description |
|---|---|---|
id | ID! | ID of the API key to revoke |
| Returns | Boolean! |
| Auth | Required |
mutation {
revokeApiKey(id: "1")
}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.
| Argument | Type | Description |
|---|---|---|
email | String! | User's email address |
password | String! | User's password |
| Returns | AuthPayload! |
| Auth | None |
mutation {
login(email: "user@example.com", password: "secure-password") {
token
user { id name email }
}
}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):
{
"data": null,
"errors": [{
"message": "Invalid email or password.",
"extensions": { "code": "UNAUTHENTICATED" }
}]
}signup
Register a new user account. Returns a JWT and user object.
| Argument | Type | Description |
|---|---|---|
name | String! | Display name |
email | String! | Email address |
password | String! | Password |
| Returns | AuthPayload! |
| Auth | None |
mutation {
signup(name: "Jane Doe", email: "jane@example.com", password: "secure-pass") {
token
user { id name email }
}
}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.
| Argument | Type | Description |
|---|---|---|
oldPassword | String! | Current password |
newPassword | String! | New password to set |
| Returns | AuthPayload |
| Auth | Required |
mutation {
resetPassword(oldPassword: "old-pass", newPassword: "new-secure-pass") {
token
user { id name }
}
}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.
| Returns | Boolean! |
| Auth | Required (uses the bearer JWT on the request) |
mutation {
logout
}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.
| Argument | Type | Description |
|---|---|---|
priceId | String! | Stripe price ID for the desired plan |
| Returns | CheckoutSessionResult! |
| Auth | Required |
mutation {
createCheckoutSession(priceId: "price_abc123") {
url
}
}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.
| Returns | PortalSessionResult! |
| Auth | Required |
mutation {
createPortalSession {
url
}
}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.
| Argument | Type | Description |
|---|---|---|
hostname | String! | The custom domain hostname (e.g. links.example.com) |
| Returns | Domain! |
| Auth | Required |
mutation {
addDomain(hostname: "links.example.com") {
id
hostname
verified
txtToken
createdAt
}
}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.
| Argument | Type | Description |
|---|---|---|
id | ID! | ID of the domain to verify |
| Returns | Domain! |
| Auth | Required |
mutation {
verifyDomain(id: "1") {
id
hostname
verified
verifiedAt
sslStatus
}
}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.
| Argument | Type | Description |
|---|---|---|
id | ID! | ID of the domain to delete |
| Returns | Boolean! |
| Auth | Required |
mutation {
deleteDomain(id: "1")
}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.
| Returns | Boolean! |
| Auth | Required |
mutation {
deleteAccount
}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.
| Argument | Type | Description |
|---|---|---|
input | UpdateAutoRefillInput! | Auto-refill configuration |
| Returns | AutoRefillSetting! |
| Auth | Required |
mutation {
updateAutoRefill(input: {
enabled: true
thresholdPercent: 80
refillPackLinks: 100
maxMonthlySpend: 5000
}) {
enabled
thresholdPercent
refillPackLinks
maxMonthlySpend
}
}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.
| Argument | Type | Description |
|---|---|---|
input | CreateWebhookInput! | Webhook configuration |
| Returns | Webhook! |
| Auth | Required |
mutation {
createWebhook(input: {
url: "https://myapp.example.com/webhook"
events: ["link.created", "link.clicked", "bio.viewed"]
}) {
id
url
events
enabled
createdAt
}
}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.
| Argument | Type | Description |
|---|---|---|
id | ID! | ID of the webhook to update |
input | UpdateWebhookInput! | Updated webhook configuration |
| Returns | Webhook! |
| Auth | Required |
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
}
}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.
| Argument | Type | Description |
|---|---|---|
id | ID! | ID of the webhook to delete |
| Returns | Boolean! |
| Auth | Required |
mutation {
deleteWebhook(id: "1")
}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.
| Argument | Type | Description |
|---|---|---|
input | CreateBioPageInput! | Bio page configuration |
| Returns | BioPage! |
| Auth | Required |
mutation {
createBioPage(input: {
slug: "my-links"
title: "My Links"
theme: "default"
}) {
id
slug
title
theme
links { id label url order }
createdAt
}
}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.
| Argument | Type | Description |
|---|---|---|
id | ID! | ID of the bio page to update |
input | UpdateBioPageInput! | Updated bio page configuration |
| Returns | BioPage! |
| Auth | Required |
mutation {
updateBioPage(id: "1", input: {
title: "Updated Title"
theme: "dark"
}) {
id
slug
title
theme
}
}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.
| Argument | Type | Description |
|---|---|---|
id | ID! | ID of the bio page to delete |
| Returns | Boolean! |
| Auth | Required |
mutation {
deleteBioPage(id: "1")
}curl -X POST https://lnkify.io/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"query": "mutation { deleteBioPage(id: \"1\") }"}'addBioLink
Add a link to a bio page.
| Argument | Type | Description |
|---|---|---|
bioPageId | ID! | ID of the bio page |
input | AddBioLinkInput! | Bio link configuration |
| Returns | BioLink! |
| Auth | Required |
mutation {
addBioLink(bioPageId: "1", input: {
label: "My Website"
url: "https://example.com"
order: 0
}) {
id
label
url
order
}
}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 } }"}'updateBioLink
Update an existing bio link.
| Argument | Type | Description |
|---|---|---|
id | ID! | ID of the bio link to update |
input | UpdateBioLinkInput! | Updated bio link configuration |
| Returns | BioLink! |
| Auth | Required |
mutation {
updateBioLink(id: "1", input: {
label: "Updated Label"
url: "https://new-url.com"
order: 1
}) {
id
label
url
order
}
}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 } }"}'deleteBioLink
Delete a bio link.
| Argument | Type | Description |
|---|---|---|
id | ID! | ID of the bio link to delete |
| Returns | Boolean! |
| Auth | Required |
mutation {
deleteBioLink(id: "1")
}curl -X POST https://lnkify.io/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"query": "mutation { deleteBioLink(id: \"1\") }"}'