The Link Builder API generates affiliate tracking links for any destination URL. POST a URL and the API automatically detects the advertiser and network, then returns a ready-to-use affiliate link. This powers the Hi Energy Chrome extension and can be used by any authorized client.

Key Features
  • Multi-network – Supports Awin, Avantlink, CJ, Connexity, FlexOffers, Impact, Partnerize, Pepperjam, and Skimlinks.
  • Two-step flow – Omit network to discover available networks for the merchant; supply network to generate.
  • Auto-detection – Automatically identifies the advertiser and network from the URL domain.
  • Custom tracking – Optional custom_code parameter for clickref/sub-ID tracking.
  • Feature-gated – Requires link_generator_enabled on your publisher (or admin access).
  • Rate limited – Standard API rate limits apply.

Endpoint

Generate tracking link
POST /api/v1/deeplinks/generate

Generates an affiliate tracking link for the given URL. Returns the tracking URL, network, and advertiser name.

Authentication
X-Api-Key: YOUR_API_KEY

Sign in to get your API key.

Authorization

This endpoint has additional access controls beyond API key authentication:

User TypeAccessRequirement
Admin Allowed No additional requirements
Paid Publisher Allowed link_generator_enabled must be true on publisher record
Agency User Allowed Must manage the target publisher and that publisher must have link_generator_enabled set to true
Free User Denied Returns 403 Forbidden
Paid (feature disabled) Denied Returns 403 Forbidden
Sign in first — the Link Builder requires a paid publisher account with link_generator_enabled, or admin access. Calls from accounts without access return 403 FORBIDDEN; ask your account admin or support if you think you should have access.

API Playground

Drive the endpoint right from this page: paste your API key, type a destination URL, detect the supported networks for the merchant, then generate a tracking link and copy it. Sign in to enable live testing with your API key.

Try it live

Paste a product URL, detect which affiliate networks support the merchant, then generate a tracking link.

POST /api/v1/deeplinks/generate
Sign in to autofill your API key, or paste a key below. The Link Builder requires a paid publisher with link_generator_enabled.
Sent as X-Api-Key. Create one.
The merchant URL you want to wrap with affiliate tracking.
Leave blank to discover supported networks first.
Clickref / sub-ID. Max 50 characters.
Force a specific advertiser. Skips network detection.
Tracking link
Open
Response
Equivalent cURL

cURL reference

Action Method Endpoint Description
List available networks POST /api/v1/deeplinks/generate POST with only url. Response JSON includes domain, advertiser_name, and the supported networks for that merchant.
Generate tracking link POST /api/v1/deeplinks/generate POST with url and network. Response JSON includes deeplink, network, advertiser_name.
With custom code POST /api/v1/deeplinks/generate Include custom_code param for clickref/sub-ID tracking.
List available networks for a URL
curl -X POST "https://app.hienergy.ai/api/v1/deeplinks/generate" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d "url=https://www.example-merchant.com/product/123"
Generate a tracking link
curl -X POST "https://app.hienergy.ai/api/v1/deeplinks/generate" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d "url=https://www.example-merchant.com/product/123" \
  -d "network=awin"
Generate with custom tracking code
curl -X POST "https://app.hienergy.ai/api/v1/deeplinks/generate" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d "url=https://www.example-merchant.com/sale" \
  -d "network=awin" \
  -d "custom_code=spring_campaign"

Parameters

Send parameters as form data or JSON in the POST request body.

ParameterTypeRequiredDescription
urlstringYesThe destination URL to generate an affiliate tracking link for. Must be a valid URL with a domain matching an advertiser in your catalog.
networkstringNoNetwork slug — one of awin, avantlink, cj, connexity, flexoffers, impact, partnerize, pepperjam, skimlinks. When omitted, the API returns the discovery payload listing available networks for the URL. When supplied, the API generates a deeplink and verifies the URL belongs to that network.
custom_codestringNoCustom tracking code (clickref/sub-ID) to embed in the generated link. Maximum 50 characters.
program_idintegerNoAdvertiser/program ID to generate against directly. When supplied, network detection is skipped and the program's network is used. Agency users may use programs that belong to publishers their agency manages.
publisher_idintegerNoPublisher to use for URL discovery and generation. Required for agency users who manage more than one publisher unless program_id is provided.

Response Format

Generation success (200 OK)

Returned when network is supplied (or program_id):

