About this endpoint
What it does
Creates a shortened link from a long URL and returns the generated short link details. The request takes the destination URL, and the response returns the original URL plus the generated code, fully qualified short URL, and permanence flag.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| url | String | Yes | Absolute URL to shorten. Must be a valid URI using http or https. |
| permanent | Boolean | No | When true, the link never expires. Default: false. If true, expires_at is omitted in the response. |
Response
Returns a JSON object with a data object field. The data object contains the generated short-link details: code as a string, short_url as a URI string, long_url as a URI string, permanent as a boolean, and expires_at as a nullable date-time string when present. Success response: 200.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object | Yes | Container for the generated short-link details. |
| data.code | String | Yes | Random 7-character base62 code. |
| data.short_url | String | Yes | Fully qualified short URL including /service/u/{code}. |
| data.long_url | String | Yes | The original long URL that was shortened. Must be a valid URI. |
| data.permanent | Boolean | Yes | Indicates whether the link is permanent. |
| data.expires_at | String | No | Absolute expiry timestamp in date-time format. Nullable. Omitted for permanent links. |