Overview
Secure Link API allows you to create shortened, trackable links for any external URL. This guide walks you through creating links with various configuration options.Basic Link Creation
To create a basic link without expiration or view limits:Receive the response
The API returns a 201 Created response with the link details:
The
shortCode is a unique identifier generated for each link. Save this value if you need to revoke the link later.Request Parameters
TheCreateLinkRequestDto accepts the following parameters:
| Parameter | Type | Required | Validation | Description |
|---|---|---|---|---|
targetUrl | string | Yes | Must be a valid URL | The destination URL to redirect to |
expiresAt | string (ISO 8601) | No | Must be a future date/time | When the link should expire |
maxViews | integer | No | Must be positive | Maximum number of times the link can be accessed |
password | string | No | - | Optional password protection (see Password Protection) |
Advanced Examples
Creating a Link with Expiration
Set an expiration date using ISO 8601 format with timezone offset:Creating a Link with View Limit
Limit how many times a link can be accessed:Combining Multiple Options
You can combine expiration, view limits, and password protection:Error Handling
Validation Errors
If validation fails, you’ll receive a 400 Bad Request response:targetUrl: must not be blank- The targetUrl field is requiredtargetUrl: must be a valid URL- The URL format is invalidexpiresAt: must be a future date- The expiration date is in the pastmaxViews: must be greater than 0- The maxViews must be a positive number
Server Errors
For unexpected errors, you’ll receive a 500 Internal Server Error with a reference ID:Use the Reference ID when reporting issues to support for faster troubleshooting.
Best Practices
Validate URLs before submission
Validate URLs before submission
Always validate that your target URLs are properly formatted and accessible before creating links. This prevents user confusion when links fail to resolve.
Use appropriate expiration times
Use appropriate expiration times
Set expiration times based on your use case:
- Marketing campaigns: Match the campaign end date
- Temporary shares: 24-48 hours
- Long-term redirects: Consider no expiration
Store shortCodes securely
Store shortCodes securely
If you need to revoke links later, store the
shortCode value securely in your database with appropriate access controls.Monitor view counts
Monitor view counts
For links with
maxViews set, monitor access patterns to detect if the limit is too restrictive or too permissive.Next Steps
Upload Files
Learn how to create download links for uploaded files
Password Protection
Secure your links with password protection
Link Expiration
Configure expiration and time-to-live settings
Revocation
Manually revoke links before expiration
