Skip to main content
POST
Use this endpoint to create a Joylink short link from a destination URL. The API may apply affiliate rewrites before the short link is created, so the final destination is not always identical to the destination you send.

Request body

  • destination (required): URL to shorten.
  • trackingid (optional): Explicit affiliate tracking value. For Amazon links, this always overrides any existing tag query parameter on the destination.
  • require_choices (optional): When true, the API returns 409 choice_required instead of using the default override behavior for supported conflicts.
  • choices (optional): Map of choice ids to selected option ids. Use this when your integration already knows how it wants to resolve a conflict.
  • sub_id2 and sub_id3 (optional): Impact SubID values. These are applied only when the final destination is an Impact affiliate URL. Omit a field to preserve an existing value, or send an empty string to clear it.

Default behavior

When you do not send require_choices: true, the API resolves supported conflicts automatically:
  1. The API starts with the destination you send.
  2. If that destination is already an Impact affiliate link for a supported retailer, and your Joylink account has synced Impact tracking for that retailer, the API rewrites the link to use your tracking by default.
  3. If the final destination is an Impact affiliate URL, sub_id2 and sub_id3 are applied after the Impact keep or override decision.
  4. For Amazon URLs:
    • trackingid always wins and replaces any existing tag.
    • If trackingid is omitted, Joylink uses the Amazon tag configured in your Joylink user settings.
  5. If the product has a Creator Connections campaign available, the API uses that Creator Connections link by default.
  6. If there is no Creator Connections campaign, but a JL extra commission link is available, the API uses that extra commission link by default.
Creator Connections takes precedence over JL extra commission when both could apply.

Choice required

When require_choices is true, the API returns a 409 response with a reusable choice_required envelope instead of taking the default override path. The endpoint evaluates conflicts one at a time, in this order:
  1. impact_link_override
  2. amazon_tag_override
  3. creator_connections_link_override
  4. jl_extra_commission_link_override
If more than one conflict applies, re-send the same request with the returned choice populated in choices, and the API may return another 409 for the next conflict in the sequence. Supported conflicts:
  • An Impact affiliate link that would otherwise be rewritten to use your synced Impact tracking.
  • An Amazon link whose existing tag differs from your Joylink user tag when trackingid is omitted.
  • A product with an available Creator Connections campaign that would otherwise replace the original destination.
  • A product with an available JL extra commission link that would otherwise replace the original destination.
choice_required.options[].url is included when the API can preview the resulting destination ahead of time. Keep options always include it. Override options for Creator Connections and JL extra commission may omit it. Example Impact conflict:
For this Impact conflict:
  • override replaces the existing Impact affiliate link with the affiliate tracking configured on your Joylink account.
  • keep preserves the original affiliate destination instead of replacing it.
The documentation_url field points to this section so an integration can surface a helpful link when it receives the conflict. Example Amazon conflict:
For this Amazon conflict:
  • override replaces the existing Amazon tag with your Joylink user tag.
  • keep preserves the original Amazon tag already present on the destination URL.
Example Creator Connections conflict:
For this Creator Connections conflict:
  • override uses the Creator Connections link that would normally be applied for this product.
  • keep preserves the original destination and skips the Creator Connections link rewrite.
Example JL extra commission conflict:
For this JL extra commission conflict:
  • override uses the JL extra commission link that would normally be applied for this product.
  • keep preserves the original destination and skips the extra commission link rewrite.

Choose the behavior up front

If your integration already knows how it wants to handle this conflict, send the choice up front in the choices object. Example request that uses the default override behavior:
Send an explicit override choice when you want to be fully declarative:
To preserve the original affiliate destination instead, send:
For an Amazon link with no trackingid, preserve the existing Amazon tag with:
If a JL extra commission product is available and you want to keep the original destination, send:
If a Creator Connections campaign is available and you want to keep the original destination, send:
To opt into the 409 flow, send:

Authorizations

X-API-Key
string
header
required

Body

application/json
destination
string
required

URL to shorten. This is the starting destination before any affiliate rewrites are applied.

Example:

"https://www.amazon.com/dp/B0TEST1234?tag=other-tag-20"

trackingid
string

Optional explicit affiliate tracking value. For Amazon links, sending this always overrides any existing tag query parameter on the destination.

Example:

"my-tag-20"

require_choices
boolean

When true, the API returns 409 choice_required instead of using the default override behavior for supported conflicts. Conflicts are evaluated one at a time in this order: impact_link_override, amazon_tag_override, creator_connections_link_override, jl_extra_commission_link_override.

Example:

false

sub_id2
string

Optional Impact SubID2 value. Applied only when the final destination is an Impact affiliate URL. Omit to preserve an existing value, or send an empty string to clear it.

Example:

"campaign-42"

sub_id3
string

Optional Impact SubID3 value. Applied only when the final destination is an Impact affiliate URL. Omit to preserve an existing value, or send an empty string to clear it.

Example:

"post-99"

choices
object

Optional map of choice_required ids to selected option ids. Use override to accept Joylink's default rewrite, or keep to preserve the original value or destination for the returned conflict.

Example:

Response

Successfully created short link

url
string
required

The generated short URL.

Example:

"https://joylink.io/abc123"