> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Shorten.REST

The Shorten.REST connector lets your AI agent act in each user's Shorten.REST account. Each user connects their own Shorten.REST API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 6 tools.

**Authentication:** API Key
**Categories:** Marketing
**Tools:** 6: 3 read, 2 write, 1 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=SHORTENREST)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Shorten.REST connection

   In **AgentKit > Connections**, create a Shorten.REST connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'shortenrest'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Shorten.REST:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'shortenrest_aliases_list',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "shortenrest"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Shorten.REST:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="shortenrest_aliases_list",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Shorten.REST credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'shortenrest_alias_get',
  toolInput: {
    alias_name: '<alias_name>',
  },
  connector: 'shortenrest',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="shortenrest_alias_get",
    tool_input={
        "alias_name": "<alias_name>",
    },
    connection_name="shortenrest",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `shortenrest_alias_get`

Get Short URL · Read-only

Get one short URL by its alias and domain.
Returns the alias name, domain, created and updated times, destinations, meta tags and snippets.
Use shortenrest_aliases_list to find alias names.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `alias_name` (`string`, required): The alias (the path part of the short URL) without a leading slash, case sensitive. For https://short.fyi/aBcDe012 it is aBcDe012. Example: aBcDe012.
- `domain_name` (`string`, optional): Domain the alias belongs to, without http(s):// or slashes. Defaults to short.fyi, Shorten.REST's shared domain; use your own branded domain if you connected one. Example: short.fyi. Default: `short.fyi`.

Example input: `{"alias_name":"<alias_name>"}`

### `shortenrest_aliases_list`

List Short URLs · Read-only

List the alias names on a domain, newest first.
Returns aliases (a list of alias names) and lastId when there are more.
Pass lastId as continue_from for the next page. Use shortenrest_alias_get for an alias's destinations.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `continue_from` (`string`, optional): lastId from the previous response, to get the next batch. Example: 5f1f2c3d4e5f60718293a4b5.
- `domain_name` (`string`, optional): Domain the alias is on, without http(s):// or slashes. Defaults to short.fyi, Shorten.REST's shared domain; use your own branded domain if you connected one. Example: short.fyi. Default: `short.fyi`.
- `limit` (`integer`, optional): Number of aliases to return per request. Defaults to 1000. Example: 100.

Example input: `{}`

### `shortenrest_clicks_list`

List Clicks · Read-only

List raw click records for the account, newest first.
Returns clicks with each click's alias, domain, destination, country, os, browser, referrer, user agent and createdAt (Unix ms), plus lastId when there are more.
Pass lastId as continue_from for the next page.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `continue_from` (`string`, optional): lastId from the previous response, to get the next batch. Example: 5f1f2c3d4e5f60718293a4b5.
- `limit` (`integer`, optional): Number of clicks to return per request. Defaults to 1000. Example: 100.

Example input: `{}`

### `shortenrest_alias_create`

Create Short URL · Write

Create a short URL (an alias) that redirects to one or more destination URLs, optionally per country or operating system.
Returns aliasName, domainName and the full shortUrl.
Leave alias_name empty for a random 7-character alias, or use the @rnd macro for a partly random one.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `destinations` (`array`, required): Where the short URL redirects. Each item has a url and optionally a country (ISO alpha-2 code such as US) and an os (an operating system from Shorten.REST's supported list); an item with only a url is the default destination, and an OS match wins over a country match. Include one default destination. Example: [{"url": "https://www.example.com/landing"}, {"url": "https://www.example.com/us", "country": "US"}]
- `alias_name` (`string`, optional): Alias for the short URL, without a leading slash, case sensitive. Leave empty for a random 7-character alias; @rnd inside it is replaced with random characters (for example spring-@rnd). An alias must be unique on its domain. Example: spring-sale.
- `domain_name` (`string`, optional): Domain to create the alias on, without http(s):// or slashes. Defaults to short.fyi, Shorten.REST's shared domain; use your own branded domain if you connected one. Example: short.fyi. Default: `short.fyi`.
- `metatags` (`array`, optional): Meta tags served on the redirect page, each with a name and content. They override the domain's meta tags of the same name. Example: [{"name": "og:title", "content": "Spring sale"}]
- `snippets` (`array`, optional): Tracking snippets (such as retargeting or conversion pixels) fired on click, each with an id from Shorten.REST's supported snippet list and a parameters object. They override the domain's snippets with the same id. Example: [{"id": "facebook_pixel", "parameters": {"pixel_id": "123456789012345"}}]

Example input: `{"destinations":[{"url":"https://www.example.com/landing"},{"url":"https://www.example.com/us","country":"US"}]}`

### `shortenrest_alias_update`

Update Short URL · Write

Update a short URL's destinations, meta tags or snippets.
Returns the updated alias.
Each array you send replaces the stored array in full, so include every destination you want to keep.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `alias_name` (`string`, required): The alias (the path part of the short URL) without a leading slash, case sensitive. For https://short.fyi/aBcDe012 it is aBcDe012. Example: aBcDe012.
- `destinations` (`array`, optional): Where the short URL redirects. Each item has a url and optionally a country (ISO alpha-2 code such as US) and an os (an operating system from Shorten.REST's supported list); an item with only a url is the default destination, and an OS match wins over a country match. Include one default destination. Example: [{"url": "https://www.example.com/landing"}, {"url": "https://www.example.com/us", "country": "US"}]
- `domain_name` (`string`, optional): Domain the alias belongs to, without http(s):// or slashes. Defaults to short.fyi, Shorten.REST's shared domain; use your own branded domain if you connected one. Example: short.fyi. Default: `short.fyi`.
- `metatags` (`array`, optional): Meta tags served on the redirect page, each with a name and content. They override the domain's meta tags of the same name. Example: [{"name": "og:title", "content": "Spring sale"}]
- `snippets` (`array`, optional): Tracking snippets (such as retargeting or conversion pixels) fired on click, each with an id from Shorten.REST's supported snippet list and a parameters object. They override the domain's snippets with the same id. Example: [{"id": "facebook_pixel", "parameters": {"pixel_id": "123456789012345"}}]

Example input: `{"alias_name":"<alias_name>"}`

### `shortenrest_alias_delete`

Delete Short URL · Destructive

Delete a short URL by its alias and domain. The link stops redirecting.
Returns a confirmation on success.
Use shortenrest_alias_get first to confirm the alias.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `alias_name` (`string`, required): The alias (the path part of the short URL) without a leading slash, case sensitive. For https://short.fyi/aBcDe012 it is aBcDe012. Example: aBcDe012.
- `domain_name` (`string`, optional): Domain the alias belongs to, without http(s):// or slashes. Defaults to short.fyi, Shorten.REST's shared domain; use your own branded domain if you connected one. Example: short.fyi. Default: `short.fyi`.

Example input: `{"alias_name":"<alias_name>"}`

## Related

Other Marketing connectors ([all 190](/agentkit/connectors/?category=marketing)):

- [HubSpot](/agentkit/connectors/hubspot/): Scalekit connector, OAuth, 457 tools
- [Mailchimp](/agentkit/connectors/mailchimp/): Scalekit connector, OAuth, 73 tools
- [Twitter / X](/agentkit/connectors/twitteroauth/): Scalekit connector, OAuth, 92 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
