---
title: "Create a shorten URL"
method: POST
path: "/orgunit/{orgunitId}/groups/{groupId}/shortUrls"
tags: ["Short URL"]
---

# Create a shorten URL

`POST /orgunit/{orgunitId}/groups/{groupId}/shortUrls`

This function creates a short URL for a long URL, which can help reduce the message character length. To create a new short URL for an existing long URL, set the "overwrite" parameter to true. The default value is false, which will return the same previously generated short URL. The function takes a longUrl as input and returns a shortened URL.

## Path parameters

- `orgunitId` string, required
- `groupId` string, required

## Request body

- ShorturlsRequest
  - `longUrl` string
  - `overwrite` boolean

## Response `200`

Success

- CreateShorturlsResponseExternalApiResponseNew
  - `data` CreateShorturlsResponse
    - `url` string, nullable
  - `appCode` string, nullable
  - `message` string, nullable
  - `isError` boolean

## Other responses

- `400` — Bad Request
- `403` — Forbidden

---

[API](https://skmtc.net/ministrybytext/apis/pbt-api-documentation.md) · [All operations](https://skmtc.net/ministrybytext/apis/pbt-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ministrybytext/pbt-api-documentation/versions/ca6e9c8f430d/schema)
