Getting started overview

Integrating with the Rebrandly API involves a sequence of steps designed to enable programmatic creation, management, and tracking of branded short links. This guide outlines the essential process from account setup to executing a successful API call. The core steps include establishing a Rebrandly account, locating and securing your API key, and constructing a request to generate your first branded link. Subsequent sections will detail common next steps and provide troubleshooting guidance for initial integration challenges.

Before proceeding, ensure you have access to a command-line interface (CLI) tool like cURL or a programming environment with an HTTP client library, as these are commonly used to interact with RESTful APIs. Rebrandly's API is built on REST principles, utilizing standard HTTP methods (GET, POST, PUT, DELETE) and JSON for request and response bodies, as detailed in the Rebrandly API reference documentation.

Quick reference table

Step What to do Where
1. Sign up Create a Rebrandly account. A free tier is available. Rebrandly pricing page
2. Get API Key Locate your personal API key in your account settings. Rebrandly dashboard > Account Settings > API Keys
3. Choose Domain Select or add a custom domain for your branded links. Rebrandly dashboard > Domains
4. Make Request Send an authenticated POST request to create a link. Rebrandly API /links endpoint
5. Verify Link Check the response for the new short link and test it. Rebrandly dashboard > Links or directly via browser

Create an account and get keys

To access the Rebrandly API, you must first create a Rebrandly account. Rebrandly offers a free tier that allows you to test basic API functionalities, including link creation and management, up to certain limits. Navigate to the Rebrandly website and complete the registration process. During registration, you may be prompted to set up your first custom domain or you can do this later from your dashboard.

Obtaining your API key

After successfully registering and logging into your Rebrandly account, your API key can be found within your account settings. This key is crucial for authenticating all your API requests. Treat your API key as sensitive information, similar to a password, and avoid exposing it in client-side code or public repositories.

  1. Log in to your Rebrandly dashboard.
  2. Navigate to 'Account Settings'.
  3. Look for a section titled 'API Keys' or 'Developer Settings'.
  4. Your API key will be displayed there. Copy this key for use in your API requests.

Rebrandly's API uses a token-based authentication mechanism where the API key is passed in the apikey header of each request. This method is a common approach for securing API access, as described in general API token authentication practices.

Setting up a custom domain

For branded links, you will need to associate a custom domain with your Rebrandly account. If you haven't done so during registration, you can add and configure domains from your Rebrandly dashboard under the 'Domains' section. This involves updating DNS records for your chosen domain to point to Rebrandly's servers. Detailed instructions for configuring custom domains are available in the Rebrandly documentation.

Your first request

Once you have your API key and a custom domain configured, you can make your first API call to create a branded short link. This example uses cURL, a widely available command-line tool for making HTTP requests.

The endpoint for creating new links is https://api.rebrandly.com/v1/links. This endpoint accepts HTTP POST requests with a JSON body containing the details of the link you wish to create.

Example request with cURL

Replace YOUR_API_KEY with your actual Rebrandly API key and YOUR_CUSTOM_DOMAIN.com with one of your configured custom domains. The destination field should be the long URL you want to shorten, and slashtag is the custom part of your short link (e.g., my-product-launch).

curl -X POST \
  https://api.rebrandly.com/v1/links \
  -H 'Content-Type: application/json' \
  -H 'apikey: YOUR_API_KEY' \
  -d '{
    "destination": "https://www.example.com/long-page-for-my-product-launch",
    "domain": { "fullName": "YOUR_CUSTOM_DOMAIN.com" },
    "slashtag": "my-product-launch",
    "title": "My Product Launch Page"
  }'

Expected response

A successful request will return a 200 OK HTTP status code and a JSON object representing the newly created link. The response will include various details about the link, such as its ID, destination, and the full short URL (shortUrl).

{
  "id": "da0f2832049e4d589d84c6c03901b0f5",
  "destination": "https://www.example.com/long-page-for-my-product-launch",
  "shortUrl": "https://YOUR_CUSTOM_DOMAIN.com/my-product-launch",
  "domainId": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "domain": {
    "id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
    "fullName": "YOUR_CUSTOM_DOMAIN.com",
    "active": true
  },
  "slashtag": "my-product-launch",
  "title": "My Product Launch Page",
  "createdAt": "2026-05-29T10:00:00.000Z",
  "updatedAt": "2026-05-29T10:00:00.000Z",
  "status": "active",
  "clicks": 0,
  "favourite": false,
  "hidden": false,
  "lastClick": null,
  "tags": [],
  "scripts": []
}

Verify that the shortUrl in the response matches your expectations and that the destination is correct. You can then test the generated short URL by opening it in a web browser.

Common next steps

After successfully creating your first branded link, consider these common next steps to further integrate Rebrandly into your applications:

  • Retrieve Link Details: Use the GET /v1/links/{link-id} endpoint to fetch detailed information about a specific link, including its analytics.
  • Update Existing Links: Modify link properties like the destination, title, or slashtag using the POST /v1/links/{link-id} endpoint.
  • Manage Domains: Programmatically list, add, or configure custom domains associated with your account using the /v1/domains endpoints.
  • Access Analytics: Explore the various analytics endpoints to retrieve click data, referrer information, and geographical statistics for your links. The Rebrandly link analytics documentation provides comprehensive details.
  • Error Handling: Implement robust error handling in your application to gracefully manage API responses that indicate issues (e.g., 4xx or 5xx HTTP status codes).
  • Explore Webhooks: Rebrandly supports webhooks, allowing you to receive real-time notifications about events such as new link clicks. This can be useful for integrating with other systems. Refer to the Rebrandly webhooks guide for setup instructions.
  • Rate Limits: Be aware of API rate limits to prevent your application from being temporarily blocked due to excessive requests. Implement exponential backoff or similar strategies if you anticipate high-volume usage.

Troubleshooting the first call

Encountering issues during your first API call is common. Here are some typical problems and their solutions:

  • 401 Unauthorized: Invalid API Key

    • Problem: The API key provided is incorrect, expired, or missing.
    • Solution: Double-check that you have copied the API key exactly as it appears in your Rebrandly dashboard. Ensure it's included in the apikey header of your request.
  • 400 Bad Request: Missing or Invalid Parameters

    • Problem: The JSON request body is malformed, or required fields like destination or domain are missing or incorrectly formatted.
    • Solution: Review the Rebrandly API reference for creating links to ensure all required parameters are present and correctly typed (e.g., fullName for the domain). Verify your JSON syntax is valid.
  • 403 Forbidden: Domain Not Configured or Account Limits

    • Problem: The custom domain specified in the request is not properly configured in your Rebrandly account, or your account plan does not permit the requested action (e.g., creating more links than allowed by your free tier).
    • Solution: Confirm that your custom domain is active and linked to your Rebrandly account. Check your Rebrandly plan limits to ensure you are not exceeding them.
  • 409 Conflict: Slashtag Already Exists

    • Problem: The slashtag you attempted to use for your short link is already taken on the specified domain.
    • Solution: Choose a different, unique slashtag or omit the slashtag field to have Rebrandly generate a random one for you.
  • Network Issues or DNS Resolution Failures

    • Problem: Your client cannot reach the Rebrandly API servers.
    • Solution: Verify your internet connection. If using cURL, ensure there are no proxy issues. You can test basic connectivity using ping api.rebrandly.com or nslookup api.rebrandly.com to check DNS resolution, a fundamental internet protocol as described by Mozilla's DNS glossary.
  • Incorrect Content-Type Header

    • Problem: The Content-Type header is not set to application/json.
    • Solution: Ensure your request includes -H 'Content-Type: application/json' as shown in the cURL example.