Create a new link
Branded short links can be created via a POST method to https://app.linksgpt.com/api/v1/links
.
You can create a new brand link using the brand domain provided by the platform or your own brand domain. If you want to create a new brand link using your own brand domain, you need to connect your domain name in the dashboard first. See How to connect custom domains?
REQUEST EXAMPLE
cURL
curl 'https://app.linksgpt.com/api/v1/links' \
-X POST \
-H 'apikey: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Accept-Language: en' \
-d \
'{
"domain": "demo.xxxx.com",
"title": "Linksgpt",
"destination": "https://www.linksgpt.com",
"path": "MdlM",
"tags": [
"Linksgpt"
],
"utm": {
"source": "facebook",
"medium": "ad",
"campaign": "summer_sale",
"content": "image_ad1"
}
}'
QUERY PARAMETERS
Parameter | Constraints | Description |
---|---|---|
workspace | optional | Your workspace id, if you do not specify the workspace context, the default workspace (your main workspace) will be used. If apikey is used as the authentication mode, you do not need to set this parameter. |
REQUEST BODY
Content-Type: application/json
Payload Example
JSON
{
"domain": "demo.xxxx.com",
"title": "LinksGPT",
"destination": "https://www.linksgpt.com",
"path": "xxxx",
"utm": {
"source": "facebook",
"medium": "ad",
"campaign": "summer_sale",
"content": "image_ad1"
},
"tags": [
"tag1",
"tag2"
]
}
Property | Type | Constraints | Description |
---|---|---|---|
domain | string | optional | A reference to the Domain resource for this short link. Specify either domain id or domain fullName. If not specified, a default domain is used. You can call List your domains to get the domain id or domain name you can use to create a new link. |
title | string | optional | A title you assign to the branded short link in order to remember what's behind it. |
destination | string | required | The destination URL you want your branded short link to point to. |
path | string | optional | The keyword portion of your short link. If not specified, will be autogenerated. |
utm | object | optional | UTM params. |
tags | array of strings | optional | Unique identifier of the Tag resource. If not specified, will not be updated. e.g.["tag1", "tag2"] |
RESPONSE EXAMPLE
JSON
{
"code": 0,
"message": "success",
"data": {
"id": "1681896527355709345",
"workspaceId": "7e3ydi936o",
"domainId": "1664552993913047093",
"domainName": "demo.xxxx.com",
"title": "LinksGPT",
"path": "jEmQ",
"link": "https:\/\/demo.xxxx.com\/jEmQ",
"file": "demo.xxxx.com\/jEmQ",
"recordType": "301",
"destination": "https:\/\/www.linksgpt.com",
"utm": {
"source": "facebook",
"medium": "ad",
"campaign": "summer_sale",
"content": "image_ad1"
},
"tags": ["LinksGPT"],
"createdAt": "2023-06-20 13:19:14",
"updatedAt": "2023-06-20 13:19:14"
}
}
See more HTTP Responses
RESPONSE DATA
Property | Type | Description |
---|---|---|
id | string | Unique identifier of the branded short link. |
workspaceId | string | The workspace id to which the short link belongs. |
domainId | string | The domain id to which the short link belongs. |
domainName | string | The domain name to which the short link belongs. |
title | string | A title you assign to the short link in order to remember what's behind it. |
path | string | The keyword portion of your branded short link. |
link | string | Full brand short link. |
file | string | The brand short link without http schema. |
recordType | string | URL redirect type. |
destination | string | The destination URL your branded short link pointed to. |
utm | object | UTM params. |
tags | array of strings | Unique identifier of the Tag resource. |
createdAt | string | Created time. |
updatedAt | string | Last updated time. |