Creates a short link in the current workspace. The API enforces plan limits and feature availability for the authenticated organization.
| Field | Type | Required | Description |
|---|---|---|---|
url | string (URI) | ✅ | Destination URL. Missing schemes are automatically prefixed with https://. |
domain_id | integer | ✅ | Domain that will host the link. The API validates ownership and plan eligibility. |
workspace_id | integer | Overrides the default workspace inferred from the token. Useful when a key has access to multiple workspaces. | |
title | string | Optional human-friendly title for reporting. | |
custom_slug | string | Branded slug appended to the domain instead of an auto-generated code. Plan limits and reserved-word checks apply. | |
folder_id | integer | Assigns the link to an existing folder. | |
param | object | Additional query parameters appended to the destination URL (for example UTM tags). Empty values are stripped automatically. | |
generate_qr | boolean | Generates and returns a base64-encoded QR code alongside the link. | |
enable_tracking | boolean | Links the URL to a tracking pixel. Requires pixel_id. | |
pixel_id | integer | Pixel identifier retrieved via the resources endpoint. | |
redirect_type | integer (301 or 302) | Controls whether redirects are permanent or temporary. Defaults to 301. | |
link_cloak | boolean | Cloaks the destination URL. | |
hide_referer | boolean | Removes the referrer header so destination sites do not see the original source. | |
with_password | boolean | Protects the link behind a password. Pair with url_password. | |
url_password | string | Password required to resolve the link when with_password is true. | |
r, g, b | integer (0-255) | RGB color channels used when a QR code is generated. | |
uploaded_logo_type | enum(none, custom, uploaded) | Controls the logo embedded inside generated QR codes. custom reuses the organization logo, uploaded expects uploaded_logo_data. | |
uploaded_logo_data | base64 string | Base64-encoded image used for the QR logo when uploaded_logo_type is uploaded. | |
social_share_title | string | Overrides the OpenGraph title used when the link is shared. | |
social_share_description | string | Overrides the OpenGraph description. | |
social_share_image_data | base64 string | Custom social preview image (PNG/JPEG/SVG). |
Need to attach a stored social preview image that already lives on ShortPen? Setsocial_share_image_datato the base64 payload provided by previous uploads or send the legacysocial_share_image_sessionvalue.
data.short_url — fully qualified link combining the selected domain and slug.data.qr — base64-encoded PNG when generate_qr evaluates to true; otherwise null.data.created — distinguishes between newly created (true) and updated (false) links.message so you can trigger a plan upgrade workflow or notify an operator.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Destination URL that will be shortened.
"https://example.com/launch"
ID of the domain to use for the new short link.
Workspace ID. Defaults to the first workspace associated with the organization when omitted.
Optional human-friendly title for the link.
Custom slug appended to the domain instead of an auto-generated code.
Folder to assign the link to.
Query parameters appended to the destination URL.
Whether to create a QR code for the new short link.
Set to true to associate the link with the specified pixel for event tracking.
Pixel ID used when tracking is enabled.
HTTP redirect status applied when visitors follow the short link.
301, 302 If true, cloaks the destination URL.
If true, removes the referrer header for visitors.
Protects the short link behind a password.
Password required when with_password is true.
Red channel used when generating QR codes.
0 <= x <= 25545
Green channel used when generating QR codes.
0 <= x <= 255151
Blue channel used when generating QR codes.
0 <= x <= 255123
Controls which logo is embedded inside generated QR codes.
none, custom, uploaded Base64-encoded file used when uploaded_logo_type is uploaded.
Overrides the title shown in social previews.
Overrides the description shown in social previews.
Base64-encoded image used for the social preview.