Endpoint
This endpoint creates a new secure link that redirects to a target URL with optional expiration, view limits, and password protection.
Request Body
The destination URL that the secure link will redirect to.Validation:
- Required field (cannot be blank)
- Must be a valid URL format
- Must include protocol (http:// or https://)
https://example.com/document.pdfISO 8601 timestamp indicating when the link should expire.Validation:
- Must be a future date/time
- Format:
YYYY-MM-DDTHH:mm:ss±HH:mm(ISO 8601 with timezone) - If not provided, the link will not have time-based expiration
2026-12-31T23:59:59+00:00Maximum number of times the link can be accessed before it becomes invalid.Validation:
- Must be a positive integer (> 0)
- If not provided, the link will not have view-based expiration
5Optional password required to access the link. When set, clients must provide this password via the
X-Link-Password header when accessing the link.Security:- Stored as a bcrypt hash
- Required via HTTP header on link resolution
- No length restrictions (recommended: 8+ characters)
mySecurePassword123Response
Unique identifier for the created link. This code is used in the access URL.Format: 8-character alphanumeric stringExample:
K2x9pLmNThe full URL path to access the secure link.Format:
/l/{shortCode}Example: http://localhost:8080/l/K2x9pLmNISO 8601 timestamp when the link expires (if expiration was set).Format:
YYYY-MM-DDTHH:mm:ss±HH:mmExample: 2026-12-31T23:59:59+00:00Maximum number of views allowed (if view limit was set).Example:
5Status Codes
Link successfully created. Response body contains the link details.
Request validation failed. Possible causes:
- Missing or blank
targetUrl - Invalid URL format in
targetUrl expiresAtis not a future datemaxViewsis not a positive integer
timestamp: When the error occurredstatus: HTTP status code (400)error: “Bad Request”message: Specific validation error (e.g., “targetUrl: must be a well-formed URL”)path: Request path that caused the error
Unexpected server error occurred.Error response includes:
timestamp: When the error occurredstatus: HTTP status code (500)error: “Internal Server Error”message: Generic error message with reference ID for troubleshootingpath: Request path that caused the error
Examples
Basic Link (No Expiration)
Link with Time Expiration
Link with View Limit
Fully Protected Link
Password is not returned in the response for security reasons. Users must provide the password via the
X-Link-Password header when accessing the link.Validation Error Example
Request with invalid URL:Past Expiration Date Error
Request with past date:Related Endpoints
Upload Link
Upload a file and create a secure download link
Resolve Link
Access a secure link using its short code
Revoke Link
Permanently disable a secure link
