Gifts API New

Let your users send gifts to a host during a Live Hosts call or while they watch a Live Stream. One gift list, your own prices: each gift has a cost to you, you set your price, and you keep the difference.

Enabled per account. Gifts work for an account that has Live Hosts or Live Streams, which are invite-only and switched on per account. If the gift list comes back empty with "enabled": false, see Gifts are off.

Gifts let your users send a gift to the Titli host they are talking to or watching: in a Live Hosts call (auto or Direct) and in a Live Streams live. The host sees the gift in her app at once, as she does for any gift.

There is one gift list, and it is ours: you cannot add gifts. You decide whether gifts are on, which gifts your users see, and what each gift costs your user. Your app sends a gift with your App Key (no backend needed), or your server with your API key (production hardening); either way we debit your cost for it from your prepaid balance. What you charge your own user is up to you, and the difference is yours.

Set in your dashboard vs. set in code

SettingWhere
Gifts on or off, gift markup and per-gift pricesDashboard: Console → Gifts (or the server-only gifts settings routes)
Gifts in live streams only, on or offDashboard: Console → Live streams → Settings
App Key, its bindings (package name, bundle ID, website, signing certificate) and Quick-mode capsDashboard: Console → Projects → Quick mode
Daily spend cap of a projectDashboard: Console → Projects
Which gift and how many in one sendCode: gift_id and count when you send (the prebuilt sheet asks your user)
Webhook URL and secretDashboard: Console → Projects

Quick mode: gifts from the app with only your App Key

No backend needed. In Quick mode the prebuilt call and viewer screens load the gift list and send gifts with the App Key: you pass no list and no send function, and the gift button shows when gifts are on. Your own screens can call the same methods.

  1. Get your App Key. In the console, open Projects → Quick mode and add your app's package name, bundle ID or website.
  2. Install the package for your platform (see the Client API (Quick mode)).
  3. Init with the App Key, then start a Live Hosts call or watch a live. The gift sheet is there. No server, no tokens.
lib/gifts.dart
await TitliVideo.init(appKey: 'tak_…', userId: 'user-42', userName: 'Asha');

// The prebuilt gift button and sheet work on their own: no list and no send function to pass
final call = await TitliVideo.liveStreams.watch(streamRef);

// Or from your own screens
final list = await TitliVideo.gifts.list();                        // { enabled, version, currency, max_count, gifts }
await TitliVideo.liveHosts.sendGift(callId, 'g_rose', count: 2);   // in a Live Hosts call
await TitliVideo.liveStreams.sendGift(streamRef, 'g_rose');        // in a live stream
final mine = await TitliVideo.gifts.history();                     // this user's own sends
final one = await TitliVideo.gifts.get(sendId);                    // one of them
In the appWhat it does
TitliVideo.gifts.list()The gift list with your prices (without your cost).
TitliVideo.liveHosts.sendGift(callId, giftId, count)A gift to the host in a Live Hosts call.
TitliVideo.liveStreams.sendGift(ref, giftId, count)A gift to the host of a live stream.
TitliVideo.gifts.history()This user's own sends (the same filters as in the table below).
TitliVideo.gifts.get(id)One of this user's sends.

Each one calls the matching route under /v1/client with the App Key, with the same parameters as the tables below. The end user is always the signed-in user, the history shows only that user's own sends, and your cost and what you keep are left out of every answer. The SDK makes the client_request_id and repeats it safely after a lost answer.

Each sent gift is debited from your prepaid balance (your cost), exactly as with a server, and your Quick-mode caps (console → Projects → Quick mode) limit what one app can spend. If your users pay you for gifts, take that payment in your app your own way; when you want that payment checked against your own price list on a machine you control, send gifts from a server (production hardening, below).

Stays on your server (or in the console) only: gift settings (GET and PATCH /v1/gifts/settings), your prices and hidden gifts (PUT /v1/gifts/:gift_id), stats (GET /v1/gifts/stats), and every figure about your cost and what you keep, including the full receipts for your books. They are your business numbers, so the App Key cannot reach them.

Concepts

TermMeaning
GiftOne item of the gift list: a name, an icon and an animation.
gift_idStable ID of a gift (g_… or x_…). Use it to send and to set your price.
Cost (cost)What we debit from your balance when one gift is sent.
Your price (price)What you charge your user for one gift, in your billing currency. You set it; without a price of your own the gift is offered at the gift list price (plus your default markup, if you set one).
You keep (you_keep)price minus cost: what stays with you for one gift.
Gift list price (min_price)Your price cannot be below the gift list price. max_price is the highest price you may set.
SendOne request that gives count of one gift to the host of one call or live. It has an id, a status and a signed receipt.
client_request_idYour unique ID for one send (max 64 characters). Sending it again never charges twice; see Idempotency and retries.
versionA short string that changes whenever the list your users see (the gifts you did not hide) or one of your prices changes. Your app’s cache key.
max_countThe most gifts one send may carry (99 unless we set another number for your account).

Example: a gift costs you ₹60, you charge ₹150, you keep ₹90. Your user sends 3: we debit ₹180 from your balance, you collected ₹450 from your user, and ₹270 stays with you. These numbers are only an example, not a price list: the real cost of every gift is in your console (Gifts) and in GET /v1/gifts.

We never charge your user and never see your wallet. You collect price from your user in your own way (credits, a wallet, in-app purchase); we debit only cost from your prepaid balance.

Production hardening (optional): server tokens

You do not need a server to start: Quick mode works with the App Key alone. Add a server when you want strict control over every call (who joins which call, for how long, in which role): keep the project key on your server and mint a short-lived join token per person there. The app uses the same SDK and hands it a token instead of the App Key. Both ways can run side by side.

The steps below send gifts from your server instead: the price check, the payment from your user and the send all happen on a machine you control.

With a server: quickstart

Base URL https://api-videosdk.titliapp.com. Auth is the same as the rest of /v1: HTTP Basic key_id:key_secret, server to server only (see Authentication).

1. List the gifts (your server)

terminal
curl -s $API/v1/gifts -u "$KEY_ID:$KEY_SECRET"

2. Give your app the list

From your own backend. Send only what your user needs: gift_id, name, icon_url, animation_url, category, price, currency (and enabled, version, max_count). Do not send cost or you_keep to the app: they are your business figures. Cache the list on your server and in the app; reload it when version changes.

