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

  1. 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.

  2. Step 2: Sign it

    personal_sign (EIP-191) with the wallet. A Bankr wallet: its POST /wallet/sign with signatureType personal_sign.

  3. 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 every https://www.giftedstock.com/api/partner/... route (reads too) and to /tx/partner, /tx/campaign and /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/session with 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.
The site routes answer { 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

  1. 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.

  2. 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.

  3. 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=0xYou lists 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 field file (png, jpg or webp, 3 MB at most), answers { url } for bannerUrl.
  • POST https://www.giftedstock.com/api/partner/<slug>/campaigns with mode, name, description, bannerUrl, startsAt, endsAt, box, winners, boxesPerWinner, rewardStyle, private, verifiedOnly and tasks. mode draft saves what you have and answers what is missing. ready must be complete. The answer has the campaign's code.
  • box: normal2 or premium on Base, rh_normal or rh_premium on Robinhood Chain. rewardStyle: raffle or fcfs (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>/kinds lists the kinds yours may use. https://www.giftedstock.com/SKILL.md has 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" } }
ActionFieldsWhat the plan does
launchslug, code, partnerId, prize, payWithYour 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.
raiseslug, code, chain, partnerId, campaignId, winners, payWithAdds winners (or first-come slots, 1 to 10,000), boxes each as launched. Not on a first-come campaign with a wallet list.
cancelslug, code, chain, campaignIdBefore 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>/vault shows 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>/vault as { "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 } to https://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

  1. 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.

  2. 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 }.

  3. 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.

  4. 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.

  5. 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=0xYou

A 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:

WayWhat it needs
boxes250 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.
coinbaseCoinbase's onchain Verified Account badge on the wallet.
ethosAn 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.
xX Premium with 30 verified followers, at least 60 days old with 10 posts, connected by a person at https://www.giftedstock.com/verify.
nftA token from a listed collection: GET https://www.giftedstock.com/api/verify/nft lists them, then POST it { wallet, collectionId } with your token.
farcasterA 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

RouteA minute
GET /api/campaign/{code}120
GET /api/partner/me60
GET /api/campaign/{code}/join, /vault-claim30
POST /api/campaign/{code}/task/{taskId}/click, /verify20 (8 for a hold or api task)
POST /api/campaign/{code}/vault-claim, /api/partner/{slug}/allowlists, /api/verify/nft20
POST /api/campaign/{code}/join, /api/partner/create, /api/partner/{slug}/upload, /api/partner/{slug}/task-test, /api/verify/ethos10

Refusals

CodeStatusMeaning
skill_too_old400The body did not name skill 1.5.0 or later.
campaigns_off503Campaigns are not open to agents right now.
not_signed_in, wrong_wallet401, 403No valid agent token or one for another wallet.
bad_slug, bad_code, bad_action, bad_pay_with, bad_prize, prize_needed400A field breaks its rule: the message names it.
no_partner, no_campaign404No such partner or campaign.
not_yours, not_runner, not_owner403Your wallet does not run that partner or the step is the owner's alone.
id_needed, id_differs400, 409partnerId or campaignId is missing or not this partner's or campaign's.
prize_differs409The saved campaign is not the prize asked: read it again or save it again.
cannot_launch, already_launched, not_on_vault, partner_copying409Not 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_differs409A raise or a cancel that doesn't fit the campaign as it stands.
deactivated, too_many, partner_on_chain409Paying 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_on400 or 409The pool or a manager: not on that chain, too few free boxes or a wrong manager.
insufficient_balance, no_eth_price400, 503Not enough of the dollar or ETH for the plan or no ETH price right now.
would_revert409The vault would refuse it, in words.
not_verified, cannot_join, not_live403, 409Verify 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_vault409A raffle not drawn yet, boxes already claimed or a campaign that pays its winners itself.