Documentation

API Documentation

RESTful API documentation for developers

Quick Info
Base URL
https://api.lots.link
Authentication

API Key (Bearer token or X-API-Key header)

Total Endpoints

33

Getting Started

Authentication

All API requests require authentication using an API key. You can create an API key from your dashboard.

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.lots.link/api/v1/lotslink/link/:link_id/qr_code

links

POST
/api/v1/lotslink/link/:link_id/qr_code

Create QR Code

lotslink_create_qr_code

Make a QR code (PNG) for a link's short URL and return its image URL (qr_code_url), ready to download, print or share. The code always opens the short URL, so scans show up as visits in the link's analytics. The URL is also saved on the link (lotslink_get_link, lotslink_list_links); calling again makes a new image and replaces it. QR codes are free and unlimited. Owners and admins can make one for any link, members for links they created; viewers cannot. Requires workspace_id and link_id: call lotslink_list_workspaces, then lotslink_list_links or use the id from lotslink_create_link.

POST
/api/v1/lotslink/link

Create Link

lotslink_create_link

Create a short link on lots.link, your free *.lots.link subdomain or a verified custom domain in the workspace, with an optional custom slug, project, expiry and UTM parameters. Links and clicks are free and unlimited; the only limit is up to 1,000 new links per person in any 24 hours. A link on your own custom domain needs that domain to be funded by a plan or credits. Known phishing or malware destinations are refused. To make a QR code for the new link, call lotslink_create_qr_code with the returned link id.

DELETE
/api/v1/lotslink/link/:id

Delete Link

lotslink_delete_link

Permanently delete a link. This action cannot be undone. All associated data including click statistics, tag assignments, and QR codes will be deleted. Members can only delete their own links, while owners and admins can delete any link in the workspace.

GET
/api/v1/lotslink/link/:id

Get Link

lotslink_get_link

Get one link with its metadata, UTM parameters, project, custom domain, click count and qr_code_url (empty until lotslink_create_qr_code or the dashboard makes one).

GET
/api/v1/lotslink/links

List Links

lotslink_list_links

List links in a workspace with filters (project, status active/inactive/expired, date range), search by URL or slug, sorting and pagination. Each link includes its click count, project and qr_code_url.

PUT
/api/v1/lotslink/link/:id

Update Link

lotslink_update_link

Update link properties including custom slug, expiration date, active status, or project assignment. Members can only update their own links, while owners and admins can update any link in the workspace.

workspaces

POST
/api/v1/lotslink/invitation/accept

Accept Invitation

lotslink_accept_workspace_invitation

Join a workspace from an invitation sent to your LotsLink account's email address (the match ignores letter case). Pass invitation_id from lotslink_list_my_invitations, or the token at the end of the invite link (https://lots.link/invite/<token>). Each invitation works once and expires after 7 days. Someone who was removed before rejoins with the invited role.

DELETE
/api/v1/lotslink/workspace/:workspace_id/invitations/:invitation_id

Cancel Invitation

lotslink_cancel_workspace_invitation

Cancel a pending invitation so its link stops working. Owner or admin only. Get invitation_id from lotslink_list_workspace_members (invitations[].id).

PATCH
/api/v1/lotslink/workspace/:workspace_id/members/:member_id

Change Member Role

lotslink_update_workspace_member_role

Change a workspace member's role to admin, member or viewer. Owner or admin only. The owner's role cannot be changed, an admin cannot change another admin, and ownership cannot be given by a role change. Get member_id from lotslink_list_workspace_members.

POST
/api/v1/lotslink/workspace/:workspace_id/members

Invite Workspace Member

lotslink_invite_workspace_member

Invite someone to a workspace by email. Owner or admin only. LotsLink emails them an invitation link, valid for 7 days, and returns invite_url (share it yourself if email_sent is false). Roles: admin, member or viewer; ownership cannot be given by invitation. Teammates are free and unlimited on every plan. Inviting an address that already has a pending invitation sends it again with a new link. Someone who was removed is invited the same way and rejoins when they accept. Current members cannot be invited again.

POST
/api/v1/lotslink/workspace/:workspace_id/leave

Leave Workspace

lotslink_leave_workspace

Leave a workspace you were invited to. Any member except the owner can leave. You lose access to its links at once, and only a new invitation lets you back in.

GET
/api/v1/lotslink/invitations

List My Invitations

lotslink_list_my_invitations

List the pending workspace invitations sent to your LotsLink account's email address, with the workspace, role and who invited you. Accept one with lotslink_accept_workspace_invitation and its id.

GET
/api/v1/lotslink/workspace/:workspace_id/members

List Workspace Members

lotslink_list_workspace_members

List the active members of a workspace with their role, name and email, and your own role (my_role, can_manage). Any member can call it. Owners and admins also get the pending invitations with their invite links. Teammates are free and unlimited. Requires workspace_id: call lotslink_list_workspaces first.

DELETE
/api/v1/lotslink/workspace/:workspace_id/members/:member_id

Remove Workspace Member

lotslink_remove_workspace_member

Remove a member from a workspace. Owner or admin only. The owner cannot be removed and an admin cannot remove another admin. Their links stay in the workspace. They can rejoin only through a new invitation. To remove yourself, use lotslink_leave_workspace. Get member_id from lotslink_list_workspace_members.