The answers of POST /v1/live-hosts/calls and POST /v1/live-streams/:stream_ref/join carry "gifts": { "enabled": true, "version": "…" }, so your app knows whether to show a gift button, and whether its cached list is still current, without another request.

3. Show the gifts in the app

The SDKs have a gift model, a small controller on the call (call.gifts) and an optional gift button with a sheet in the prebuilt call and viewer screens; see In the app. The SDKs never hold your API key: they call a function of yours, which asks your backend.

4. Send from your server

When your user taps Send, take your price from your user first, then:

terminal
# in a Live Hosts call
curl -s $API/v1/live-hosts/calls/$CALL_ID/gifts -u "$KEY_ID:$KEY_SECRET" -H 'Content-Type: application/json' \
  -d '{"gift_id":"g_rose","count":1,"client_request_id":"8f1c2f0e-6a5b-4d0e-9a51-0c1e6f4f2b7d","expected_price":150}'

# in a live stream
curl -s $API/v1/live-streams/$STREAM_REF/gifts -u "$KEY_ID:$KEY_SECRET" -H 'Content-Type: application/json' \
  -d '{"end_user_id":"user_123","gift_id":"g_rose","count":1,"client_request_id":"…","expected_price":150}'

201 means it was sent and your cost was debited. 202 with "status": "pending" means it is not confirmed yet: keep your user’s payment and wait for the gift.sent or gift.failed webhook. Give your user their money back only when the answer says "refunded": true, when it is a 4xx refusal from the error table, or when gift.failed arrives. On 429, a 5xx without "refunded": true, or no answer at all, keep the payment and repeat the same request with the same client_request_id. The full rules are in Idempotency and retries.

Take the price from your own gift list, never from the app. Your server looks the gift up in its current list, charges your user that price × count, and sends that price as expected_price. An amount that comes from the app can be changed by the user. See the server example.

5. Play the animation

Play the animation when the gift data message arrives in the app (onLiveEvent), and record the send from the answer or the gift.sent webhook (and handle gift.failed).

A complete server example

The whole server side in one file: the list for your app, the send and the webhook. It takes the price from its own gift list, charges your user first, always sends expected_price, and gives the money back only when the gift was definitely not sent.

server.js
// Your server (Node 20+, Express). Complete on its own: the helper, the list, the send, the webhook.
//
// chargeUser(), keep() and giveBack() are YOUR wallet, keyed by client_request_id:
//   chargeUser(user, id, what, amount)  takes the amount once per id; answers false when that id
//                                       was already used for another gift, count, session or user
//   keep(id)                            the gift was sent: this payment is final
//   giveBack(id)                        returns a payment that is not final (never one that was kept)
const AUTH = 'Basic ' + Buffer.from(process.env.TITLI_KEY_ID + ':' + process.env.TITLI_KEY_SECRET).toString('base64');
async function titli(path, body) { // throws on a timeout or a network failure: then there is no answer
  const r = await fetch('https://api-videosdk.titliapp.com' + path, {
    method: body ? 'POST' : 'GET', signal: AbortSignal.timeout(10000),
    headers: { Authorization: AUTH, 'Content-Type': 'application/json' }, body: body && JSON.stringify(body),
  });
  return { status: r.status, data: await r.json().catch(() => ({})) };
}

// The list for your app: your prices only. cost and you_keep are your business figures: keep them here.
app.get('/api/gifts', requireLogin, async (req, res) => {
  const { data } = await titli('/v1/gifts');
  res.json({ enabled: data.enabled, version: data.version, max_count: data.max_count,
    gifts: (data.gifts || []).map((g) => ({ gift_id: g.gift_id, name: g.name, icon_url: g.icon_url,
      animation_url: g.animation_url, category: g.category, currency: g.currency, price: g.price })) });
});

// Refusals before any debit: nothing was sent, so the money goes back to your user.
const REFUSED = ['gifts_disabled', 'gift_unavailable', 'gift_price_changed', 'gift_host_unavailable',
  'gift_not_in_session', 'gift_idempotency_conflict', 'insufficient_balance', 'invalid_request'];

// The app posts { gift_id, count, client_request_id, expected_price }: a fresh client_request_id
// (a UUID) for every gift, and the SAME one when it repeats a send that got no clear answer.
app.post('/api/calls/:callId/gift', requireLogin, async (req, res) => {
  const { gift_id, client_request_id, expected_price } = req.body;
  const count = Number(req.body.count ?? 1);
  // (check here that this call belongs to req.user)
  const list = (await titli('/v1/gifts')).data;   // cache it in real code; reload when version changes
  const gift = (list.gifts || []).find((g) => g.gift_id === gift_id);
  if (!gift) return res.status(400).json({ error: { code: 'gift_unavailable' } });
  if (!Number.isInteger(count) || count < 1 || count > list.max_count
      || !/^[A-Za-z0-9_.:-]{1,64}$/.test(client_request_id || '')) {
    return res.status(400).json({ error: { code: 'invalid_request' } });
  }

  // 1. The price is the one in YOUR current list, never a number from the app. If the app showed
  //    another price, charge nothing: it shows the new price and your user confirms.
  const price = gift.price;
  if (expected_price != null && Number(expected_price) !== price) {
    return res.status(409).json({ error: { code: 'gift_price_changed', price } });
  }

  // 2. Take your price x count from your user, once per client_request_id.
  const what = ['call', req.params.callId, gift_id, count].join('/');
  if (!(await chargeUser(req.user.id, client_request_id, what, price * count))) {
    return res.status(409).json({ error: { code: 'gift_idempotency_conflict' } });
  }

  // 3. Send it, always with expected_price = the price you charged.
  let r;
  try {
    r = await titli('/v1/live-hosts/calls/' + req.params.callId + '/gifts',
      { gift_id, count, client_request_id, expected_price: price });
    // in a live stream: '/v1/live-streams/' + streamRef + '/gifts', with end_user_id: req.user.id added
  } catch {
    // No answer (timeout, network): unknown. KEEP the payment; the app repeats with the SAME id.
    return res.status(502).json({ error: { code: 'unknown' } });
  }
  const e = r.data.error;
  if (!e) {
    if (r.data.status === 'sent') await keep(client_request_id);    // 201, or 200 for a repeat
    // 202 "pending": your cost stays held. Keep the payment until the webhook below decides.
    return res.status(r.data.status === 'pending' ? 202 : 200).json({ id: r.data.id, status: r.data.status });
  }

  // 4. Give the money back ONLY when the answer says "refunded": true, or it is a refusal before
  //    any debit. 429 and 5xx without "refunded" decide nothing: the gift may still be delivered
  //    and billed, so the payment stays and the app repeats with the SAME client_request_id.
  const back = e.refunded === true || (r.status >= 400 && r.status < 500 && r.status !== 429 && REFUSED.includes(e.code));
  if (back) await giveBack(client_request_id);
  res.status(r.status).json({ error: { code: e.code, user_message: e.user_message, user_message_hi: e.user_message_hi, user_code: e.user_code,
    ...(e.refunded === true ? { refunded: true } : {}),
    ...(e.code === 'gift_price_changed' ? { price: e.price } : {}) } });
  // never pass cost, you_keep or balance on to the app
});