{
  "ok": true,
  "deeplink": "https://www.awin1.com/cread.php?awinmid=12345&awinaffid=99999&ued=https%3A%2F%2Fwww.example-merchant.com%2Fproduct%2F123",
  "network": "awin",
  "advertiser_name": "Example Merchant"
}
FieldTypeDescription
okbooleanAlways true on success.
deeplinkstringThe generated affiliate tracking URL, ready to use.
networkstringThe affiliate network used (e.g. awin, cj, impact).
advertiser_namestringThe matched advertiser's name.
Discovery success (200 OK)

Returned when network is omitted — lists the supported networks the publisher can generate links for on this merchant:

{
  "ok": true,
  "domain": "example-merchant.com",
  "advertiser_name": "Example Merchant",
  "networks": [
    { "symbol": "awin", "name": "Awin", "advertiser_id": 123, "advertiser_name": "Example Merchant" },
    { "symbol": "cj",   "name": "CJ",   "advertiser_id": 456, "advertiser_name": "Example Merchant" }
  ]
}
FieldTypeDescription
okbooleanAlways true on success.
domainstringBare domain extracted from the supplied URL.
advertiser_namestringPrimary advertiser name matched for the domain.
networksarrayDeduplicated list of supported networks. Each item has symbol, name, advertiser_id, and advertiser_name. Pass any symbol back as the network parameter to generate a link.

Error Handling

All errors follow the standard Hi Energy API error format:

{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description"
  }
}
HTTP StatusError CodeDescription
400MISSING_PARAMETERThe url parameter is missing or blank.
400INVALID_URLThe url uses an unsupported scheme (only http and https are accepted).
400PUBLISHER_REQUIREDYour account manages multiple publishers with the Link Builder enabled. Resend with publisher_id.
401UNAUTHORIZEDMissing or invalid API key.
403FORBIDDENLink generator is not enabled for your account, or the requested publisher is outside the publishers you can generate for.
404PROGRAM_NOT_FOUNDThe supplied program_id does not exist or does not belong to a publisher you can access.
422VALIDATION_ERRORA parameter failed validation (e.g. custom_code exceeds 50 characters).
422UNSUPPORTED_NETWORKThe supplied network is not a supported value, or the resolved program belongs to a network we cannot generate links for yet.
422NETWORK_MISMATCHThe supplied network differs from the network detected from the URL. error.details includes both requested_network and detected_network.
422GENERATION_FAILEDCould not generate a tracking link. Domain may be unrecognized, ignored (Amazon/eBay), or the network API call failed.
429RATE_LIMITEDRate limit exceeded. Check Retry-After header.
Ask Dex AIIntegration help

If this page feels TLDR, ask Dex AI.

Dex AI speaks your language, and all the other languages you may not. It will write the integration for you with the right endpoint and headers in one plain-English answer.

The Link Builder API lets you generate affiliate tracking links for any URL. POST a destination URL to /api/v1/deeplinks/generate and receive an affiliate tracking link for the matching advertiser and network. Supports Awin, Avantlink, CJ, Connexity, FlexOffers, Impact, Partnerize, Pepperjam, and Skimlinks.

The Link Builder API requires a paid publisher account with the link_generator_enabled feature flag turned on, or admin access. Free users and publishers without the feature enabled receive a 403 Forbidden response — if you get a 403 and believe your account should have access, contact your account admin or support.

Include the optional custom_code parameter in your POST request body. This sets the clickref or sub-ID for the generated link, allowing you to track campaigns and sources. The custom code must be 50 characters or fewer.

If the domain doesn't match any advertiser in your publisher's catalog, you'll receive a 422 Unprocessable Entity error with code GENERATION_FAILED. Amazon and eBay domains are explicitly ignored and return a specific error message explaining that these networks are not supported.

The Link Builder API supports generating links for Awin, Avantlink, CJ, Connexity, FlexOffers, Impact, Partnerize, Pepperjam, and Skimlinks (CJ refers to Commission Junction). The network is detected from the URL and confirmed by the network parameter you pass back from the discovery response.

Call POST /api/v1/deeplinks/generate with only the url parameter (omit network). The response includes domain, advertiser_name, and a deduplicated networks array. Pick the desired network's symbol and call the same endpoint again with network set to generate the link.

NETWORK_MISMATCH is returned when the network you supplied does not match the network detected from the URL. The error.details object includes both requested_network and detected_network so you can re-issue the request with the correct value (or call the discovery flow first).