Create a Link
POSThttps://viso.li/api/link/create
Creates a short link from a destination URL. The response is the public URL you can share, plus the optional custom domain and alias.
Omit domain to use viso.li. Custom slugs require a verified custom domain.
Send Authorization: Bearer sk_api_your_api_key on every request. See authentication.
Request body
Send a JSON object. Extra keys are ignored by this endpoint.
Fields for creating a link
| Field | Type | Description |
|---|---|---|
url | string | Required. Destination URL to shorten. Must use http or https. Max 500 characters. |
expiredAt | string | Optional ISO 8601 date when the link should stop redirecting. |
domain | string | Optional custom hostname you have verified in Settings. Example: go.example.com. |
alias | string | Optional custom back-half, 3–64 characters. Letters, numbers, hyphens, and underscores only. Requires domain. |
Example request
This creates a viso.li short link that expires at the end of 2025.
1curl -X POST https://viso.li/api/link/create \
2 -H "Authorization: Bearer sk_api_your_api_key" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "url": "https://mycoolwebsite.com/my-very-long-url",
6 "expiredAt": "2025-12-31T23:59:59.000Z"
7}'
Success response
Returns 201 Created. url is the full short URL.
response.json
1{
2 "url": "https://viso.li/abc123",
3 "domain": null,
4 "alias": null
5}
Response fields
| Field | Type | Description |
|---|---|---|
url | string | Full public short URL. |
domain | string | null | Custom hostname, or null for viso.li. |
alias | string | null | Custom back-half when one was set. |
Errors
| Status | Error | Description |
|---|---|---|
| 400 | Bad Request | Invalid URL, domain, or alias. Custom slugs need a verified domain. |
| 401 | Unauthorized | Missing, malformed, or invalid Bearer token. |
| 409 | Conflict | That alias is already taken on the chosen domain. |
| 429 | Too Many Requests | More than 10 requests per minute or 50 requests per day. |
| 500 | Internal Server Error | Unexpected server error. Retry the request. |