---
title: "URL shortener"
method: POST
path: "/shorten/urls"
---

# URL shortener

`POST /shorten/urls`

The endpoint allows to shorten URLs

## Headers

- `Content-Type` string, required
- `Authorization` string, required

## Request body

- object
  - `name` string, required — A human readable name for the shortened url. This will help identify the url in a table, or when fetching analytics data.
  - `longUrl` string, required — The url to be shortened.
  - `domain` string, required — The domain to use when shortening the url. Will be one of the domains registered by the customer, if one is not available we will return an error.
  - `validity` integer — [Optional] For Premium and Enterprise packages the max will be set to 5.184e+6 and 7.776e+6 respectively.
  - `callbackUrl` string — [Optional] The callback we call when a link is clicked. Payload information can be found [here](/docs/callback-url-webhook-1).
  - `tags` object — [Optional] A map of string field values to store information

## Response `200`

200

- object
  - `shortenUrls` object[]
    - `name` string
    - `link` string
    - `trackingId` string
    - `longUrl` string
    - `expirationDate` string
    - `createdAt` string
    - `callbackUrl` string
    - `tags` object
      - `tag1` string
      - `tag2` string

## Other responses

- `400` — 400

---

[API](https://skmtc.net/routee/apis/auth.md) · [All operations](https://skmtc.net/routee/apis/auth/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/routee/auth/revisions/5cef04e8f7d8/schema)
