Skip to main content
Builds deep links in bulk, using each market’s real outcome labels. One request can mix markets, outcomes and amounts. If one entry is invalid, it lands in errors and the rest of the batch is still returned.
Server-side only. This endpoint is CSRF-protected. Each request needs the csrf-token cookie from GET /api/csrf and the same value in an x-csrf-token header. Browsers on other origins can’t do that, because the cookie is SameSite=Strict and the API’s wildcard CORS doesn’t allow credentials. Call it from your backend. In a browser, call GET /api/markets/:id/twitter-link once per market instead.

Endpoint

Headers

string
required
application/json
csrf-token=<value>, the cookie set by GET /api/csrf.
string
required
The same token, URL-decoded. The cookie is URL-encoded, so %3D becomes =.

Request body

object[]
required
1 to 50 entries.

Response

{ marketId, question, twitterUrl, tweetContent, outcomeIndex, outcomeLabel, amount } for each entry that succeeded.
object[]
{ marketId, outcomeIndex, error } for each entry that failed. error is Market not found, Market is expired, Market is not active or Outcome is not one of the market's.
object
{ requestedAt, totalRequested, totalGenerated, totalErrors }
Only verified markets that are ACTIVE or frozen, and not past their end time, get links. Each tweet mentions the X account that posts the market, or the Kash trading bot if there is none. These links don’t quote the announcement tweet.

Rate limit

Rate-limited per IP (see Rate limits).

Example request

Example response

200
403 (no CSRF cookie)