Skip to Content

Events

Name each event the way your platform already does, and add any details you have.

// A deposit await hub.send("ftd", { user: "u_1001", amount: 75, currency: "USD", id: "dep_10482" }); // A failure: the reason is shown to the member await hub.send("kyc_status", { user: "u_1001", status: "failed", reason: "Document unreadable" }); // A refund: takes the reward back await hub.send("ftd", { user: "u_1001", status: "reversed", reason: "Refunded" }); // Up to 50 at once await hub.sendBatch([ { event: "bet_placed", user: "u_1001", stake: 5 }, { event: "bet_placed", user: "u_2002", stake: 20 }, ]);

The SDKs add a unique id when you leave it out, and retry on their own when the network or CoConnect has a problem.

Fields

FieldWhat it isWhen
eventYour name for the action, for example ftd or level_upAlways
userYour ID for the userAlways
cc_idThe CoConnect ID the member arrived withFirst event per user
statuscompleted (default), failed, or reversedOptional
reasonWhy it failed or was reversed, shown to the memberWith failed or reversed
idYour unique reference. An event sent twice counts onceRecommended
amount, currencyThe value of a deposit, trade or betIf it has one
propertiesAny other details. Extra top-level fields are kept tooOptional

Members are usually found by cc_id. If you do not have it, CoConnect can also match a wallet address (EVM or Solana), an email (plain or SHA-256 hashed), or an x or discord ID the member connected on CoConnect. Email addresses are hashed on arrival and never stored in plain text.

How events become rewards

  • Each task on CoConnect listens for one of your event names, with any conditions it needs, for example an amount of 50 or more.
  • completed moves the task forward. Repeatable, daily and multi-step tasks all work from the same events.
  • failed shows the member your reason and lets them try again. No reward is given.
  • reversed takes the reward back, for example after a refunded deposit.
  • When a new task goes live, matching events from the last 30 days count, so members who already did the action are not left out.

If your platform can only call a URL, use this instead. Each call is one event, and extra query parameters are kept as details.

https://hub.coconnect.co/api/partner/callback?action={event}&status=completed&user={user_id}&cc_id={cc_id}&amount={amount}&id={event_id}

Send your token in the X-CC-Token header. Only add token={token} to the URL if your software cannot set headers, because URLs can end up in logs.

Optional: Verify button

If your platform can answer “has this user done this?”, give CoConnect a URL and members get a Verify button. CoConnect calls it over HTTPS and waits up to five seconds:

GET https://api.your-platform.com/cc/check?action=deposit&cc_id=ck_7f3a91c2&user=u_1001 200 {"completed": true, "count": 2, "failed": false, "reason": null}

count is only for repeatable actions. Set failed with a reason to tell the member why it did not go through.

Last updated on