Shorten.REST connects to a Nagent workspace with an API key. Once it is connected, agents can call 6 Shorten.REST actions, such as "Create Alias", "Get Aliases" and "Get click data for aliases". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against Shorten.REST, with input parameters and output schema.
SHORTEN_REST_CREATE_ALIASTool to create a new alias (short URL) under a specified domain. Use when you need to shorten a URL. If no domain is specified, the alias will be attached to the default domain Short.fyi. You can override domain-level Meta Tags and Tracking Snippets by specifying them for each URL.
Input parameters
List of metatags for the alias. Use to override domain-level meta tags
List of tracking snippets for the alias. Use to override domain-level tracking snippets
Alias name (without `/` at the beginning). If not specified, a random alias will be generated
Domain which alias will belong to (string without `http/https` or `/`). If not specified, defaults to 'short.fyi'
List of destination URLs with optional geo-targeting. At least one destination is required
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SHORTEN_REST_DELETE_ALIASTool to delete a single alias by providing alias and domain. Use when you need to remove an existing shortened URL. If no domain is provided, the API searches for the matching alias within the Short.fyi domain.
Input parameters
Alias to delete (without `/` at the beginning). This is the short code identifier for the URL.
Domain which alias belongs to (string without `http/https` or `/`). If not provided, defaults to short.fyi.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SHORTEN_REST_GET_ALIASESTool to retrieve all URL aliases of the authenticated user. Use when you need to list existing aliases (supports pagination).
Input parameters
Maximum number of aliases to return per page (must be ≥ 1)
Cursor token for pagination to fetch the next set of aliases
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SHORTEN_REST_GET_CLICKSTool to retrieve click data for shortened URLs. Use to check click analytics for your aliases. Returns a list of click records which may be empty if no clicks have occurred yet. Returned records may represent a limited window or subset of historical clicks rather than complete per-click logs.
Input parameters
The alias (short code) to retrieve click information for. If not provided, returns clicks for all aliases.
Maximum number of click records to return (must be >= 1)
Cursor token for pagination to fetch the next set of clicks
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SHORTEN_REST_LIST_ALIASES_BY_DOMAINTool to retrieve all alias names associated with your account and a given domain. Results are in descending order by creation date. Use when you need to list alias names (not full details) for a specific domain with pagination support.
Input parameters
Number of results to return per request (must be >= 1). Defaults to 1000 if not specified.
The domain name to get the aliases for (string without `http/https` or `/`). If not provided, defaults to 'short.fyi'.
An ID returned by a previous query to continue aliases retrieval (see last_id in response). Used for pagination.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SHORTEN_REST_UPDATE_ALIASTool to update an existing short URL alias by providing its alias name and domain. Use when you need to modify destinations, metatags, or snippets for an existing alias. IMPORTANT: When updating array properties (like destinations), the entire array is replaced, so you must include all existing records you want to keep.
Input parameters
List of metatags to update. IMPORTANT: When updating array properties, the entire block is replaced, so include all old records you want to keep.
List of snippets to update. IMPORTANT: When updating array properties, the entire block is replaced, so include all old records you want to keep.
The alias name to update (without leading slash, e.g., 'aBcDe012')
Domain which the alias belongs to (without http/https or trailing slash). Defaults to 'short.fyi'.
List of destination URLs to update. IMPORTANT: When updating array properties, the entire block is replaced, so include all old records you want to keep to avoid deleting them.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 6 Shorten.REST actions on Nagent, including "Create Alias", "Get Aliases" and "Get click data for aliases". Create Alias: Create a new alias (short URL) under a specified domain. Each action is listed on this page with its input parameters and its output.
Shorten.REST connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Create Alias takes 1 required input: destinations. It also takes 4 optional inputs: metatags, snippets, aliasName and domainName. It returns data, error and successful.