// Your webhook endpoint (verify the Titli-Signature header on the raw body first, see /docs/webhooks)
app.post('/webhooks/titli', async (req, res) => {
  const { event, data } = req.body;
  if (event === 'gift.sent') await keep(data.gift.client_request_id);       // also for a send that was pending
  // gift.failed: a pending send was refused and our debit was returned: give your user the money back
  if (event === 'gift.failed') await giveBack(data.gift.client_request_id);
  res.sendStatus(200);
});
// A payment that stayed open and was never repeated by the app: ask
// GET /v1/gifts/sends?client_request_id=...  ->  sent: keep · refused: give back · pending: wait ·
// no send at all: the request never reached us and nothing was debited: give back.

REST reference

Errors use the usual shape {"error":{"code","message"}}; every code is also listed on the Error codes page. Money is in your billing currency (INR or USD), in major units, on a fixed grid: INR amounts have at most 4 decimals, USD amounts at most 6.

These are the server routes (HTTP Basic with a project key). With the App Key the app reaches the gift list, its own sends and the two send routes under /v1/client, with the same parameters; settings, prices and stats stay server-only. Every parameter of every route is in the tables.

List gifts

GET/v1/gifts

Your gift list with your prices. Query: include=hidden to also get the gifts you hid.

ParameterTypeRequiredDefaultAllowed valuesWhat it meansExample
includestringoptional (query)none (hidden gifts left out)hiddenSend hidden to also get the gifts you hid.hidden
FieldTypeWhat it means
enabledbooleanWhether gifts can be sent now.
reasonstring or nulloff_by_you or not_available when gifts are off, otherwise null.
currencystringYour billing currency.
max_countintegerThe most gifts one send may carry.
versionstring or nullChanges whenever the list or one of your prices changes: your cache key.
giftsarrayThe gifts: gift_id, name, icon_url, animation_url, category, price, hidden, currency, and in server answers also cost, you_keep, min_price, max_price, price_source, price_needs_review.
Response
{ "enabled": true, "reason": null, "currency": "INR", "max_count": 99, "version": "3f9a1c0b7d2e4a61",
  "gifts": [ { "gift_id": "g_rose", "name": "Rose", "icon_url": "https://…", "animation_url": "https://…",
               "category": "classic", "cost": 60, "price": 150, "you_keep": 90,
               "min_price": …, "max_price": …, "price_source": "own", "price_needs_review": false,
               "hidden": false, "currency": "INR" } ] }

The numbers in this answer are the example from above, not real prices.

  • version is always the version of the list without the gifts you hid, also with include=hidden.
  • max_count: the most gifts one send may carry (count). It is 99 unless we set another limit for your account; read it from this answer.
  • min_price is the gift list price: your price cannot be below the gift list price. max_price is the highest price you may set.
  • price_source: own (a price you set for this gift), markup (the gift list price plus your default markup) or default (the gift list price).
  • price_needs_review: true: the price you set is no longer between the gift list price and max_price, so it is not used; the gift is offered at the gift list price until you set a new one.
  • icon_url is a still image; animation_url is the animation file, or null for a gift without one.
  • When gifts are off: "enabled": false, "gifts": [] and reason: off_by_you (you switched them off) or not_available (gifts are not available for your account right now).
  • GET /v1/live-streams/gifts is an alias with the same answer (plus data, the same list), and it also follows the Live streams gift switch.

Gift settings

GET/v1/gifts/settings

Your own switches.

ParameterTypeRequiredDefaultAllowed valuesWhat it meansExample
No parameters.
FieldTypeWhat it means
enabledbooleanYour own switch.
default_markup_pctnumberYour default markup.
availablebooleanGifts are available for your account.
activebooleanWhat counts: available and enabled.
reasonstring or nulloff_by_you or not_available when not active.
price_floorstringlist_price or your_cost: which floor your prices have.
max_countintegerThe most gifts one send may carry.
currencystringYour billing currency.
PATCH/v1/gifts/settings

Body: enabled (boolean) and/or default_markup_pct (your default markup for every gift without a price of your own).

ParameterTypeRequiredDefaultAllowed valuesWhat it meansExample
enabledbooleanoptionalunchangedtrue, falseGifts on or off for your account. Send at least one of the two fields.false
default_markup_pctnumberoptionalunchangeda number of 0 or more, up to the limit your console shows (2 decimals kept)Your default markup, added to the gift list price of every gift without a price of your own.…
FieldTypeWhat it means
enabledbooleanYour own switch.
default_markup_pctnumberYour default markup.
availablebooleanGifts are available for your account.
activebooleanWhat counts: available and enabled.
reasonstring or nulloff_by_you or not_available when not active.
price_floorstringlist_price or your_cost: which floor your prices have.
max_countintegerThe most gifts one send may carry.
currencystringYour billing currency.
Response
{ "enabled": true, "default_markup_pct": …, "available": true, "active": true, "reason": null,
  "price_floor": "list_price", "max_count": 99, "currency": "INR" }

active is what counts: gifts are available for your account (available) and you have them on (enabled). price_floor says which floor applies to your prices: list_price (the gift list price) or your_cost. Either way the floor of each gift is its min_price in the list, and your price cannot be below it.

Set your price, or hide a gift

