Skip to content

Create Tracking Link (Custom Short URL)

Use this endpoint to create a short tracking link that redirects to your specified upstream URL. You can later reference this link when sending messages.

POST https://api.cellcast.com/api/v2/tracking-link

bash
curl --location 'https://api.cellcast.com/api/v2/tracking-link' \
--header 'Authorization: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "shortUrl": "cell",
    "upstreamUrl": "www.cellcast.com"
}'

Request Body

FieldTypeRequiredDescription
upstreamUrlstringYesThe destination URL that users will be redirected to
shortUrlstringNoCustom short URL identifier (at least 3 alphanumeric characters). If not provided, a unique 4-character code will be auto-generated
  • Replace with your actual API key.
  • The shortUrl will appear in your message as gosite.au/{shortUrl}.

After creating a tracking link, retrieve its _id, shortUrl, and longUrl via the list endpoint. See Get Tracking Links.

Examples

With Custom Short URL

bash
curl --location 'https://api.cellcast.com/api/v2/tracking-link' \
--header 'Authorization: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "shortUrl": "mypromo",
    "upstreamUrl": "https://www.example.com/promotion"
}'

Auto-Generated Short URL

bash
curl --location 'https://api.cellcast.com/api/v2/tracking-link' \
--header 'Authorization: {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "upstreamUrl": "https://www.example.com/promotion"
}'

When shortUrl is not provided, the system will automatically generate a unique 4-character alphanumeric code (e.g., xK7m, Ab3Z).

Responses

200 Success

json
{
  "app_type": "web",
  "app_version": "1.0",
  "maintainence": 0,
  "new_version": 0,
  "force_update": 0,
  "invalid_token": 0,
  "refresh_token": "",
  "show_message": 0,
  "is_enc": false,
  "status": true,
  "message": "tracking link created successfully!",
  "message_type": "toast",
  "data": {
    "click": 0,
    "linkSequenceNumber": 0,
    "_id": "68ef6ac42000000000000000",
    "shortUrl": "cell",
    "upstreamUrl": "www.cellcast.com",
    "user": "66208cd39000000000000000",
    "expireAt": "2025-12-15T09:35:00.983Z",
    "createdAt": "2025-10-15T09:35:00.983Z",
    "updatedAt": "2025-10-15T09:35:00.983Z",
    "__v": 0
  },
  "error": {}
}

200 Success (Auto-Generated shortUrl)

json
{
  "app_type": "web",
  "app_version": "1.0",
  "maintainence": 0,
  "new_version": 0,
  "force_update": 0,
  "invalid_token": 0,
  "refresh_token": "",
  "show_message": 0,
  "is_enc": false,
  "status": true,
  "message": "tracking link created successfully!",
  "message_type": "toast",
  "data": {
    "click": 0,
    "linkSequenceNumber": 0,
    "_id": "69adbcc88cf1ded43993e3e9",
    "shortUrl": "bm6W",
    "upstreamUrl": "https://example.com/destination",
    "user": "66208cd39000000000000000",
    "expireAt": "2025-12-15T09:35:00.983Z",
    "createdAt": "2025-10-15T09:35:00.983Z",
    "updatedAt": "2025-10-15T09:35:00.983Z",
    "__v": 0
  },
  "error": {}
}

400 Bad Request - shortUrl Already Exists

json
{
  "app_type": "web",
  "app_version": "1.0",
  "maintainence": 0,
  "new_version": 0,
  "force_update": 0,
  "invalid_token": 0,
  "refresh_token": "",
  "show_message": 0,
  "is_enc": false,
  "status": false,
  "message_type": "toast",
  "message": "shortUrl is already exist",
  "data": {},
  "error": null
}

400 Bad Request - Missing upstreamUrl

json
{
  "app_type": "web",
  "app_version": "1.0",
  "maintainence": 0,
  "new_version": 0,
  "force_update": 0,
  "invalid_token": 0,
  "refresh_token": "",
  "show_message": 0,
  "is_enc": false,
  "status": false,
  "message_type": "toast",
  "message": "upstreamUrl is required",
  "data": {},
  "error": null
}