> ## Documentation Index
> Fetch the complete documentation index at: https://developers.sendazi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Short URL

> Generate shortened URLs with advanced tracking capabilities

Shorten long URLs and optionally track visitor analytics including visits, IP addresses, browsers, devices, and referrer sources.

<Note>
  This endpoint uses a different base URL: `https://plvt.me/v1`
</Note>

## Request Body

<ParamField body="url" type="string" required>
  The long URL to shorten
</ParamField>

<ParamField body="track_visits" type="boolean" default="false">
  Enable visit tracking
</ParamField>

<ParamField body="track_ip_address" type="boolean" default="false">
  Track visitor IP addresses
</ParamField>

<ParamField body="track_browser" type="boolean" default="false">
  Track visitor browser information
</ParamField>

<ParamField body="track_operating_system" type="boolean" default="false">
  Track visitor operating system
</ParamField>

<ParamField body="track_device_type" type="boolean" default="false">
  Track visitor device type (mobile, desktop, tablet)
</ParamField>

<ParamField body="track_referer_url" type="boolean" default="false">
  Track referrer URLs
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://plvt.me/v1/url-shortener/create" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://example.com/very/long/url/path?param=value",
      "track_visits": true,
      "track_ip_address": true,
      "track_browser": true,
      "track_operating_system": true,
      "track_device_type": true,
      "track_referer_url": true
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://plvt.me/v1/url-shortener/create', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      url: 'https://example.com/very/long/url/path?param=value',
      track_visits: true,
      track_ip_address: true,
      track_browser: true,
      track_operating_system: true,
      track_device_type: true,
      track_referer_url: true
    })
  });

  const data = await response.json();
  console.log(data.data.short_url);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://plvt.me/v1/url-shortener/create',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'url': 'https://example.com/very/long/url/path?param=value',
          'track_visits': True,
          'track_ip_address': True,
          'track_browser': True,
          'track_operating_system': True,
          'track_device_type': True,
          'track_referer_url': True
      }
  )

  print(response.json()['data']['short_url'])
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
      CURLOPT_URL => 'https://plvt.me/v1/url-shortener/create',
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_POST => true,
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer YOUR_API_KEY',
          'Content-Type: application/json'
      ],
      CURLOPT_POSTFIELDS => json_encode([
          'url' => 'https://example.com/very/long/url/path?param=value',
          'track_visits' => true,
          'track_ip_address' => true,
          'track_browser' => true,
          'track_operating_system' => true,
          'track_device_type' => true,
          'track_referer_url' => true
      ])
  ]);

  $response = curl_exec($curl);
  curl_close($curl);

  $data = json_decode($response, true);
  echo $data['data']['short_url'];
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "status": true,
    "message": "Short URL created successfully",
    "data": {
      "id": "abc123",
      "short_url": "https://plvt.me/abc123",
      "original_url": "https://example.com/very/long/url/path?param=value",
      "track_visits": true,
      "track_ip_address": true,
      "track_browser": true,
      "track_operating_system": true,
      "track_device_type": true,
      "track_referer_url": true,
      "created_at": "2026-01-15T12:00:00.000000Z"
    }
  }
  ```

  ```json 422 - Validation Error theme={null}
  {
    "status": false,
    "message": "Validation failed",
    "errors": {
      "url": ["The url field is required."]
    }
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "status": false,
    "message": "Unauthenticated."
  }
  ```
</ResponseExample>

## Tracking Options

Enable tracking options to gather analytics on your shortened URLs:

| Option                   | Description                                              |
| ------------------------ | -------------------------------------------------------- |
| `track_visits`           | Count total visits to the short URL                      |
| `track_ip_address`       | Log visitor IP addresses                                 |
| `track_browser`          | Identify visitor browser (Chrome, Firefox, Safari, etc.) |
| `track_operating_system` | Identify visitor OS (Windows, macOS, iOS, Android, etc.) |
| `track_device_type`      | Categorize visitors by device (mobile, desktop, tablet)  |
| `track_referer_url`      | Track where visitors came from                           |

<Tip>
  Use shortened URLs in your SMS campaigns to save characters and track engagement!
</Tip>
