Create Link
Create a new short link.Request Body
The target URL where the short link will redirect. Must be a complete URL.
The domain for the short link. Must be in the
DUBLY_DOMAINS environment variable.Custom slug for the short link. If omitted, a random 6-character slug is generated. Must be unique for the specified domain.
Optional title or description for the link.
Optional tags for organizing links (comma-separated or any format you prefer).
Optional private notes about the link.
Response (201 Created)
Unique identifier for the link.
The slug portion of the short link.
The domain for the short link.
The complete short URL (https://domain/slug).
The target URL.
The link title.
The link tags.
Private notes.
Whether the link is active. New links are always
true.ISO 8601 timestamp when the link was created.
ISO 8601 timestamp when the link was last updated.
Example
Auto-Generated Slug
Omit theslug field to generate a random 6-character slug:
Errors
400 Bad Request - Missing required field:List Links
Retrieve a paginated list of links with optional search.Query Parameters
Number of links to return. Maximum: 100.
Number of links to skip for pagination.
Search term to filter links by slug, destination, title, or tags.
Response (200 OK)
Array of link objects (same structure as Create Link response).
Total number of links matching the search criteria.
The limit used for this request.
The offset used for this request.
Example
Pagination Example
Get the second page of results:Search Example
Search for links containing “github”:- Slug
- Destination URL
- Title
- Tags
Get Link
Retrieve a specific link by ID.Path Parameters
The unique identifier of the link.
Response (200 OK)
Returns a single link object (same structure as Create Link response).Example
Errors
400 Bad Request - Invalid ID:Update Link
Update an existing link. Only provided fields are updated.Path Parameters
The unique identifier of the link.
Request Body
All fields are optional. Only include fields you want to update.New slug for the link.
New domain for the link. Must be in
DUBLY_DOMAINS.New destination URL.
New title. Pass
null to clear.New tags. Pass
null to clear.New notes. Pass
null to clear.Response (200 OK)
Returns the updated link object.Example
Update Multiple Fields
Clear a Field
To clear optional fields, passnull:
Cache Invalidation
When you update a link’s slug or domain, the old cache entry is automatically invalidated to ensure redirects use the new configuration immediately.Errors
400 Bad Request - Invalid ID:Delete Link
Soft delete a link. The link is marked as inactive but not removed from the database.Path Parameters
The unique identifier of the link.
Response (204 No Content)
No response body is returned on success.Example
Soft Delete Behavior
Deleting a link:- Sets
is_activetofalse - Updates the
updated_attimestamp - Invalidates the cache entry
- Keeps all data and analytics
410 Gone (see Redirects).
Why Soft Delete?
- Preserve analytics - Historical click data remains available
- Prevent reuse - The slug remains reserved for that domain
- Audit trail - You can see when links were deactivated
- Reversible - Links can be reactivated by updating
is_activedirectly in the database if needed