L2S - API Docs
Visit L2S
Visit L2S
Get API Key
  1. URL
  • URL
    • Shorten a URL
      POST
    • Get URL details
      GET
    • Update URL details
      PUT
  • User
    • Get user settings
      GET
  1. URL

Shorten a URL

POST
/url
URL
This endpoint shortens a given long URL.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
url
string 
required
The URL to be shortened
Example:
https://example.com/very/long/url
customKey
string 
optional
Custom key for the shortened URL
utmSource
string 
optional
UTM source parameter
utmMedium
string 
optional
UTM medium parameter
utmCampaign
string 
optional
UTM campaign parameter
utmTerm
string 
optional
UTM term parameter
utmContent
string 
optional
UTM content parameter
title
string 
optional
Title for the shortened URL
tags
array[string]
optional
Tags associated with the URL
Example
{
  "url": "https://gregarious-corsage.info",
  "customKey": "sint aliqua ea laboris",
  "utmSource": "ut nostrud commodo",
  "utmMedium": "reprehenderit",
  "utmCampaign": "fugiat Excepteur esse aliquip cupidatat",
  "utmTerm": "occaecat est velit sint",
  "utmContent": "Vel tempore aspernatur amet. Voluptas tempora cupiditate amet totam reiciendis odit. Excepturi quae eum magni excepturi autem molestias non exercitationem. Et nesciunt at. A quam nam error dolore voluptatibus quod ut molestiae.",
  "title": "culpa quaerat veritatis",
  "tags": [
    "deleniti"
  ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.l2s.is/url' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://gregarious-corsage.info",
    "customKey": "sint aliqua ea laboris",
    "utmSource": "ut nostrud commodo",
    "utmMedium": "reprehenderit",
    "utmCampaign": "fugiat Excepteur esse aliquip cupidatat",
    "utmTerm": "occaecat est velit sint",
    "utmContent": "Vel tempore aspernatur amet. Voluptas tempora cupiditate amet totam reiciendis odit. Excepturi quae eum magni excepturi autem molestias non exercitationem. Et nesciunt at. A quam nam error dolore voluptatibus quod ut molestiae.",
    "title": "culpa quaerat veritatis",
    "tags": [
        "deleniti"
    ]
}'

Responses

🟢200URL shortened successfully
application/json
Body
ok
boolean 
optional
Example:
true
response
object 
optional
message
string 
optional
Example:
Operation successful
data
object 
optional
Example
{
  "ok": true,
  "response": {
    "message": "Operation successful",
    "data": {}
  }
}
🟠400Validation Error
🟠401Unauthorized
🔴500Internal Server Error
Modified at 2024-06-17 11:44:23
Next
Get URL details
Built with