PUT/v1/gifts/:gift_id

Body: hidden (boolean) and/or price (a number above 0 in your currency; null = no price of your own any more). Answers the gift as in the list.

ParameterTypeRequiredDefaultAllowed valuesWhat it meansExample
gift_idstringrequired (in the path)–an ID from the gift listThe gift to change.g_rose
hiddenbooleanoptionalunchangedtrue, falseHide the gift from your app, or show it again.true
pricenumber or nulloptionalunchangedabove 0, from <code>min_price</code> to <code>max_price</code>; <code>null</code> = back to the default priceYour price for one gift, in your billing currency.15
FieldTypeWhat it means
gift_id, namestringThe gift's ID and name.
icon_url, animation_urlstring or nullA still image, and the animation file (null for a gift without one).
categorystring or nullThe gift's group, for example classic.
costnumberWhat one gift costs you.
pricenumberWhat your user pays for one gift.
you_keepnumberprice minus cost.
min_price, max_pricenumberThe gift list price (your price cannot be below it) and the highest price you may set.
price_sourcestringown, markup or default.
price_needs_reviewbooleanYour own price is out of range and is not used.
hiddenbooleanYou hid this gift from your app.
currencystringINR or USD.
terminal
# your own price for one gift
curl -s -X PUT $API/v1/gifts/g_rose -u "$KEY_ID:$KEY_SECRET" -H 'Content-Type: application/json' -d '{"price":150}'

# hide it from your app (send "hidden":false to show it again)
curl -s -X PUT $API/v1/gifts/g_rose -u "$KEY_ID:$KEY_SECRET" -H 'Content-Type: application/json' -d '{"hidden":true}'
  • 400 gift_price_below_cost when price is below the gift list price (min_price); the error carries min_price.
  • 400 invalid_request when price is above max_price; the error carries max_price.
  • 400 gift_unavailable for a gift that is not in the list.

Send a gift in a Live Hosts call

POST/v1/live-hosts/calls/:call_id/gifts

A gift from the call’s end user to the call’s host. The call must be connected. Body: gift_id (required), count (1 to max_count, which is 99 by default; default 1), client_request_id (required: your unique ID for this send, max 64 of A-Z a-z 0-9 _ . : -; a UUID is a good choice), expected_price (the price of one gift in your list, the one you showed your user; optional, but always send it: see Price guard).

ParameterTypeRequiredDefaultAllowed valuesWhat it meansExample
idstring (UUID)required (in the path)–a Live Hosts call of your key's projectThe call. The gift goes from its end user to its host; the call must be connected.5d2c9a44-0b1e-4c7a-9f21-6e3d8a7b1c02
gift_idstringrequired–1–80 of <code>A-Z a-z 0-9 _ -</code>, an ID from the gift listWhich gift to send.g_rose
countintegeroptional11 to <code>max_count</code> of the gift list (99 unless set otherwise for your account)How many of this gift to send in one go.1
client_request_idstringrequired–1–64 of <code>A-Z a-z 0-9 _ . : -</code>Your unique ID for this gift. Repeating it never charges twice. The SDKs make one for you.8f1c2f0e-6a5b-4d0e-9a51-0c1e6f4f2b7d
expected_pricenumberoptional–above 0, in your billing currencyThe price of one gift you showed your user. If it is not the current price, nothing is sent (409 gift_price_changed). Always send it.15
FieldTypeWhat it means
idstringID of the send.
objectstringAlways gift.
statusstringsent, pending or refused.
surfacestringcall (a Live Hosts call) or stream (a live stream).
gift_id, name, countstring, string, integerThe gift and how many.
end_user_idstringWho sent it.
call_idstringThe Live Hosts call it was sent in (surface call only).
stream_ref, stream_idstringThe live it was sent in (surface stream only).
hostobjecthost_ref and name of the host who got it.
cost, unit_costnumberYour cost for the send and for one gift (server answers only; left out in Quick mode).
price, unit_price, you_keepnumberYour price for the send and for one gift, and what stays with you (you_keep is left out in Quick mode).
currencystringINR or USD.
client_request_idstringYour ID for this gift, as sent.
errorstring or nullThe refusal code of a refused gift, otherwise null.
created_at, decided_atstring (ISO time)When it was asked for and when it was decided.
replaybooleantrue when this answers a repeat of an earlier client_request_id.
balancenumberYour balance after the send (server answers only).
receipt, receipt_signatureobject, stringThe signed receipt of a sent gift.
Response
{ "id": "0b7e6c1a-…", "object": "gift", "status": "sent", "surface": "call",
  "gift_id": "g_rose", "name": "Rose", "count": 2, "end_user_id": "user_123",
  "call_id": "5d2c9a44-…", "host": { "host_ref": "h_3Qe…", "name": "Riya" },
  "cost": 120, "unit_cost": 60, "price": 300, "unit_price": 150, "you_keep": 180, "currency": "INR",
  "client_request_id": "8f1c2f0e-…", "error": null,
  "created_at": "2026-11-28T10:15:02.114Z", "decided_at": "2026-11-28T10:15:02.391Z",
  "replay": false, "balance": …,
  "receipt": { … }, "receipt_signature": "…" }

cost, price and you_keep are for the whole send (count gifts); unit_cost and unit_price are for one. balance is your balance after the send. status is sent, pending or refused (refunded exists only on sends made before 28 November 2026; treat it as refused). The HTTP status is 201 for a gift sent now, 200 for a repeated client_request_id and 202 for pending.

Pending. A send answered 202 with "status": "pending" was debited but is not confirmed yet. Your cost stays held until the gift is confirmed (it becomes sent and the gift.sent webhook fires) or definitely refused (it becomes refused, the debit is returned and the gift.failed webhook fires with "refunded": true). Nothing is refunded just because time passed. Repeating the request with the same client_request_id is always safe and answers the current state.

Send a gift in a live stream

POST/v1/live-streams/:stream_ref/gifts

A gift from one of your viewers to the host of the live. The end user must be watching (an open viewer session). Body: end_user_id (required) and the same gift_id, count, client_request_id, expected_price.

The answer is the same object with "surface": "stream" and stream_ref + stream_id in place of call_id.

Sent gifts

GET/v1/gifts/sends

