Skip to main content
POST
Create an ad link

Authorizations

Authorization
string
header
required

An API key (onx_sk_โ€ฆ) created in Onlyx under Settings โ†’ API & MCP, or an OAuth access token (onx_at_โ€ฆ) issued to a connected app. Send it as Authorization: Bearer <credential>. API keys may also be sent as X-API-Key: <key>.

Headers

Idempotency-Key
string

Optional. A unique value (8 to 64 letters, digits, - or _; a UUID is ideal) that makes a retry safe: the same key with the same request within 24 hours returns the stored response, with Idempotent-Replayed: true, instead of doing the work twice. The same key with a different request is 409 IDEMPOTENCY_KEY_REUSED; while the first request still runs it is 409 IDEMPOTENCY_IN_PROGRESS. A malformed key is 400 VALIDATION_ERROR.

Required string length: 8 - 64
Pattern: ^[A-Za-z0-9_-]{8,64}$

Path Parameters

creatorId
string
required

The creator id (cre_โ€ฆ). Ad tracking is for Telegram creators.

Body

application/json
name
string
required

A name for the link, e.g. the campaign (1โ€“80).

Required string length: 1 - 80
destination
enum<string>
default:chat

chat (default) or bot.

Available options:
chat,
bot
greeting
string | null

The prefilled first message of a chat link. Default Hey ๐Ÿ‘‹.

Maximum string length: 200

Response

The new ad link, with the url to put in the ad.

createdAt
string | null
required

When it was created.

destination
enum<string>
required

chat opens her Telegram chat with the fan's first message prefilled (greeting plus a short code that ties him to the click); bot opens her own Stars bot first, which needs no code.

Available options:
chat,
bot
fans
integer
required

Visits that reached her on Telegram.

greeting
string
required

The prefilled first message of a chat link (the code is added after it).

id
string
required

The ad link id (mpl_โ€ฆ).

name
string
required

Your name for it (a campaign or ad set).

purchases
integer
required

Purchases by those fans.

revenueCents
integer
required

Those purchases' value, in US cents.

url
string
required

The url to put in the ad. Meta adds fbclid; UTM parameters are kept.

visits
integer
required

How many times the link page was opened.