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

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
urlstringYes-The original URL to be shortened

Response

NameTypeDescription
dataobjectThe data of the URL shortener response
data.urlstringThe original URL that was shortened
data.shortUrlstringThe generated short URL that redirects to the original URL
metadataobjectMetadata about the URL shortener request
metadata.costnumberThe cost of the URL shortener request

Errors

{
  "error": "string", 
  "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid or URL format is incorrect.
400INVALID_REQUESTThe request is invalid.
400UTILS_URL_SHORTNER_ERRORError during URL shortening process.
400INSUFFICIENT_BALANCEThe user has insufficient balance to perform this operation.
401UNAUTHORIZEDThe token is invalid or missing.
429TOO_MANY_REQUESTSThe request limit has been reached.