The sends of your key’s project, newest first. Query: surface (call or stream), state (pending, sent, refused, refunded), call_id, stream_ref, end_user_id, gift_id, client_request_id (finds the one send you made with that ID), before (ISO time; pass next_before of the previous page), limit (1–200, default 50). Answer: { "data": [ … ], "next_before": "…" | null }.

ParameterTypeRequiredDefaultAllowed valuesWhat it meansExample
surfacestringoptional (query)bothcall, stream (another value is ignored)Only sends of one kind.stream
statestringoptional (query)allpending, sent, refused, refunded (another value is ignored)Only sends in this state.pending
call_idstringoptional (query)alla Live Hosts call IDOnly sends in this call.5d2c9a44-0b1e-4c7a-9f21-6e3d8a7b1c02
stream_refstringoptional (query)alla <code>stream_ref</code>Only sends in this live.ls_8fK2a9
end_user_idstringoptional (query)allup to 128 charactersOnly sends by this end user.user_123
gift_idstringoptional (query)allan ID from the gift listOnly sends of this gift.g_rose
client_request_idstringoptional (query)allup to 64 charactersFinds the one send you made with this ID.8f1c2f0e-6a5b-4d0e-9a51-0c1e6f4f2b7d
beforestring (ISO time)optional (query)none (newest first)ISO time: <code>next_before</code> of the previous page (a value that is not a time is ignored)Only sends made before this time.2026-11-28T10:15:02.114Z
limitintegeroptional (query)501–200 (a bigger number is treated as 200)How many sends at most.100
FieldTypeWhat it means
dataarrayThe sends, newest first, each like the answer of a send (without replay, balance and the receipt).
next_beforestring or nullPass it as before for the next page; null on the last page.

To settle a send whose answer you never got, look it up with GET /v1/gifts/sends?client_request_id=…: an empty data means the request never reached us and nothing was debited; otherwise status tells you where it stands (pending is still held, sent is final, refused was returned).

GET/v1/gifts/sends/:id

One send of your key’s project (a send of another project answers 404); for a sent gift it also carries receipt, receipt_signature, "algorithm": "Ed25519" and key_id.

ParameterTypeRequiredDefaultAllowed valuesWhat it meansExample
idstring (UUID)required (in the path)–the <code>id</code> of a send of your key's projectThe send you want.0b7e6c1a-2d4f-4a8e-b1c3-9f0e7d6c5b4a
FieldTypeWhat it means
idstringID of the send.
objectstringAlways gift.
statusstringsent, pending or refused.
surfacestringcall (a Live Hosts call) or stream (a live stream).
gift_id, name, countstring, string, integerThe gift and how many.
end_user_idstringWho sent it.
call_idstringThe Live Hosts call it was sent in (surface call only).
stream_ref, stream_idstringThe live it was sent in (surface stream only).
hostobjecthost_ref and name of the host who got it.
cost, unit_costnumberYour cost for the send and for one gift (server answers only; left out in Quick mode).
price, unit_price, you_keepnumberYour price for the send and for one gift, and what stays with you (you_keep is left out in Quick mode).
currencystringINR or USD.
client_request_idstringYour ID for this gift, as sent.
errorstring or nullThe refusal code of a refused gift, otherwise null.
created_at, decided_atstring (ISO time)When it was asked for and when it was decided.
receipt, receipt_signatureobject, stringFor a sent gift: the signed receipt.
algorithm, key_idstringEd25519 and the signing key.

Each send also names its host: host: { host_ref, name }. The console's Download CSV on Sent gifts gives the same sends, one per row, with these columns: id, created_at, status, surface, session, end_user_id, host_ref, host_name, gift_id, name, count, unit_cost, cost, unit_price, price, you_keep, currency, client_request_id, error. session is the call_id or stream_ref; error is the error code of a refused gift and empty otherwise. Amounts are in currency.

Stats

GET/v1/gifts/stats

Query: group (day, gift, end_user, host, surface), from, to (ISO, default the last 30 days), surface, limit (default 100, max 1000), format=csv. Sent gifts only.

ParameterTypeRequiredDefaultAllowed valuesWhat it meansExample
groupstringoptional (query)dayday, gift, end_user, host, surfaceWhat one row adds up.gift
fromstring (ISO time)optional (query)to minus 30 daysISO 8601 time, before <code>to</code>Start of the window.2026-11-01T00:00:00Z
tostring (ISO time)optional (query)nowISO 8601 timeEnd of the window.2026-11-30T00:00:00Z
surfacestringoptional (query)bothcall, streamOnly sends in Live Hosts calls, or only in live streams.call
limitintegeroptional (query)1001–1000How many rows at most.50
formatstringoptional (query)JSONcsvSend csv for a CSV file with field-name headers.csv
FieldTypeWhat it means
group, from, tostringWhat you asked for.
dataarrayOne row per key: key, name, sends, gifts, end_users, cost, revenue, you_keep, currency, last_at.
totalsobjectsends, gifts, cost, revenue, you_keep over all rows (money is null when two currencies are mixed).
currency, timezonestringYour billing currency and time zone.
Response
{ "group": "gift", "from": "…", "to": "…", "currency": "INR", "timezone": "Asia/Kolkata",
  "data": [ { "key": "g_rose", "name": "Rose", "sends": 2, "gifts": 3, "end_users": 2,
              "cost": 180, "revenue": 450, "you_keep": 270, "currency": "INR", "last_at": "…" } ],
  "totals": { "sends": 2, "gifts": 3, "cost": 180, "revenue": 450, "you_keep": 270 } }

sends counts requests, gifts counts gifts (the sum of count), revenue is the sum of your prices. The console shows the same numbers under Gifts and downloads them as CSV.

In the app

In Quick mode you can skip this part: the prebuilt screens load the list and send with the App Key (see Quick mode). What follows is for apps that send gifts through a server.

