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

# Create a shortened URL

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

## Request

- Base URL: `https://api-docs.ministrybytext.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.ministrybytext.com/orgunit/{orgunitId}/groups/{groupId}/shortUrls`
- Auth: none declared
- TypeScript: <https://skmtc.dev/ministrybytext/apis/pbt-api-documentation/docs/orgunit/:orgunitId/groups/:groupId/shortUrls/post.ts> (a function with typed inputs; its response is checked against the schema)

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.dev/ministrybytext/apis/pbt-api-documentation.md) - [All operations](https://skmtc.dev/ministrybytext/apis/pbt-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/ministrybytext/apis/pbt-api-documentation/revisions/7d64a1f0b0c3?raw)
