Create Link

Create a new shortened link with associated metadata.

POST/api/mobile/link/create

This endpoint creates a new shortened link with the specified parameters and returns the created link details.

Request Body

ParameterTypeRequiredDescription
urlstring
Required
The destination URL for the link
slugstring
Required
The custom slug for the short link
objectsarray
Optional
Additional data associated with the link as key-value pairs
tagsarray
Optional
Tags to categorize the link
commentsstring
Optional
Comments related to the link
passwordstring
Optional
Password protection for the link

Headers

ParameterTypeRequiredDescription
api-keystring
Required
Your API key for authentication
Content-Typestring
Required
Must be set to application/json

Example Request

curl -X POST "https://shortify.com/api/mobile/link/create" \
  -H "api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "slug": "examples",
    "objects": [
      {"key": "id", "value": "e333"},
      {"key": "test", "value": "3323d"}
    ],
    "tags": ["tag1", "tag2", "tag3"],
    "comments": "test comments",
    "password": "test123"
  }'

Response

200
Created
{
  "success": true,
  "data": {
    "id": "cmb0n1z0s0003v131u4xt8fvj",
    "title": "https://shortify.com/examples",
    "url": "https://example.com",
    "domain": "shortify.com",
    "key": "examples",
    "shortLink": "https://shortify.com/examples",
    "expiresAt": null,
    "expiredUrl": null,
    "password": "test123",
    "clicks": 0,
    "lastClicked": null,
    "comments": "test comments",
    "createdAt": "2025-05-23T10:08:59.020Z",
    "updatedAt": "2025-05-23T10:08:59.020Z",
    "userId": null,
    "projectId": "cm70emo9w0003gqzobszo1qqz",
    "linkObjectId": "cmb0n1yx50000v131d1eh4emy",
    "linkObject": {
      "id": "cmb0n1yx50000v131d1eh4emy",
      "object": [
        {
          "key": "id",
          "value": "e333"
        },
        {
          "key": "test",
          "value": "3323d"
        }
      ],
      "createdAt": "2025-05-23T10:08:58.889Z"
    },
    "tags": [
      {
        "id": "cmb0n1yzj0001v1315ajlr9nk",
        "linkId": "cmb0n1z0s0003v131u4xt8fvj",
        "tagId": "cmb0n1z3c0004v131k7n9mzj4",
        "createdAt": "2025-05-23T10:08:58.976Z",
        "updatedAt": "2025-05-23T10:08:58.976Z",
        "tag": {
          "id": "cmb0n1z3c0004v131k7n9mzj4",
          "name": "tag1",
          "color": "blue",
          "createdAt": "2025-05-23T10:08:58.970Z",
          "updatedAt": "2025-05-23T10:08:58.970Z",
          "projectId": "cm70emo9w0003gqzobszo1qqz"
        }
      },
      {
        "id": "cmb0n1z4x0005v1315fgcth8m",
        "linkId": "cmb0n1z0s0003v131u4xt8fvj",
        "tagId": "cmb0n1z5q0006v131wo2l2rxo",
        "createdAt": "2025-05-23T10:08:58.976Z",
        "updatedAt": "2025-05-23T10:08:58.976Z",
        "tag": {
          "id": "cmb0n1z5q0006v131wo2l2rxo",
          "name": "tag2",
          "color": "blue",
          "createdAt": "2025-05-23T10:08:58.972Z",
          "updatedAt": "2025-05-23T10:08:58.972Z",
          "projectId": "cm70emo9w0003gqzobszo1qqz"
        }
      },
      {
        "id": "cmb0n1z7f0007v1317jyd0x5q",
        "linkId": "cmb0n1z0s0003v131u4xt8fvj",
        "tagId": "cmb0n1z8a0008v1314p1xg64g",
        "createdAt": "2025-05-23T10:08:58.976Z",
        "updatedAt": "2025-05-23T10:08:58.976Z",
        "tag": {
          "id": "cmb0n1z8a0008v1314p1xg64g",
          "name": "tag3",
          "color": "blue",
          "createdAt": "2025-05-23T10:08:58.973Z",
          "updatedAt": "2025-05-23T10:08:58.973Z",
          "projectId": "cm70emo9w0003gqzobszo1qqz"
        }
      }
    ]
  }
}

Error Responses

400
Bad Request
{
  "success": false,
  "error": "The url parameter is required"
}
404
Workspace Not Found By API Key
{
  "success": false,
  "error": "Workspace Not Found..Check Your API Key!"
}
409
Conflict
{
  "success": false,
  "error": "Slug already Exist"
}