The SDKs are client side and never hold your API key. Each one gives you:

  • a gift model and a parser for the list your server relays (cost and you_keep are not part of it);
  • call.gifts: the list, an enabled flag (false when the list has no enabled), maxCount, setCatalog(…) and send(gift, count). send makes a unique client_request_id (a UUID), calls your function with the request, and returns what your function returns. Your function posts { gift_id, count, client_request_id, expected_price } to your backend. After the call or live ended, send fails at once with gift_not_in_session;
  • isStale(brief) and applyBrief(brief) for the short "gifts": { "enabled", "version" } of a call-create or stream-join answer: they switch enabled and tell you to fetch the list again when the version differs, without dropping the list the app already has;
  • typed errors with the code values of the error table and a neutral sentence you can show your user as is (error.user_message from our answer, as your backend relayed it). userMessageHi is the same sentence in Hindi (error.user_message_hi); the prebuilt sheet shows it when the app runs in Hindi, and the English one otherwise;
  • an optional gift button and sheet in the prebuilt call and viewer screens: a grid of the gifts (icon, name, your price), a count and Send. It is shown only when you gave a list with "enabled": true and at least one gift and a send function. Otherwise nothing is added to the screen. After gift_price_changed the sheet shows the new price from the answer, and an optional onGiftsReloadNeeded callback tells your app to fetch the list again.
SDKGive the list and your send function
Web / JSTitliCall.join(url, token, { container, giftCatalog, onSendGift }), then session.gifts
FlutterTitliCallScreen(call: call, giftCatalog: …, onSendGift: …) or TitliCall.connect(…, giftCatalog:, onSendGift:), then call.gifts
AndroidTitliCallScreen(call = call, giftCatalog = …, onSendGift = TitliGiftSender { … }) or TitliCallOptions(giftCatalog = …, onSendGift = …), then call.gifts
iOSTitliCallView(url:token:…, giftCatalog: …, onSendGift: { request in … }), then call.gifts
React Native<TitliCallScreen giftCatalog={…} onSendGift={…} /> or TitliCall.join(url, token, { giftCatalog, onSendGift }), then call.gifts

What your backend should hand back to the app for a send: on success a small object of your own with the send id and status (sent or pending; the SDKs keep the client_request_id of a pending send, so the same gift sent again is a repeat and not a second gift); on an error the fields error.code, error.user_message, error.user_message_hi, error.user_code, error.refunded when it is true and, for gift_price_changed, error.price. Leave out cost, you_keep, balance and the gift object: they are yours.

The gift data message

When a gift was sent, the app gets it as a live event (onLiveEvent in every SDK). With raw LiveKit it is a reliable data message on topic titli.live, JSON:

Data message
{ "type": "gift", "id": "0b7e6c1a-…", "at": "2026-11-28T10:15:02.391Z",
  "from": { "role": "partner", "end_user_id": "user_123" },
  "gift": { "gift_id": "g_rose", "name": "Rose", "icon_url": "https://…", "animation_url": "https://…", "count": 2 } }
  • In a Live Hosts call it goes only to the end user who sent it (the call has one end user), so use it to play the animation on the sender’s screen. The host sees the gift in her own app. For a send that was pending first, the message arrives when the gift is confirmed, if the call is still on.
  • In a live stream gifts from everyone watching arrive through the stream’s feed, as described in Live Streams (from.name, and from.end_user_id only for your own users). A feed item has no animation_url: take the animation from your list by gift_id (the SDKs do this for you when you gave them the list).

Your controls

In the console under Gifts, or with the API. Changes apply to the next send; a send that was already made keeps its figures.

ControlConsoleAPI
Gifts on / off for your accountGifts → SettingsPATCH /v1/gifts/settings { "enabled": false }
Hide / show one giftGifts → the gift’s row (or select several)PUT /v1/gifts/:gift_id { "hidden": true }
Your price for one giftGifts → the gift’s pricePUT /v1/gifts/:gift_id { "price": 150 } (null = no price of your own)
Default markup for every gift without a price of your ownGifts → SettingsPATCH /v1/gifts/settings { "default_markup_pct": … }
Gifts off in live streams onlyLive streams → Settings → Gifts in my appconsole only
  • Your own price. Set any price from the gift list price (min_price) to the gift’s max_price. Your price cannot be below the gift list price: a lower one is refused (gift_price_below_cost, with min_price).
  • Default markup. It is added to the gift list price of every gift you have not priced yourself. A price you set for one gift wins over the markup.
  • Hide. A hidden gift leaves GET /v1/gifts (unless include=hidden), and sending it answers gift_unavailable.
  • Off. With gifts off, the list is empty with "enabled": false, the gifts field of call-create and stream-join answers says "enabled": false, and every send answers 403 gifts_disabled.

You cannot add gifts, change a gift’s name or art, or price a gift below the gift list price. Every change you make is in your audit log (console → Audit), whether it came from the console or from an API key.

Billing

  • When: your cost (cost = unit_cost × count) is debited from your prepaid balance when the gift is sent. Nothing else is billed for a gift.
  • Refunds are automatic: if the host cannot receive the gift (the call or live just ended, she left, your user was removed), the debit goes back to your balance at once and the answer is the error with "refunded": true. You never pay for a gift that did not arrive.
  • Pending sends stay held: while a send is pending its cost stays debited. It is returned only when the gift is definitely refused (gift.failed), never because time passed.
  • Your balance never goes below zero: a send whose cost is above your balance is refused with 402 insufficient_balance before anything is sent. The call or the live goes on under its own rules.
  • Ledger: each sent gift is one usage line in your ledger and statement.
  • Spending caps and alerts: a gift counts towards the project’s spend of the day, and balance.low fires as for any usage.
  • A sent gift is final. It cannot be taken back or refunded afterwards.

Receipt

Each sent gift has a signed receipt (Ed25519, the same key as call receipts; verify it with GET /v1/receipts/public-key or POST /v1/receipts/verify, as for calls):

Receipt
{ "receipt_version": 1, "kind": "gift", "key_id": "…", "gift_send_id": "0b7e6c1a-…", "app_id": "app_…",
  "surface": "call", "call_id": "5d2c9a44-…", "end_user_id": "user_123", "host_ref": "h_3Qe…",
  "gift_id": "g_rose", "name": "Rose", "count": 2, "currency": "INR",
  "unit_cost": 60, "amount": 120, "unit_price": 150, "price": 300, "you_keep": 180,
  "client_request_id": "8f1c2f0e-…", "created_at": "…", "decided_at": "…",
  "cost_breakdown": [ { "kind": "gift", "count": 2, "unit_cost": 60, "cost": 120 } ] }

amount is what was debited. A stream gift has stream_id in place of call_id.

Webhooks: gift sent and gift failed

