Skip to main content

createShortUrl

Requires permission marketing:link:write.

Creates a short link to a web address. The address must be valid, and a custom alias, when given, must not be taken. The link can have a title, description, tags and an expiry. Needs the marketing link write permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CreateShortUrl($input: CreateShortUrlInput!) {
createShortUrl(input: $input) {
id
shortCode
title
createdAt
clickCount
createdBy
}
}

Variables:

{
"input": {
"originalUrl": "string"
}
}

Response:

{
"data": {
"createShortUrl": {
"id": "string",
"shortCode": "string",
"title": "string",
"createdAt": "2025-01-15T00:00:00Z",
"clickCount": 0,
"createdBy": "string"
}
}
}
createShortUrl(
input: CreateShortUrlInput!
): ShortUrlEntity!

Arguments​

createShortUrl.input ● CreateShortUrlInput! non-null input​

The original URL and optionally a custom alias, title, description, tags and expiry.

Type​

ShortUrlEntity object​

A short link.