Hi
Product
Features
Security
Difference
Limits
FAQ
Pricing
Doc & Api
Get started free
NEXT-GEN LINK INFRASTRUCTURE

Stop guessing.
Start improving.

Deploy custom domains, ISO country routing, A/B split testing, PathLock™ PIN gates, and deterministic revenue attribution in under two minutes.

Get startedAccess our plans
Platform
  • Country & Device Routing
  • Weighted A/B Testing
  • Revenue Attribution (EPC)
  • Dynamic QR Studio
Security & Access
  • PathLock™ PIN Protection
  • Branded URL Masking
  • Click Limits & Expiration
  • Custom OpenGraph Cards
Developers
  • REST API & SDK Quickstart
  • Real-Time Click Telemetry
  • Signed Webhooks & Events
  • Full Documentation Hub
Legal & Trust
  • Privacy Policy (GDPR)
  • Terms of Service
  • No-Refund Policy
  • Dashboard Overview
LShorter Logo
LShorter© 2026 LShorter Inc.
Built on Cloudflare Edge Network
All 310+ Cloudflare Edge PoPs Operational
Privacy•Terms•Refunds
LShorter Logo
LShorter
HiHiProductProductFeaturesFeaturesSecuritySecurityDifferenceDifferenceLimitsLimitsFAQFAQPricingPricing
Doc & ApiDoc & Api
SDK & API Reference
Endpoints REST, clés Bearer et SDK TypeScript
Routage intelligent & Géo
Ciblage pays, OS mobile et redirection Edge
PathLock™ & Sécurité
Protection par code PIN, expiration et masquage
Télémétrie & Analytics
Flux de clics en direct, attribution et webhooks
RESSOURCESDocumentation

Documentation

Get started
LShorter Logo
LShorter
All guides & documentation

Advanced Security & PIN Code Protection

Protect confidential documents, pitch decks, and private links with a 4-digit PIN code verified on the fly.

3 min read•Official Edge Documentation
Advanced Security & PIN Code Protection

Overview & Architecture

PIN code protection adds an instant zero-friction access control barrier without requiring visitors to create complex accounts or navigate heavy OAuth flows.

When a visitor opens a protected link, a lightweight, secure edge interface prompts them for the 4-digit PIN. Upon validation, an ephemeral session token is granted and redirection executes immediately.

Key Principles

Core architectural pillars ensuring high performance, isolation, and security.

01Cryptographic PIN Hashing
PIN codes are never stored in plaintext; they are securely salted and hashed using Argon2id / bcrypt.
02Anti-Bruteforce Defense
After 5 consecutive failed attempts, the visitor's IP address is temporarily locked out for 15 minutes.
03Ephemeral Session Token
Once validated, redirection takes place immediately with a short-lived cryptographically signed cookie.
SDK Integration

Implementation & SDK Examples

Ready-to-use TypeScript code snippets and configuration examples for your integrations.

1. Creating a PIN-Protected Link

Specify the pinCode property when creating the link:

create-pin-link.ts
typescript
1234567891011
import { lshorter } from "@/lib/lshorter";
const secureLink = await lshorter.links.create({
url: "https://drive.my-company.com/q3-financial-report.pdf",
slug: "finance-q3",
pinCode: "8492", // 4-digit PIN required
tags: ["confidential", "executive"],
});
console.log("Protected link generated:", secureLink.shortUrl);
// Output: https://lsho.cc/finance-q3
REST API Specification

API Endpoints & Reference

Direct HTTP request methods, parameters schema, authentication, and responses.

PATCH

Update PIN Security Settings

Bearer <API_KEY>60 to 1,400 req/min (by plan)
https://lsho.cc/api/v1/links/:id/security

Enables, updates, or disables PIN code protection on a specific short link.

Path Parameters

ParameterTypeRequiredDescriptionExample
idstringRequiredShort link ID or slug alias.finance-q3

Request Body Parameters

ParameterTypeRequiredDescriptionExample
pinCodestring | nullRequired4-digit PIN code string, or null to disable protection.8492
maxAttemptsnumberOptionalMaximum failed attempts allowed before temporary IP block.Default: 55

Request Examples

bash
1234567
curl -X PATCH "https://lsho.cc/api/v1/links/finance-q3/security" \
-H "Authorization: Bearer $LSHORTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pinCode": "8492",
"maxAttempts": 5
}'

Response Payload

200 OKSecurity settings updated successfully.
response-200.json
json
123456789
{
"id": "link_sec_991823ab",
"slug": "finance-q3",
"shortUrl": "https://lsho.cc/finance-q3",
"isProtected": true,
"maxAttempts": 5,
"status": "active",
"updatedAt": "2026-09-17T12:20:00.000Z"
}

Protected Object Structure

The isProtected field confirms the security state without exposing the raw code:

response.json
json
12345678
{
"id": "link_sec_991823ab",
"slug": "finance-q3",
"shortUrl": "https://lsho.cc/finance-q3",
"isProtected": true,
"maxAttempts": 5,
"status": "active"
}

Recommended Best Practices

Expert tips to maximize performance, resilience, and link security.

Recommendation 01

Avoid trivial PINs like 0000 or 1234 for sensitive financial documents or client proposals.

Recommendation 02

Distribute the PIN code through an out-of-band communication channel (e.g. SMS / WhatsApp for PIN, Email for short link).

Recommendation 03

Pair PIN protection with an expiration date (expiresAt) for defense-in-depth confidentiality.

Previous guideDynamic Routing & Edge GeolocationNext guideReal-Time Telemetry & Metrics API

Related Guides & APIs

Quickstart & REST API Reference
Quickstart & REST API Reference
Integrate intelligent edge link shortening, real-time analytics, and conversion tracking with our high-performance REST API and TypeScript SDK.
Read guide & API
Dynamic Routing & Edge Geolocation
Dynamic Routing & Edge Geolocation
Redirect visitors to contextual URLs based on their origin country or continent with ultra-low latency.
Read guide & API