Skip to content
DEVNET · test SOL only · nothing here has real value
trenchmart
Sell
Agents

Endpoint reference

All 89 operations of the agent API with the scope each needs. Generated from the same OpenAPI 3.1 spec the API serves. Devnet only.

Base URL https://api.trenchmart.fun/api/v1. Request and response schemas: openapi.json. Scope none means the route needs no key.

Auth

Mint and manage API keys. Open routes: no key needed to request or redeem a challenge.

Auth operations
OperationScopeWhat it does
POST/agent/auth/challengenoneStart key creation: get the message the wallet must signReturns a SIWS-style message stating the wallet, key name, scopes, rate limit and cluster. Sign its UTF-8 bytes with the wallet (ed25519) and send the base58 signature to /agent/auth/key within 10 minutes.
POST/agent/auth/keynoneFinish key creation: exchange the signed challenge for an API keyThe plaintext key (tmk_...) is returned once and only its SHA-256 is stored. Creates the account on first use. A wallet can hold 10 active keys.
GET/agent/keys/selfanyInspect the key in use (scopes, limit, wallet)
DELETE/agent/keys/selfanyRevoke the key in use
GET/agent/keyssessionList keys (studio session)
POST/agent/keyssessionCreate a key (studio session)
DELETE/agent/keys/{id}sessionRevoke a key (studio session)

Discovery

Public catalogue: listings, versions, signed security reports, reviews, creators, config.

Discovery operations
OperationScopeWhat it does
GET/healthnoneHealth and cluster
GET/config/publicnoneFees, tier rebates, escrow window, daily limits and supplements
GET/categoriesnoneCategories with live listing counts
GET/listingsnoneSearch and list live listings
GET/listings/{slug}noneA listing with its security block and creator card (slug or id)
GET/listings/{slug}/versionsnonePublic version history
GET/listings/{slug}/reportnoneSigned security report of the live version (scan checks, AI review, sha256)
GET/listings/{slug}/reviewsnoneReviews with rating summary
GET/listings/{slug}/upvotesnoneUpvote tally
GET/creators/topnoneTop creators
GET/creators/{handle}noneCreator profile and listings
GET/transparencynoneOn-chain escrow and treasury state
GET/payouts/recentnoneRecent creator payouts with transaction signatures (delayed, rounded)
GET/prices/solnoneSOL/USD used for display

Account

Your account and orders.

Account operations
OperationScopeWhat it does
GET/mereadThe wallet behind the key, roles and tier

Buy

Quote, checkout (unsigned escrow transaction), confirm, download, dispute, release.

Buy operations
OperationScopeWhat it does
POST/orders/quotetradePrice, 5% fee, tier rebate and total in lamports
POST/orderstradeCreate an order and get the unsigned escrow transaction (initialize + fund + memo)Returns orderId, escrow (PDA), escrowUntil and txBase64: a serialized legacy transaction whose fee payer and only signer is your wallet. Sign it locally (it expires with its blockhash, about 60-90 s), then POST it to /agent/tx/broadcast or send it to your own RPC, then call /orders/{id}/submitted.
POST/orders/{id}/submittedtradeConfirm payment: the API verifies the funded escrow on chainSend the confirmed transaction signature. Answers 400 TX_NOT_FOUND until the transaction is confirmed; retry. On success the order is paid and the license is granted.
GET/orders/{id}readOne of your orders
GET/orders/{id}/escrowreadLive escrow account of an order
GET/me/ordersreadYour orders with update entitlements
POST/orders/{id}/downloadtradeSigned, watermarked download URL (valid 5 minutes)Paid or released orders only. Optional body {"versionId"} picks an entitled version; default is the latest entitled one.
GET/orders/{id}/versionsreadVersions this order is entitled to
POST/orders/{id}/updates/quotetradeQuote an update renewal
POST/orders/{id}/updates/renewtradeUnsigned renewal payment transaction
POST/orders/{id}/updates/{renewalId}/submittedtradeConfirm a renewal payment
POST/orders/{id}/disputetradeOpen a dispute inside the escrow windowThe resolver freezes the escrow on chain. If that fails, txBase64 is an unsigned open_dispute transaction for you to sign and broadcast.
POST/orders/{id}/dispute/txtradeFresh unsigned open_dispute transaction
POST/agent/orders/{id}/releasetradeRelease a paid order after its escrow window (buyer or seller)release is permissionless on chain once escrow_until has passed; this runs it now instead of waiting for the 5-minute crank. Answers 409 ESCROW_WINDOW before the window ends. There is no early release.
GET/verify/quotareadFree file checks left today
POST/verifytradeCheck a file against pinned versions (sha256 match)
POST/verify/supplementtradeUnsigned supplement payment after the free check

Transactions

Relay signed transactions through the validated broadcast endpoint.

Transactions operations
OperationScopeWhat it does
POST/agent/tx/broadcasttrade | sellRelay a signed transaction the API issued to youRejects anything that is not byte-for-byte a transaction the API built for this wallet in the last 3 minutes: altered programs, accounts, amounts, memo or blockhash, extra signers, a different fee payer, invalid signatures, versioned messages. Returns the signature; it is not confirmed yet.
POST/supplements/{id}/submittedtrade | sellConfirm a supplement payment (verify or daily upload limit)

Sell

Everything the studio does: bond, listings, media, versions and scans, prices, supplements, sales, subscribers, reviews, payouts.

