This website requires JavaScript to run properly.
to.it.com
api reference

Short links

Create, list, retrieve, and update short links via the public API.

All docs

to.it.com/docs/api-reference/short-links

Create, list, retrieve, and update short links via the public API.

POST /public/v1/short-links

Request body

FieldTypeRequiredDescription
targetUrlstringYesDestination URL
slugstringNoCustom slug (requires plan allowance)
titlestringNoDisplay title (shown on countdown page)
descriptionstringNoOptional description (shown on countdown page)
profileIduuidNoAttach to a profile
isProfileScopedbooleanNoUse /@handle/slug URL pattern
utmSourcestringNoUTM source parameter
utmMediumstringNoUTM medium parameter
utmCampaignstringNoUTM campaign parameter
startsAtISO datetimeNoSchedule activation (Pro/Business)
expiresAtISO datetimeNoSchedule expiration (Pro/Business)
countdownPagebooleanNoShow a live countdown to visitors before startsAt (requires scheduling)
passwordstringNoVisitor password (Pro/Business); stored as bcrypt hash, never returned
passwordBeforeCountdownbooleanNoWhen both password and countdown are enabled, show password first (default true)

Example

curl -X POST https://api.to.it.com/v1/short-links \
  -H "Authorization: Bearer toit_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"targetUrl": "https://example.com", "slug": "demo"}'

Scheduled launch with countdown

curl -X POST https://api.to.it.com/v1/short-links \
  -H "Authorization: Bearer toit_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "targetUrl": "https://example.com/launch",
    "slug": "launch",
    "title": "Product launch",
    "startsAt": "2026-07-10T12:00:00.000Z",
    "countdownPage": true
  }'

PATCH /public/v1/short-links/{shortLinkId}

Send at least one field to update. Scheduling fields require a Pro or Business plan.

FieldTypeDescription
targetUrlstringDestination URL
titlestringDisplay title
descriptionstringOptional description
statusACTIVE / DISABLEDLink status
startsAtISO datetime / nullSchedule activation; pass null to clear
expiresAtISO datetime / nullSchedule expiration; pass null to clear
countdownPagebooleanShow countdown page before startsAt
passwordstringSet or replace the visitor password (Pro/Business)
clearPasswordbooleanRemove password protection from the link
passwordBeforeCountdownbooleanWhen both password and countdown are enabled, show password before countdown

Example

curl -X PATCH https://api.to.it.com/v1/short-links/SHORT_LINK_ID \
  -H "Authorization: Bearer toit_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"countdownPage": true, "startsAt": "2026-07-10T12:00:00.000Z"}'

GET /public/v1/short-links

Optional query parameter: profileId (uuid) to filter by profile.

GET /public/v1/short-links/{shortLinkId}

Returns the short link record and computed shortUrl.

Response fields

Create, list, get, and patch responses include the full short link object. Notable scheduling fields:

FieldTypeDefaultDescription
startsAtstringnullWhen the link becomes active
expiresAtstringnullWhen the link stops redirecting
countdownPagebooleanfalseWhether visitors see a countdown before startsAt
hasPasswordbooleanfalseWhether the link requires a visitor password
passwordBeforeCountdownbooleantruePassword gate order when combined with countdown

Owner API responses include targetUrl and hasPassword. They never include passwordHash or the plain-text password.

When password is set on create or patch:

  • Visitors must enter the password before the destination URL is revealed.
  • The public resolve endpoint does not return targetUrl until all gates (password, countdown) are cleared.
  • After a correct password, the API sets an HttpOnly unlock cookie so visitors are not prompted again during the same visit.
  • Use clearPassword: true on patch to remove protection.

Requirements:

  • Requires Pro or Business (passwordLinks plan feature).
  • Password length: 4–128 characters.
  • Combine with countdown pages using passwordBeforeCountdown to control gate order.

Countdown pages

When countdownPage is true and startsAt is in the future:

  • Visitors who open the short URL see a live countdown (days, hours, minutes, seconds) instead of a 404.
  • When the countdown reaches zero, they are redirected automatically to targetUrl.
  • Click analytics are recorded on redirect, not when the countdown page loads.
  • title and description are shown on the countdown page when set.

Requirements and rules:

  • Requires Pro or Business (same plan gate as link scheduling).
  • countdownPage: true requires startsAt to be set.
  • Clearing startsAt (null) also clears countdownPage.
  • After startsAt has passed, the link redirects normally even if countdownPage remains true.

OpenAPI

See the full interactive API reference generated from our OpenAPI spec.

Next steps

Put the API to work.

Create short links and track clicks from your own apps with a paid plan and API key.