Skip to main content

How to create short links with prefixes

Short.io allows you to create via the API functionalities short links with prefixes (or static values) in the following format:

<Your-domain> / <Static-value> / <Slug>

For example, mydomain.io/XmasCampaign/SomeShortLink.

To effectively accomplish the task, follow the detailed instructions below.

Before you begin, make sure you have created an API key.

To create folder and prefix

  1. Open the following Short.io API page.

  2. In the Body params panel provide the information:

    • domainId - the unique identifier of your domain (you can retrieve it as described here )

    • name - a folder name

    • prefix - a static value

    API body params with domainId, folder name, and prefix fields highlighted

  3. Navigate to the Credentials section and enter your authorization key:

    Credentials section with API key header and Try It button highlighted

  4. Click on Try it!.

  5. In the Response panel you can review the result:

    API 201 response with folder id, DomainId, name, and prefix values

  6. Copy the folder id from the response.

  1. Open the following Short.io API page.

  2. In the Body params panel provide the information:

    • originalURL - the long link to be shortened

    • domain - the name of your domain

    • folderId - the folder identifier which you copied from the previous response

    Create a new link API endpoint description and method details

    Body params with originalURL field filled in

    Body params with domain hostname and folderId fields filled in

  3. Navigate to the Credentials section and enter your authorization key:

    Credentials section with API key header and Try It button highlighted

  4. Click on Try it!.

  5. In the Response panel you can review the result:

    API 200 response with short link path containing XmasCampaign prefix

  6. Sign in to your Short.io account.

  7. From the Branded links menu you can review the newly created link with the prefix within the folder:

Short.io dashboard showing new link with XmasCampaign prefix in Archives folder