Both are delivered to your project’s webhook URL with the usual envelope and Titli-Signature header (see Webhooks).

gift.sent fires once for every gift that was sent, also for one that was pending first:

Webhook
{ "id": "<event id>", "event": "gift.sent", "created_at": "2026-11-28T10:15:02.400Z",
  "data": {
    "gift": { "id": "0b7e6c1a-…", "object": "gift", "status": "sent", "surface": "call",
              "gift_id": "g_rose", "name": "Rose", "count": 2, "end_user_id": "user_123",
              "call_id": "5d2c9a44-…", "host": { "host_ref": "h_3Qe…", "name": "Riya" },
              "cost": 120, "unit_cost": 60, "price": 300, "unit_price": 150, "you_keep": 180, "currency": "INR",
              "client_request_id": "8f1c2f0e-…", "error": null, "created_at": "…", "decided_at": "…" },
    "receipt": { … }, "receipt_signature": "…" } }

gift.failed fires when a send that was answered 202 pending is definitely refused. The debit is back in your balance and the send is refused: give your user the money back.

Webhook
{ "id": "<event id>", "event": "gift.failed", "created_at": "2026-11-28T10:15:40.120Z",
  "data": {
    "gift": { "id": "0b7e6c1a-…", "object": "gift", "status": "refused", "surface": "call",
              "gift_id": "g_rose", "name": "Rose", "count": 2, "end_user_id": "user_123",
              "call_id": "5d2c9a44-…", "host": { "host_ref": "h_3Qe…", "name": "Riya" },
              "cost": 120, "unit_cost": 60, "price": 300, "unit_price": 150, "you_keep": 180, "currency": "INR",
              "client_request_id": "8f1c2f0e-…", "error": "gift_host_unavailable", "created_at": "…", "decided_at": "…" },
    "refunded": true } }

A send that is refused in the answer to your request (a 4xx, or an error with "refunded": true) fires no webhook: the answer already told you. Match both webhooks to your records by gift.client_request_id.

Idempotency and retries

Every send needs a client_request_id. It is unique per account, not per call: use a fresh UUID for every gift your user sends, and the same one when you repeat that request.

AnswerMeaningYour user’s payment
201 + "status": "sent"Sent now; your cost was debitedShow it; keep your user’s payment
200 + "replay": trueThis client_request_id was already sent; this is the first result again. Nothing was charged againThe same as for 201
202 + "status": "pending"Debited, but the gift could not be confirmed yet. We keep asking until it is confirmed or refused; your cost stays held meanwhile, and nothing is refunded just because time passedKeep your user’s payment. gift.sent follows when it goes through. If it is refused, the debit is returned, the send becomes refused and gift.failed ({ gift, refunded: true }) tells you: give your user the money back then. You can also read GET /v1/gifts/sends/:id, look it up with GET /v1/gifts/sends?client_request_id=…, or repeat the request with the same client_request_id
An error with "refunded": true (any status)Not delivered; a debit was made and returned. This answer is finalGive your user the money back. A new try is a new gift with a new client_request_id
4xx with a refusal code: gifts_disabled, gift_unavailable, gift_price_changed, gift_host_unavailable, gift_not_in_session, gift_idempotency_conflict, insufficient_balance, invalid_requestRefused before anything was debitedGive your user the money back
429 rate_limitedToo many sends; this request was not looked atKeep the payment. Wait for Retry-After, then repeat with the same client_request_id
5xx without "refunded": trueUnknown: the gift may still be delivered and billedKeep the payment. Repeat with the same client_request_id, or wait for gift.sent / gift.failed
No answer (timeout, network)UnknownKeep your user’s payment. Repeat the same request with the same client_request_id. It can never be charged twice

Do not give your user’s money back just because the HTTP status is 400 or above. There are three reasons to give it back: the answer says "refunded": true; the answer is one of the 4xx refusals above; or gift.failed arrived. And never return a payment whose gift was already sent.

  • Repeating a client_request_id with a different gift, count, end user, call or live answers 409 gift_idempotency_conflict.
  • A send that was refused keeps its answer: repeating its client_request_id returns the same error. To try again after a refusal, use a new client_request_id (it is a new gift).
  • The SDKs follow these rules: call.gifts.send makes a new ID for every send and reuses the previous ID only when the same gift and count are sent again while the outcome is not known: after a failure without a clear answer (no answer, 429, a 5xx without "refunded": true) or after a pending result. An error with "refunded": true is final for them: the next send gets a new ID. The request your function receives carries the ID; pass it to your backend and on to us unchanged.

Price guard

Prices can change between the moment your app loaded the list and the moment your user taps Send (you changed a price, or a gift list price changed). Send expected_price, the price of one gift that you charged your user. If it is not the current price, nothing is sent and the answer is 409 gift_price_changed with the new price (and cost) of one gift: reload the list, show the new price, and let your user confirm.

Without expected_price the send always uses the current price, so always send it: your server takes it from its own current gift list, the same amount it charges your user, and passes that number as it is, without rounding (prices are on a fixed grid: INR 4 decimals, USD 6; USD prices are whole cents unless we set a price for a gift ourselves). If the app’s request carries the price it showed (the SDKs fill it in from the list they were given), compare it with yours first and answer gift_price_changed yourself when they differ. Never charge from the app’s number.

Errors

