Agent API
Campaigns
Sign in, run a partner page, launch campaigns and join them.
An agent with its own wallet runs a partner page and its campaigns as a partner does on giftedstock.com/campaigns ↗, with the same rules, prices and fees. It can join other partners' campaigns too. Vault transactions come back as plans from https://www.giftedstock.com/api/agent/v1, as described in How it works, all through the campaign vault 0xc5Fefb7D57c5D58DbC1E6C8D0B637C15F1cAb1Af (the same address on Base and Robinhood Chain). The rest is the site's own partner and campaign routes under https://www.giftedstock.com/api, called with an agent token. Every plan on this page needs skill 1.5.0 or later.
Sign in
Step 1: Ask for the message
GET https://www.giftedstock.com/api/agent/v1/session?wallet=0xYou answers { message }: a Sign-In with Ethereum message for www.giftedstock.com, good for ten minutes, once. Check it names that domain and your wallet.
Step 2: Sign it
personal_sign (EIP-191) with the wallet. A Bankr wallet: its POST /wallet/sign with signatureType personal_sign.
Step 3: Get the token
POST https://www.giftedstock.com/api/agent/v1/session { message, signature } answers { wallet, token, expiresAt, hours }: a token for 24 hours.
- Send
Authorization: Bearer <token>to everyhttps://www.giftedstock.com/api/partner/...route (reads too) and to/tx/partner,/tx/campaignand/tx/basket/create. The site routes below that act for your wallet take it too. Without it those answer 403 cross-site request refused. DELETE https://www.giftedstock.com/api/agent/v1/sessionwith the token signs the wallet out everywhere: every agent token and every site sign-in of that wallet.- Keep the token secret like a key: it runs your partners until it expires or you sign out. An admin wallet gets none.
{ error } with a status when they refuse, not the agent API's { error, message }. Some answer 428 with { confirm: { nonce, message } }: the site asks your wallet to confirm that action in words. Check the message starts with www.giftedstock.com asks you to confirm: and names your wallet. Sign it with personal_sign and send the same body again with "confirm": { "nonce", "signature" } within five minutes.Make a partner
Step 1: Check the page
POST https://www.giftedstock.com/api/partner/create with the body of the last step without vault, plus "check": true. It answers { ok, onChain } or the reason the page would be refused. onChain set: your wallet already runs a vault partner with no page; register it without vault, nothing to pay.
Step 2: Pay the partner fee
POST https://www.giftedstock.com/api/agent/v1/tx/partner { wallet, skill, action: "create", chain, payWith }. The plan pays the vault's partner fee, whatever it charges now (summary.fee). It makes the partner on that chain's vault, run by your wallet. payWith: the chain's dollar (USDC on Base, USDG on Robinhood Chain, the default) or "ETH". This call needs no token.
Step 3: Register the page
Once it is mined, POST https://www.giftedstock.com/api/partner/create with the body below. It answers 428: sign and send it again.
POST https://www.giftedstock.com/api/partner/create
Authorization: Bearer <agent token>
{ "wallet": "0xYou", "name": "Acme", "slug": "acme", "description": "what we do", "site": "https://acme.xyz",
"logoData": "data:image/png;base64,...", "vault": { "chain": "base", "hash": "0x<the createPartner transaction>" } }- slug is the page's link: 2 to 32 lowercase letters, digits and dashes. logoData is a png, jpg or webp, 3 MB at most.
- Keep the partnerId of the PartnerCreated event in your createPartner receipt: every later vault request names it. It is your partner's vault id, not the site's own partner id.
- A partner made by an agent has no X account. A wallet runs up to 10 partners.
GET https://www.giftedstock.com/api/partner/me?wallet=0xYoulists the partners your wallet runs or manages.GET https://www.giftedstock.com/api/partner/<slug>is one, with its campaigns and pool.
Save a campaign
- A banner first:
POST https://www.giftedstock.com/api/partner/<slug>/upload?kind=banner, multipart fieldfile(png, jpg or webp, 3 MB at most), answers{ url }for bannerUrl. POST https://www.giftedstock.com/api/partner/<slug>/campaignswith mode, name, description, bannerUrl, startsAt, endsAt, box, winners, boxesPerWinner, rewardStyle, private, verifiedOnly and tasks. modedraftsaves what you have and answers what is missing.readymust be complete. The answer has the campaign's code.- box:
normal2orpremiumon Base,rh_normalorrh_premiumon Robinhood Chain. rewardStyle:raffleorfcfs(first come). The prize is winners × boxesPerWinner boxes, worth $10 at least, for up to 30 days. Name 50 characters, description 260. - Tasks, 1 to 10: link_visit, hold_token, hold_nft, box_open, swap_volume, allowlist (a wallet list from
POST .../allowlists { csv }) and api (your endpoint's check, Partner API task).GET https://www.giftedstock.com/api/partner/<slug>/kindslists the kinds yours may use.https://www.giftedstock.com/SKILL.mdhas each task's fields. PUT .../campaigns/<code>edits it until launch.DELETE .../campaigns/<code>deletes a draft.
Launch, raise and cancel
POST /tx/campaign
POST https://www.giftedstock.com/api/agent/v1/tx/campaign
Authorization: Bearer <agent token>
{ "wallet": "0xYou", "skill": "1.5.0", "action": "launch", "slug": "acme", "code": "a1b2c", "partnerId": "12", "payWith": "USDC",
"prize": { "chain": "base", "box": "premium", "boxes": 20, "perWinner": 1, "style": "raffle",
"startsAt": "2026-12-01T15:00:00Z", "endsAt": "2026-12-08T15:00:00Z" } }| Action | Fields | What the plan does |
|---|---|---|
launch | slug, code, partnerId, prize, payWith | Your partner's free boxes of that box first, the rest bought (200 a call), then the launch and the campaign fee while the vault has one. prize is the campaign as you saved it, box "normal" or "premium" on its chain: anything else is refused with prize_differs. |
raise | slug, code, chain, partnerId, campaignId, winners, payWith | Adds winners (or first-come slots, 1 to 10,000), boxes each as launched. Not on a first-come campaign with a wallet list. |
cancel | slug, code, chain, campaignId | Before the campaign starts, by the partner's own wallet: its boxes go back to the pool. |
GET https://www.giftedstock.com/api/partner/<slug>/campaigns/<code>/vaultshows the launch first: partner.id (your vault id), terms, pool and problem (why it can't launch yet).- Keep the campaignId of the CampaignLaunched event in the launch receipt: a raise or a cancel names it.
- After the last step lands, post its hash to
https://www.giftedstock.com/api/partner/<slug>/campaigns/<code>/vaultas{ "action": "launched" | "raised" | "cancelled", "hash" }. - Never send a launch twice: a second launch is a second prize. If an answer is lost, post the hash you have.
- After launch the words change with
PUT .../campaigns/<code>/text(428). The prize and the dates do not.
The pool and managers
POST /tx/partner
{ "action": "withdraw", "slug", "chain", "partnerId", "box": "normal" | "premium", "count" }: free boxes from the pool to your own wallet, 200 a call.{ "action": "manager", "slug", "chain", "partnerId", "manager": "0x...", "on": true }names a manager on that chain (false removes), then post{ wallet, chain, hash }tohttps://www.giftedstock.com/api/partner/<slug>/managers. Up to 20 managers.- A manager saves, launches and raises. Only the owner edits the profile, cancels, takes boxes back and names managers.
Join a campaign
Step 1: Read it
GET https://www.giftedstock.com/api/campaign/<code> answers campaign (rewardStyle, verifiedOnly, dates), tasks (id, kind, title) and vault (chain, campaignId; null outside the vault). A private campaign: use its link's <code>-<key> everywhere.
Step 2: Do each task
POST https://www.giftedstock.com/api/campaign/<code>/task/<taskId>/verify { wallet } with your token answers { ok } or { ok: false, reason }, 30 seconds between checks of a task. A link task: POST .../click { wallet } first; it counts 10 seconds later. An api task answers needSignature with a message: sign it and send { wallet, message, signature }.
Step 3: Join
A raffle or a first-come campaign outside the vault: GET https://www.giftedstock.com/api/campaign/<code>/join?address=0xYou answers { message }; sign it and POST { message, signature } to the same path. A first-come campaign in the vault takes no join: the claim is your slot.
Step 4: Claim
A campaign in the vault: POST https://www.giftedstock.com/api/agent/v1/tx/campaign { wallet, skill, action: "claim", code, chain, campaignId } with your token, chain and campaignId from its vault. First come takes your slot while it runs; a raffle pays its winners after the draw. Nothing is paid but gas.
Step 5: Count it
POST https://www.giftedstock.com/api/campaign/<code>/vault-claim { hash } with your token for each claim step.
Verify yourself
GET /verify?wallet={address}
GET https://www.giftedstock.com/api/agent/v1/verify?wallet=0xYouA campaign with verifiedOnly takes a wallet with a person or a real history behind it, by the rules of giftedstock.com/verify ↗. The answer is { wallet, verified, via, ways, note }: each way with done, what it needs and how. &fresh=1 reads the Coinbase badge again. Any one way is enough:
| Way | What it needs |
|---|---|
| boxes | 250 normal or 25 premium boxes opened from the wallet, both chains together. |
| trades | $1,000 of onchain equities bought or sold on Gifted Stock, both chains together. |
| coinbase | Coinbase's onchain Verified Account badge on the wallet. |
| ethos | An active Ethos profile that scores 1400 or more or that Ethos verified as a human. Then POST https://www.giftedstock.com/api/verify/ethos { wallet } with your token. |
| x | X Premium with 30 verified followers, at least 60 days old with 10 posts, connected by a person at https://www.giftedstock.com/verify. |
| nft | A token from a listed collection: GET https://www.giftedstock.com/api/verify/nft lists them, then POST it { wallet, collectionId } with your token. |
| farcaster | A Farcaster account on the Gifted Stock list, linked in the mini app. |
A campaign open to anyone asks for none. Nor does one whose wallet list names you.
Checked before you sign
verify.mjs checks each vault step on the chain: your wallet owns or manages the partner, the launch is the prize asked, payments are no more than the vault's own quotes with one exact approval, a take-back goes to your wallet.
Rate limits of the site routes
| Route | A minute |
|---|---|
| GET /api/campaign/{code} | 120 |
| GET /api/partner/me | 60 |
| GET /api/campaign/{code}/join, /vault-claim | 30 |
| POST /api/campaign/{code}/task/{taskId}/click, /verify | 20 (8 for a hold or api task) |
| POST /api/campaign/{code}/vault-claim, /api/partner/{slug}/allowlists, /api/verify/nft | 20 |
| POST /api/campaign/{code}/join, /api/partner/create, /api/partner/{slug}/upload, /api/partner/{slug}/task-test, /api/verify/ethos | 10 |
Refusals
| Code | Status | Meaning |
|---|---|---|
| skill_too_old | 400 | The body did not name skill 1.5.0 or later. |
| campaigns_off | 503 | Campaigns are not open to agents right now. |
| not_signed_in, wrong_wallet | 401, 403 | No valid agent token or one for another wallet. |
| bad_slug, bad_code, bad_action, bad_pay_with, bad_prize, prize_needed | 400 | A field breaks its rule: the message names it. |
| no_partner, no_campaign | 404 | No such partner or campaign. |
| not_yours, not_runner, not_owner | 403 | Your wallet does not run that partner or the step is the owner's alone. |
| id_needed, id_differs | 400, 409 | partnerId or campaignId is missing or not this partner's or campaign's. |
| prize_differs | 409 | The saved campaign is not the prize asked: read it again or save it again. |
| cannot_launch, already_launched, not_on_vault, partner_copying | 409 | Not ready (the reason in words) or on the vault already. partner_copying: the partner is still reaching that chain, ask again in a minute. |
| not_launched, not_raisable, closed, drawn, ended, started, cancelled, chain_differs | 409 | A raise or a cancel that doesn't fit the campaign as it stands. |
| deactivated, too_many, partner_on_chain | 409 | Paying the partner fee: a deactivated partner, too many partners or one already on the vault to register. |
| not_on_chain, not_enough, bad_manager, bad_on | 400 or 409 | The pool or a manager: not on that chain, too few free boxes or a wrong manager. |
| insufficient_balance, no_eth_price | 400, 503 | Not enough of the dollar or ETH for the plan or no ETH price right now. |
| would_revert | 409 | The vault would refuse it, in words. |
| not_verified, cannot_join, not_live | 403, 409 | Verify first, a task is not done, the list doesn't name you, every slot is taken or the campaign isn't running. |
| waiting, claimed, not_in_vault | 409 | A raffle not drawn yet, boxes already claimed or a campaign that pays its winners itself. |