Prerequisites
Before you begin, make sure you have:- A H0p account (sign up here)
- A Premium subscription (required for API access)
- A tool to make HTTP requests (cURL, Postman, or your favorite HTTP client)
Step 1: Create your API key
API keys are managed in the H0p dashboard under Developer Tools.1
Navigate to API Keys
Go to Developer Tools > API Keys in the sidebar.
2
Create a new key
Click Create API Key and choose a key type:
- User key - Linked to your account, for personal use
- Bot key - Autonomous machine user, for production systems
3
Configure permissions
Select the permissions your key needs:

4
Copy your key
Your API key is shown only once. Copy it and store it securely (e.g., in environment variables or a secrets manager).

Step 2: List your domains
Let’s verify your API key works by listing your available domains:id of the domain you want to use for creating links.
Step 3: Create your first short link
Now create a short link. The request requires adestination object and optionally a custom slug:
Response:
https://h0p.co/my-first-link.
Step 4: Create a link with advanced options
Create a link with UTM parameters, tags, and other options:Step 5: Get link analytics
Retrieve click statistics using the stats endpoint:
Available
groupBy values:
country,city,region,continentdevice,browser,osreferer,utmSource,utmMedium,utmCampaignshortLinks,uniqueVisitors
Get clicks over time
For time-series data:Step 6: Update a link
Modify an existing link’s destination or settings:Step 7: Delete a link
Remove a link when it’s no longer needed:204 No Content on success.
Next steps
Authentication
Learn about API key types, permissions, and security best practices.
Short links API
Explore advanced link features like routing rules, password protection, and expiration.
Domains API
Add custom domains and configure deep linking.
Webhooks
Set up real-time notifications for link events.
Code examples
- JavaScript
- Python
- Go
Troubleshooting
403 Forbidden error
403 Forbidden error
Possible causes:
- API key doesn’t have required permissions
- Trying to access resources from another organization
- Premium feature on Free plan
409 Conflict error
409 Conflict error
Possible causes:
- Slug already exists
429 Rate limit error
429 Rate limit error
Solution: Implement exponential backoff and wait before retrying.