POST
/
short-urls
Create Short URL
curl --request POST \
  --url https://jmpy.me/api/v1/short-urls \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "custom_alias": "<string>",
  "name": "<string>",
  "password": "<string>",
  "tags": [
    {}
  ],
  "expires_at": "<string>",
  "tracking_enabled": true,
  "is_dynamic": true,
  "qrCode": true,
  "qrFormat": "<string>",
  "url_type": "<string>",
  "subdomain": "<string>",
  "branded_domain": "<string>",
  "campaign_id": "<string>"
}
'
{
  "id": "<string>",
  "short_code": "<string>",
  "short_url": "<string>",
  "original_url": "<string>",
  "name": "<string>",
  "custom_alias": "<string>",
  "tracking_enabled": true,
  "url_type": "<string>",
  "subdomain": "<string>",
  "branded_domain": "<string>",
  "expires_at": "<string>",
  "created_at": "<string>",
  "channel": "<string>",
  "qr_code": "<string>",
  "qr_content": "<string>"
}
Create a new short URL from a long URL. You can optionally provide a custom alias, name, expiration date, domain settings, and other advanced features.
Custom Alias Uniqueness: Custom aliases are unique per domain context, not globally. This means:
  • jmpy.me/my-link and acme.jmpy.me/my-link can coexist as separate URLs
  • On the same domain, each alias must be unique
Before using a custom alias, you can check its availability using the Check Alias Availability endpoint.

Request Body

Required Parameters

url
string
required
The original URL to shorten. Must be a valid HTTP or HTTPS URL.Example: https://example.com/very-long-url-with-parameters?foo=bar

Optional Parameters

custom_alias
string
Optional custom alias for the short URL.Requirements:
  • Must be 3-50 characters
  • Alphanumeric with underscores (_) or dashes (-) only
  • Must be unique within the URL type/domain context
Example: my-campaign-link
Use the Check Alias Availability endpoint to verify an alias is available before creating a URL.
name
string
Optional friendly name for the short URL (for your reference).Constraints: 1-255 charactersExample: Q4 Marketing Campaign Link
password
string
Optional password to protect the short URL. When set, users must enter this password before being redirected.Requirements:
  • 8-64 characters
  • Must contain at least one letter
Note: Passwords are hashed and stored securely. Cannot be retrieved, only reset.
tags
array
List of tags for categorization.Example: ["marketing", "social"]
expires_at
string
Optional expiration date in ISO 8601 format. The short URL will return a 410 Gone error after this date.Example: 2025-12-31T23:59:59.000Z
tracking_enabled
boolean
default:true
Whether to enable click tracking and analytics for this URL. When enabled, each click is logged with:
  • Geographic location (country, region, city)
  • Device information (browser, OS, device type)
  • Referrer data
  • UTM parameters
See Analytics API for retrieving click data.
is_dynamic
boolean
default:false
Whether to enable dynamic destination editing for this URL.
  • Standard (false): Uses a 301 Permanent Redirect. Best for SEO and speed, but the original URL cannot be changed once created.
  • Dynamic (true): Uses a 302 Temporary Redirect. Allows you to change the destination URL at any time without changing the short URL.
qrCode
boolean
default:false
Whether to generate a QR code for the short URL. If true, the QR code will encode the short URL with isshortqrscan=1 appended for scan tracking.
qrFormat
string
default:"image"
The format for the returned QR code.
  • image: Returns a native image block (recommended for API/MCP) or base64 data URL.
  • json: Returns just the base64 data URL in the JSON response.

URL Type and Domain Settings

Domain Prerequisite: Before using subdomain or branded URL types, you must first register and verify the domain via the Domains API or through the Dashboard.
url_type
string
default:"standard"
Type of URL to create. Determines the base domain for the short URL.
ValueDescriptionExample URL
standardUses the default jmpy.me domainhttps://jmpy.me/abc123
subdomainUses your registered subdomain on jmpy.mehttps://acme.jmpy.me/abc123
brandedUses your own verified branded domainhttps://go.yourbrand.com/abc123
subdomain
string
Subdomain to use when url_type is subdomain. Must be pre-registered and verified via the Create Subdomain endpoint.Requirements:
  • 3-63 characters
  • Alphanumeric and dashes only
  • Cannot start or end with a dash
  • Must be owned by the authenticated user
Example: acme (results in https://acme.jmpy.me/alias)See List Subdomains to view your registered subdomains.
branded_domain
string
Branded domain to use when url_type is branded. Must be verified via DNS.Example: go.yourbrand.com (results in https://go.yourbrand.com/alias)
See Create Branded Domain to register a new branded domain and Verify Domain for DNS setup instructions.

Campaign and Organization

campaign_id
string
UUID of a campaign to associate this URL with. Must be a campaign owned by the authenticated user.
Campaigns help organize links and provide aggregate analytics. See Create Campaign to set up a new campaign or List Campaigns to find existing campaign IDs.

Response

id
string
Unique identifier for the short URL (UUID).
short_code
string
The generated or custom short code.
short_url
string
The complete short URL ready to share.
original_url
string
The original (destination) URL.
name
string
The friendly name (if provided).
custom_alias
string
The custom alias (if provided).
tracking_enabled
boolean
Whether analytics tracking is enabled.
url_type
string
The URL type: standard, subdomain, or branded.
subdomain
string
The subdomain (if url_type is subdomain).
branded_domain
string
The branded domain (if url_type is branded).
expires_at
string
Expiration date (if set).
created_at
string
ISO 8601 timestamp of creation.
channel
string
Creation channel:api, mcp, extension, or bulk_import.
qr_code
string
Base64-encoded PNG data URL of the generated QR code (if qrCode was true).
qr_content
string
The exact URL encoded in the QR code, including the isshortqrscan=1 tracking parameter.

Request Examples

curl -X POST "https://jmpy.me/api/v1/short-urls" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/very-long-url-with-parameters?foo=bar",
    "custom_alias": "my-link",
    "name": "Marketing Campaign Link",
    "tracking_enabled": true,
    "qrCode": false
  }'

Response Examples

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "short_code": "my-link",
    "short_url": "https://jmpy.me/my-link",
    "original_url": "https://example.com/very-long-url-with-parameters?foo=bar",
    "name": "Marketing Campaign Link",
    "custom_alias": "my-link",
    "tracking_enabled": true,
    "url_type": "standard",
    "subdomain": null,
    "branded_domain": null,
    "expires_at": null,
    "created_at": "2024-01-15T10:30:00.000Z",
    "channel": "api",
    "qr_code": null,
    "qr_content": null
  }
}

Use Cases

Create branded links for campaigns with full analytics tracking:
// First, create a campaign
const campaign = await fetch('https://jmpy.me/api/v1/campaigns', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Summer Sale 2024' })
}).then(r => r.json());

// Then create tracked links for the campaign
const link = await fetch('https://jmpy.me/api/v1/short-urls', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({
    url: 'https://myshop.com/summer-sale',
    custom_alias: 'summer24',
    campaign_id: campaign.data.id,
    tracking_enabled: true
  })
}).then(r => r.json());

// View analytics: /api-reference/analytics/url-overview

Check Alias Availability

Check if a custom alias is available before creating a URL

List Branded Domains

View your registered branded domains

List Subdomains

View your registered subdomains

Create Campaign

Organize links into marketing campaigns

URL Analytics

View click analytics for your URLs

Create QR Code

Generate a QR code for your short URL