POST
/api/v1/lotslink/workspace

Create Workspace

lotslink_create_workspace

Create a workspace (personal or team) to organize links and work with teammates. Workspaces are free and unlimited, and no subscription is needed. You become the owner and first member.

DELETE
/api/v1/lotslink/workspace/:id

Delete Workspace

lotslink_delete_workspace

Permanently delete a workspace. OWNER ONLY. This action cannot be undone. Cascade deletes all workspace members, links, projects, tags, custom domains, and related data. Use with extreme caution.

GET
/api/v1/lotslink/workspace/:id

Get Workspace

lotslink_get_workspace

Get detailed information about a specific workspace. Requires user to be an active member. Returns workspace details, settings, user role, member count, and link count.

GET
/api/v1/lotslink/workspaces

List Workspaces

lotslink_list_workspaces

List all workspaces where user is an active member. Returns workspaces with user role, member count, and link count. Sorted by creation date (newest first). Includes personal and team workspaces.

PUT
/api/v1/lotslink/workspace/:id

Update Workspace

lotslink_update_workspace

Update workspace name, description, or settings. Requires owner or admin role. At least one field must be provided. Name must be 1-255 characters if provided.

billing

POST
/api/v1/lotslink/checkout

Choose a LotsLink plan or add credits

lotslink_create_checkout

Create a checkout link. Pass plan (starter, pro or business) and cycle (monthly or annual) for custom domains, or amount_usd (10 to 1000) to add LotsTech Credits. Give the link to the person to pay in their browser; never ask for card details in chat.

GET
/api/v1/lotslink/billing

Get LotsLink billing

lotslink_get_billing

Show how the caller's LotsLink custom domains are paid for: the plan (if any), whether today is covered or paid from credits, the credit balance, and the plans. Links, clicks, QR codes and one *.lots.link subdomain are free; only custom domains are billed.

projects

POST
/api/v1/lotslink/project

Create Project

lotslink_create_project

Create a new project for organizing links within a workspace. Projects help categorize and group related links together, optionally with client information and color coding for visual identification.

DELETE
/api/v1/lotslink/project/:id

Delete Project

lotslink_delete_project

Permanently delete a project from the workspace. This action cannot be undone. The project can only be deleted if no links are currently assigned to it. If links exist, they must be reassigned to another project or have their project assignment removed first. Consider using archive_project instead if you want to preserve data.

GET
/api/v1/lotslink/project/:id

Get Project

lotslink_get_project

Get detailed information about a specific project including the count of links assigned to it. Use this to view complete project details before updating or to check how many links are using the project.

GET
/api/v1/lotslink/projects

List Projects

lotslink_list_projects

List all projects in a workspace with link counts. By default, only active (non-archived) projects are returned. Optionally include archived projects for a complete view. Each project includes the number of links assigned to it.

PUT
/api/v1/lotslink/project/:id

Update Project

lotslink_update_project

Update project details including name, description, color, or client information. You can update one or multiple fields at once. At least one field must be provided for the update.

custom_domains

DELETE
/api/v1/lotslink/custom_domain/:id

Delete Custom Domain

lotslink_delete_custom_domain

Permanently delete a custom domain from the workspace. This action cannot be undone. The domain can only be deleted if no links are currently using it. If links exist, they must be reassigned to another domain or deleted first. Only workspace owners and admins can delete domains.

GET
/api/v1/lotslink/custom_domain/:id

Get Custom Domain

lotslink_get_custom_domain

Get detailed information about a specific custom domain including verification status, SSL certificate status, DNS records required for setup, nameservers, verification timestamps, and count of links using this domain. Any active workspace member can view domain details.

GET
/api/v1/lotslink/custom_domains

List Custom Domains

lotslink_list_custom_domains

List all custom domains and subdomains for a workspace. Returns domain details including verification status, SSL status, DNS records, and link counts. Supports filtering by verification status. Any active workspace member can view domains.

PUT
/api/v1/lotslink/custom_domain/:id

Update Custom Domain

lotslink_update_custom_domain

Update settings for a custom domain. Currently supports activating or deactivating domains. When a domain is deactivated (is_active=false), links using it will not redirect. Only workspace owners and admins can update domain settings.

analytics

GET
/api/v1/lotslink/click_details/:id

Get Click Details

lotslink_get_click_details

Individual click records for a short link (time, approximate location, device, referrer), with filters and pagination. Requires workspace_id and link_id: call lotslink_list_workspaces, then lotslink_list_links.

GET
/api/v1/lotslink/link_analytics/:id

Get Link Analytics

lotslink_get_link_analytics

Click analytics for one short link: all-time total, clicks in the period, average per day, peak day, daily timeline, top countries and cities, devices and referrers. Counts are recorded visits: known bots, link previews and prefetches are left out. Visitor IP addresses are not stored, so there is no unique-visitor count. Requires workspace_id and link_id: call lotslink_list_workspaces, then lotslink_list_links.

GET
/api/v1/lotslink/workspace_analytics/:id

Get Workspace Analytics

lotslink_get_workspace_analytics

Click analytics for a whole workspace. Counts are recorded visits: known bots, link previews and prefetches are left out, and there is no unique-visitor count. Requires workspace_id: call lotslink_list_workspaces first.