API Reference
Bid
Endpoint that DSPs must implement to receive bid requests from Thrad SSP (ssp.thrads.ai). Called by the SSP orchestrator during multi-bidder auctions.
Implementation Required: Your DSP must implement this endpoint on your own server. The SSP at
ssp.thrads.ai will send POST requests to your configured DSP endpoint URL.Authorization
Bearer token for authentication. Format:
Bearer your-api-keyHeaders
Must be
application/jsonEnd-user’s IP address. First hop is the real user IP. Required on every bid request — use for geolocation, fraud detection, or frequency capping. The resolved
country_code / region / city body fields are also provided as a convenience.End-user’s device/browser string. Required on every bid request — use for device targeting, creative optimisation, or fraud detection.
Body
Unique user identifier. Use anonymous UUIDs (e.g.,
user_a1b2c3d4-...). Do not use email or name.Pipeline selector. One of:
"contextual"— in-chat ad.chatIdandmessagesare required."opener"— pre-chat ad shown before the conversation starts.chatIdandmessagesare not sent.
"contextual" if omitted.Conversation identifier. One unique ID per conversation, not per user. Reset when user starts a new chat.Required when
request_type=contextual. Not sent for openers.Number of ads shown before this request in the current conversation. Added by SSP from cache. Contextual only.
Conversation history. Must contain at least 2 messages, alternating between user and assistant roles, ending with a user message followed by an assistant message.Required when
request_type=contextual. Not sent for openers (no conversation exists yet).Ad formats the publisher can render. Your DSP must pick one from this list when bidding and identify it in the bid response (
ad_data.ad_format). If omitted, assume ["sponsored_message"].Allowed values per request_type:contextual:"sponsored_message","sponsored_carousel"opener:"sponsored_message","sponsored_carousel"
true when the publisher is requesting an ad before the assistant reply is shown (pre-fetch). false when the ad is requested after the reply has already been displayed. Useful for tuning latency expectations and creative relevance.Optional request identifier for distributed tracing when called from SSP. Used for correlation across services.
ISO 3166-1 alpha-2 country code (e.g.,
"US", "GB"). Derived from IP geolocation.State or region name (e.g.,
"California"). Derived from IP geolocation.City name (e.g.,
"San Francisco"). Derived from IP geolocation.Device type. Possible values:
"mobile", "desktop", "tablet".User’s timezone in IANA format (e.g.,
"America/Los_Angeles").Publisher creative constraints. Your DSP should respect these when generating the ad.
Placement contract: every
sponsored_message creative must declare a placement field — "image" (hero product photo) or "text" (advertiser logo + copy, no hero image). Each placement requires a matching URL: placement="image" needs image_url, placement="text" needs logo_url. Bids that omit placement or supply the wrong URL are rejected (dsp_missing_placement / dsp_invalid_image_bid / dsp_invalid_text_bid). See Ad Formats for the full contract.Response
Additional fields (such as
requestId, timestamp, status, message, etc.) are allowed in the response and will be ignored by the SSP.Response data payload. Must contain
bid and bidId when submitting a bid. Return empty object {} for no-bid.Error message when the request fails. Only present on error responses.
Status Codes
| Status Code | Meaning | Scenario |
|---|---|---|
200 OK | Success | Bid generated successfully or DSP chose not to bid |
400 Bad Request | Invalid input | Malformed request body or missing required fields |
401 Unauthorized | Authentication failed | Missing or invalid Authorization header |
429 Too Many Requests | Rate limit exceeded | Publisher exceeded request quota |
500 Internal Server Error | Server error | Exception during auction execution, database failure, or service unavailable |