Errors use the usual shape. error.code is the code to switch on. Every error also carries error_code (the same code in upper case), user_message (a neutral sentence that is safe to show your user as is), user_message_hi (the same sentence in Hindi), a short user_code your user can quote to your support, and docs_url, which points to that code on the Error codes page (/docs/errors#CODE). The codes in the table below link to their entries there. Show your user one of those two sentences, never message or a code on its own: message is written for you.

Error
{ "error": { "code": "gift_price_changed", "message": "The price of this gift has changed. Show the new price and send it again.",
             "gift_id": "g_rose", "price": …, "cost": 60, "currency": "INR",
             "error_code": "GIFT_PRICE_CHANGED", "user_code": "GF-409",
             "user_message": "The price of this gift has changed. Please check it and try again.",
             "user_message_hi": "इस गिफ्ट की कीमत बदल गई है। कृपया देखकर फिर कोशिश करें।",
             "docs_url": "https://videosdk.titliapp.com/docs/errors#GIFT_PRICE_CHANGED" } }

A balance refusal on a gift tells your user: “Gifts are unavailable right now. Please try again later. (code VB-402)”. It says nothing about your balance.

HTTPcodeWhenWhat to do
402insufficient_balanceYour balance is below the cost of this send. Carries cost, balance, currency. Nothing was debitedRecharge; the next request works at once. Give your user the money back. Your user sees “Gifts are unavailable right now. Please try again later. (code VB-402)”. Act on balance.low so this never reaches your users
403gifts_disabledGifts are off. reason: off_by_you or not_availableSwitch gifts on (console → Gifts, or Live streams → Settings for lives), or hide the gift button
400gift_unavailableThe gift is not in your list any more: removed, hidden by you, or unknownReload the list (version has changed) and let your user pick again
409gift_price_changedexpected_price is not the current price. Carries gift_id, price, cost, currencyReload the list, show the new price, send again after your user confirms
400gift_price_below_costSetting a price below the gift list price (PUT /v1/gifts/:gift_id). Carries min_priceYour price cannot be below the gift list price: set it at or above min_price
409gift_host_unavailableThe host cannot receive it: the call or live has ended, she left, or she is hidden for your accountNothing stays charged. Give your user the money back. Do not retry for an ended session
409gift_idempotency_conflictclient_request_id was already used for a different giftUse a new client_request_id for every new gift; reuse one only to repeat the same request. The ID belongs to an earlier gift: never return the payment of that earlier gift if it was sent
403gift_not_in_sessionThe call is not connected yet, or the end user is not watching that liveOffer gifts only while your user is in the call or watching the live
429rate_limitedMore than 10 sends a second (burst 50) for your account, or the limit for all gifts on the platform was reachedKeep your user’s payment. Wait for Retry-After, then repeat with the same client_request_id
503partner_unavailableThe gift could not be delivered. With "refunded": true the debit was returned and this answer is finalWith "refunded": true: give your user the money back; a new try needs a new client_request_id. Without it: keep the payment and repeat in a few seconds with the same client_request_id
400invalid_request / invalid_client_request_idA field is missing or malformed (count above max_count, no client_request_id, …)Fix the request
403live_hosts_disabled / live_streams_disabledThe product is not enabled for your accountAsk support
404not_foundUnknown call (or one of another project)Check the ID and the key

A send that was debited and then not delivered answers with the error plus "refunded": true, the gift object (status refused) and your balance. A send that was pending first reports the same through the gift.failed webhook.

Older code names. Three answers had other names before the gift list existed. Where the server knows the old name it adds error.legacy_code, so an integration written against the old names can keep working while you move: insufficient_balance always carries "legacy_code": "balance_zero"; gift_idempotency_conflict carries "idempotency_conflict"; and on a live stream gift_not_in_session carries "not_viewer" when the end user has no open viewer session. legacy_code is not on every answer: switch on error.code.

Edge cases

A gift was removed while my app still shows it. The send answers gift_unavailable and nothing is charged. The list’s version has changed: reload the list. Compare the version in each call-create / stream-join answer with the one your app cached to catch this before your user taps.

A price changed while my user was choosing. With expected_price you get gift_price_changed and the new price; without it the send goes through at the current price. Send expected_price if you show prices.

My balance is too low. 402 insufficient_balance, before anything is sent. The call or live is not ended by this. Recharge and the next send works.

A send stays pending. Your cost stays held and nothing is returned by a timer. The send ends in one of two ways: gift.sent (keep your user’s payment) or gift.failed with "refunded": true (give it back). Until then keep the payment; repeating the request with the same client_request_id answers 202 again and never sends or bills a second gift.

I got 429 or a 5xx. The gift may still be delivered and billed. Do not give the money back; repeat with the same client_request_id.

The host left, or the call ended, in the same moment. gift_host_unavailable. If your cost had been debited it is returned ("refunded": true). If the gift had already reached her, it stands and you get 201.

The host is hidden for my account. A host you hid (or one we hid for your account) cannot receive gifts, also in a call that is still running: gift_host_unavailable.

Gifts are off. The list is empty with "enabled": false and a reason. off_by_you: switch them on under console → Gifts → Settings (for lives also Live streams → Settings → Gifts in my app). not_available: gifts are not available for your account right now; ask support. Hide your gift button while enabled is false.

My account is billed in USD. Everything is in USD: cost, price, min_price, the prices you set, receipts and stats. Amounts for one gift carry up to 6 decimals; gift list prices are whole cents unless we set a price for a gift ourselves. The SDKs show a USD price with 2 to 6 decimals.

Rounding. The cost of one gift is fixed to the smallest unit of your currency we keep (a millionth). A send of count gifts costs exactly count × the cost of one, and the sum of your gift receipts equals the gift lines of your ledger. INR amounts are shown with up to 4 decimals.

The same gift twice. Two taps are two gifts when they have two client_request_ids, and one gift when they carry the same one. Disable your Send button while a send is running.

My stored price is no longer allowed. If the gift list price (min_price) rises above the price you set, your price is not used: the gift is offered at the gift list price and the list marks it price_needs_review: true (the console flags it) until you set a new price.

Does the host know my prices? No. She sees the gift. Your price, your cost and your users’ payments stay with you.

Limits

  • count: from 1 to max_count gifts per send (99 by default; GET /v1/gifts returns it).
  • Sends: 10 a second per account (burst 50), calls and lives together. There is also a limit for all gifts on the platform together; when it is reached a send answers 429 rate_limited with Retry-After like any other. Changing settings: 2 a second (burst 20); changing gifts: 5 a second (burst 100).
  • client_request_id: 1–64 characters of A-Z a-z 0-9 _ . : -.
  • Your price for a gift: from the gift list price (min_price) to its max_price.
  • A gift can be sent only inside a session: a connected Live Hosts call, or an open viewer session of a live.
  • The list is the same for calls and lives.
  • Sends are read per project: GET /v1/gifts/sends and /sends/:id show the sends of the API key’s project.

Rules

These are part of your agreement.

  • Show your price before your user sends, and charge your user no more than the price you showed.
  • Do not describe a gift as anything other than a gift to the host of that call or live.
  • The content rules of Live Hosts and Live Streams apply (18+ only, report and block). See also Acceptable use.
Start free