Create a new link
POST/links
Create a new link for the authenticated project.
Request
Query Parameters
The slug for the project to create links for. E.g. for app.zli.bz/acme
, the projectSlug is acme
.
- application/json
Body
required
Details of the link to create.
The domain of the short link. If not provided, the primary domain for the project will be used (or zli.cx
if the project has no domains).
The short link slug. If not provided, a random 7-character slug will be generated.
The destination URL of the short link.
Default value: false
Whether the short link is archived.
The date and time when the short link will expire in ISO-8601 format. Must be in the future.
The password required to access the destination URL of the short link.
Default value: false
Whether the short link uses Custom Social Media Cards feature.
The title of the short link generated via api.zli.bz/metatags
. Will be used for Custom Social Media Cards if proxy
is true.
The description of the short link generated via api.zli.bz/metatags
. Will be used for Custom Social Media Cards if proxy
is true.
The image of the short link generated via api.zli.bz/metatags
. Will be used for Custom Social Media Cards if proxy
is true.
Default value: false
Whether the short link uses link cloaking.
The iOS destination URL for the short link for iOS device targeting.
The Android destination URL for the short link for Android device targeting.
geo objectnullable
Geo targeting information for the short link in JSON format {[COUNTRY]: https://example.com
}. Learn more: https://zli.cx/geo
Default value: false
Whether the short link's stats are publicly accessible.
The unique id of the tag assigned to the short link.
The comments for the short link.
Responses
- 200
The created link
- application/json
- Schema
- Example (from schema)
Schema
The unique ID of the short link.
The domain of the short link. If not provided, the primary domain for the project will be used (or zli.cx
if the project has no domains).
The short link slug. If not provided, a random 7-character slug will be generated.
The destination URL of the short link.
Default value: false
Whether the short link is archived.
The date and time when the short link will expire in ISO-8601 format. Must be in the future.
The password required to access the destination URL of the short link.
Default value: false
Whether the short link uses Custom Social Media Cards feature.
The title of the short link generated via api.zli.bz/metatags
. Will be used for Custom Social Media Cards if proxy
is true.
The description of the short link generated via api.zli.bz/metatags
. Will be used for Custom Social Media Cards if proxy
is true.
The image of the short link generated via api.zli.bz/metatags
. Will be used for Custom Social Media Cards if proxy
is true.
Default value: false
Whether the short link uses link cloaking.
The iOS destination URL for the short link for iOS device targeting.
The Android destination URL for the short link for Android device targeting.
geo objectnullable
Geo targeting information for the short link in JSON format {[COUNTRY]: https://example.com
}. Learn more: https://zli.cx/geo
Default value: false
Whether the short link's stats are publicly accessible.
The unique id of the tag assigned to the short link.
The comments for the short link.
The full URL of the short link, including the https protocol (e.g. https://zli.cx/try
).
The full URL of the QR code for the short link (e.g. https://api.zli.bz/qr?url=https://zli.cx/try
).
The UTM source of the short link.
The UTM medium of the short link.
The UTM campaign of the short link.
The UTM term of the short link.
The UTM content of the short link.
The user ID of the creator of the short link.
The project ID of the short link.
The number of clicks on the short link.
The date and time when the short link was last clicked.
The date and time when the short link was created.
The date and time when the short link was last updated.
{
"id": "string",
"domain": "string",
"key": "string",
"url": "string",
"archived": false,
"expiresAt": "2024-02-08T04:50:25.532Z",
"password": "string",
"proxy": false,
"title": "string",
"description": "string",
"image": "string",
"rewrite": false,
"ios": "string",
"android": "string",
"geo": {},
"publicStats": false,
"tagId": "string",
"comments": "string",
"shortLink": "string",
"qrCode": "string",
"utm_source": "string",
"utm_medium": "string",
"utm_campaign": "string",
"utm_term": "string",
"utm_content": "string",
"userId": "string",
"projectId": "string",
"clicks": 0,
"lastClicked": "2024-02-08T04:50:25.532Z",
"createdAt": "2024-02-08T04:50:25.532Z",
"updatedAt": "2024-02-08T04:50:25.532Z"
}