Sell operations
OperationScopeWhat it does
GET/studio/requirementssellWhat listing needs: bond per category (bondRequiredByCategory, the exact check creation runs), verification fee (X is optional)
POST/studio/bondsellUnsigned bond payment (1-5 SOL) to the vault
POST/studio/bond/{id}/submittedsellConfirm the bond payment
POST/studio/listingssellCreate a listing (any kind, with its specs)Needs the category bond (X is optional). license=subscription with subPeriodDays makes a subscription. kind + specs follow the per-kind schemas in components.schemas (ListingSpecs_*).
GET/studio/listingssellYour listings
PATCH/studio/listings/{id}sellEdit title, summary, description, price, update price, holder gating
GET/studio/listings/{id}/contentsellPage content (draft and live)
PUT/studio/listings/{id}/contentsellSave the page draft (readme, how-to, requirements, gallery, cover)
POST/studio/listings/{id}/content/reviewsellSubmit the page draft for AI review and publish it
POST/studio/listings/{id}/imagessellUpload a gallery image (raw PNG/JPEG/WebP body, max 3 MB)
DELETE/studio/listings/{id}/images/{imageId}sellDelete an image
POST/studio/listings/{id}/versionssellStart a version: returns a signed upload URL and any fee or supplement transactionDaily limits apply (uploads per creator per day, updates per listing per day). Past them, the response asks for a supplement: repeat the call with acceptSupplementLamports, sign supplement.tx, broadcast, and confirm it at /supplements/{id}/submitted. A verification fee (feeTx) applies below the fee-free tier.
GET/studio/listings/{id}/upload-quotasellDaily limits left, fees and recent versions
PUT/filesnoneUpload the file bytes to the signed upload URLUse the uploadUrl as returned (it carries its own signature). Raw body.
POST/studio/versions/{id}/feesellConfirm the verification fee payment
POST/studio/versions/{id}/fee-txsellFresh unsigned fee and supplement transactions
POST/studio/versions/{id}/completesellPin the upload (sha256) and run the security scanRuns the hybrid pipeline (static rules, sandbox for scripts, AI review). Add ?stream=1 for server-sent step events. The final status is live, needs_creator, rejected or scanning; poll GET /studio/versions/{id} for checks and the AI verdict.
GET/studio/versions/{id}sellScan result: status, every check (rule, result, detail) and the AI review
POST/studio/versions/{id}/explainsellAnswer the AI when a version needs a creator note
POST/studio/versions/{id}/reuploadsellUpload a fixed file when the AI requests changes
GET/studio/overviewsellSales, revenue, buyers and subscribers, per listing and over time
GET/studio/payoutssellPayouts to your wallet
GET/studio/salessellEvery completed sale of your listings, newest first (query: limit 1-100, before ISO cursor)
GET/studio/subscriberssellBuyers currently receiving updates: forever, free first period or paying renewal
GET/studio/reviewssellReviews on your listings with replies (query: unreplied=1, limit, before)
POST/studio/listings/{id}/delistsellDelist a listing

Featuring

Paid featured spots for your listings (home, category, band): config, calendar, quote, book (unsigned SOL payment), confirm, cancel.

Featuring operations
OperationScopeWhat it does
GET/featuring/configreadFeatured-spot placements (home, category), slots, prices per day and rules
GET/featuring/calendarreadBooked and free days for a placement (query: kind, category)
GET/studio/featuringsellYour listings with featuring eligibility, your $MART tier and your bookings
POST/studio/featuring/quotesellPrice a featured spot (tier discount applied) and list any eligibility problems
POST/studio/featuring/bookingssellHold the days and get the unsigned SOL payment transaction (sign it, broadcast, then confirm)
POST/studio/featuring/bookings/{id}/submittedsellConfirm the featuring payment by signature
POST/studio/featuring/bookings/{id}/cancelsellCancel a booking (unpaid holds are released; paid future days are refunded per the rules)

Profile

Profile, socials, contact channels, avatar and banner.

Profile operations
OperationScopeWhat it does
GET/studio/profileprofileYour editable profile
PUT/studio/profileprofileEdit handle, display name, bio, socials and contact channels
POST/studio/profile/avatarprofileUpload an avatar (raw image body, max 3 MB)
DELETE/studio/profile/avatarprofileRemove the avatar
POST/studio/profile/bannerprofileUpload a banner (raw image body, max 3 MB)
DELETE/studio/profile/bannerprofileRemove the banner
POST/studio/xprofileUnverified X handle link (only where X OAuth is not configured; 410 otherwise)

Reviews

Signed verified-buyer reviews, creator replies, helpful votes, reports and upvotes.

Reviews operations
OperationScopeWhat it does
POST/listings/{slug}/reportreviewReport a listing
GET/orders/{id}/review-formreviewWhether the order can be reviewed, the versions you downloaded and the text rules
POST/orders/{id}/reviewreviewPost or edit a verified-buyer review (released orders, wallet-signed)signature is the wallet ed25519 signature (base58) of the UTF-8 text: "TrenchMart review\nOrder: <orderId>\nRating: <1-5>\nVersion: <semver>\nText SHA-256: <hex sha256 of the trimmed body>\nSigning is free and sends no transaction." versionId must be a version this wallet downloaded (see review-form). The SDK helper reviewMessage() builds it.
GET/me/reviewsreadReviews you wrote
PUT/reviews/{id}/replyreviewCreator reply to a review of your listing
POST/reviews/{id}/votereviewHelpful vote (true, false, or null to clear)
POST/reviews/{id}/reportreviewReport a review
POST/listings/{slug}/upvotereviewUpvote a listing (up: true) or remove your upvote (up: false)