URL Shortener
Create shortened URLs for easier sharing and tracking. This service generates compact, user-friendly URLs that redirect to your original long URLs.
Endpoint
Create a shortened URL from a long URL
POSThttps://api.xtartapp.com/utils/url-shortner
Additional Endpoints
*Authentication
You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.
Request body
| Name | Type | Required | Max | Description |
|---|---|---|---|---|
| url | string | Yes | - | The original URL to be shortened |
Response
| Name | Type | Description |
|---|---|---|
| data | object | The data of the URL shortener response |
| data.url | string | The original URL that was shortened |
| data.shortUrl | string | The generated short URL that redirects to the original URL |
| metadata | object | Metadata about the URL shortener request |
| metadata.cost | number | The cost of the URL shortener request |
Errors
{
"error": "string",
"code": "string"
}| HTTP Status | Error Code | Message |
|---|---|---|
| 400 | INVALID_PAYLOAD | Occurs when the payload is invalid or URL format is incorrect. |
| 400 | INVALID_REQUEST | The request is invalid. |
| 400 | UTILS_URL_SHORTNER_ERROR | Error during URL shortening process. |
| 400 | INSUFFICIENT_BALANCE | The user has insufficient balance to perform this operation. |
| 401 | UNAUTHORIZED | The token is invalid or missing. |
| 429 | TOO_MANY_REQUESTS | The request limit has been reached. |