Base URL

https://api.linkrunner.io/api/v1

Authentication

Generate your server key from https://www.linkrunner.io/settings?s=data-apis

In the request header add the below attribute:

linkrunner-key: YOUR-SERVER-KEY

Create Campaign

POST: /create-campaign

Request Body

{
    "name": "Summer Sale 2023",
    "deeplink": "https://app.domain.com/promo/summer25",
    "link_for_desktop_users": "https://www.your-website.com",
    "custom_display_id": "summer-sale-2025"
}
ParameterTypeDescription
namestringRequired. Name of the campaign
deeplinkstringOptional. Deep link URL for the campaign
link_for_desktop_usersstringOptional. For desktop visitors
custom_display_idstringOptional. Custom identifier for display purposes

Responses

  1. 201 Campaign created successfully
  2. 400 Missing required parameters or invalid input
  3. 401 Invalid server key

Sample Response

Upon successful campaign creation, the API returns:

{
    "msg": "Campaign created successfully!",
    "status": 201,
    "data": {
        "id": 123,
        "name": "Summer Sale 2023",
        "link": "https://app.domain.com/promo/summer25", // deeplink
        "website": "https://www.your-website.com", // link_for_desktop_users
        "custom_display_id": "summer-sale-2025",
        "created_at": "2023-05-01T12:00:00Z"
    }
}

Rate Limiting

To ensure service stability and fair usage, the API has rate limits in place:

  • 10 requests per second

Exceeding these limits will result in a 429 status code response. If you need higher limits for your use case, please contact support.

Best Practices

  1. Campaign naming: Use descriptive names that identify the purpose of the campaign
  2. Deep links: Ensure your deep links are properly formatted and lead to valid destinations
  3. Custom IDs: Use meaningful custom display IDs that are easy to recognize and remember. Duplicate ids are not allowed!
  4. Desktop links: Provide a link_for_desktop_users URL to ensure desktop visitors are redirected to a relevant webpage instead of app stores.

Example

Creating a New Campaign

// Using fetch API
fetch("https://api.linkrunner.io/api/v1/create-campaign", {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "linkrunner-key": "YOUR-SERVER-KEY",
    },
    body: JSON.stringify({
        name: "Product Launch 2023",
        deeplink: "https://app.domain.com/promo/summer25",
        link_for_desktop_users: "https://www.your-website.com",
        custom_display_id: "summer-sale-2025",
    }),
})
    .then((response) => response.json())
    .then((data) => console.log(data))
    .catch((error) => console.error("Error:", error));

Error Handling

The API will return appropriate HTTP status codes along with error messages when issues occur:

  • 400 Bad Request: Campaign name is required or invalid deeplink provided
  • 401 Unauthorized: API key is required or invalid
  • 429 Too Many Requests: You’ve exceeded the rate limit, please try again later
  • 500 Internal Server Error: Contact support if this persists

For any help please reach out to darshil@linkrunner.io