Events
Name each event the way your platform already does, and add any details you have.
Node.js
// 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
| Field | What it is | When |
|---|---|---|
event | Your name for the action, for example ftd or level_up | Always |
user | Your ID for the user | Always |
cc_id | The CoConnect ID the member arrived with | First event per user |
status | completed (default), failed, or reversed | Optional |
reason | Why it failed or was reversed, shown to the member | With failed or reversed |
id | Your unique reference. An event sent twice counts once | Recommended |
amount, currency | The value of a deposit, trade or bet | If it has one |
properties | Any other details. Extra top-level fields are kept too | Optional |
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
amountof 50 or more. completedmoves the task forward. Repeatable, daily and multi-step tasks all work from the same events.failedshows the member your reason and lets them try again. No reward is given.reversedtakes 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.
Optional: link-style postback
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.