---
title: "Shorten URL"
method: POST
path: "/shorten"
tags: ["shortener"]
---

# Shorten URL

`POST /shorten`

## Request

- Base URL: `https://api.smartrecruiters.com/url-shortener`
- URL: `https://api.smartrecruiters.com/url-shortener/shorten`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://www.smartrecruiters.com/identity/oauth/allow`
    - Client credentials
    - Token URL: `https://api.smartrecruiters.com/identity/oauth/token` scopes: `url_shortener_write`
  - API key in header `x-smarttoken`

Shorten provided long url and returns new url as json.
    Allows to shorten only URLs with smartrecruiters.com domain.

## Request body

- Url
  - `url` string

## Response `200`

Created a new shortened url

- Url
  - `url` string

## Other responses

- `400`: When provided URL is not valid, or URL domain is not allowed
- `401`: Unauthorized

---

[API](https://skmtc.dev/smartrecruiters/apis/url-shortener-api.md) - [All operations](https://skmtc.dev/smartrecruiters/apis/url-shortener-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smartrecruiters/apis/url-shortener-api/revisions/ae9438602dbf?raw)
