POST
https://jmpy.me/api/v1
/
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>",
  "expires_at": "<string>",
  "tracking_enabled": true,
  "url_type": "<string>",
  "subdomain": "<string>",
  "branded_domain": "<string>",
  "campaign_id": "<string>",
  "password": "<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>"
}
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
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.

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.

Password Protection

password
string
Optional password to protect the short URL. When set, users must enter this password before being redirected.Note: Passwords are hashed and stored securely. Cannot be retrieved, only reset.

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: web, api, mcp, extension, or bulk_import.

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
  }'

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"
  }
}

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