Usage
3 ways to use these types in your project:- Copy curated types - copy the “Response types”, “Request types”, and “Shared types” tabs into a single
xquik-types.tsfile - Copy individual interfaces - grab only the types you need (e.g.
Tweet,EventList) - Generate full coverage from OpenAPI - use the OpenAPI spec with tools like
openapi-typescriptto auto-generate types:
- Response types
- Request types
Response objects returned by API endpoints.
REST API vs MCP Field Naming
REST examples show the default v1 response contract unless they explicitly send
xquik-api-contract: 2026-04-29. The MCP server’s xquik.request() tool sends that normalized contract automatically in v2.5.4. MCP results use snake_case, date-time fields as Unix seconds, structured errors, has_more, and next_cursor. Pass next_cursor as cursor on most X data pages, as after for draws, extractions, events, and radar, or as afterCursor for drafts. A default createdAt field becomes created.Type reference
Account
Returned byGET /api/v1/account. The creditInfo field is omitted when no credit balance record exists yet. creditInfo.balance shows the current credit count available for metered API calls.
API Keys
Two shapes exist:ApiKeyCreated is returned only from POST /api/v1/api-keys and includes the fullKey field. This is the only time the full key is exposed. ApiKey is returned by GET /api/v1/api-keys and shows only the prefix (first 8 characters) for identification.
Monitors
Account monitor endpoints returnMonitor. The xUserId is the X (Twitter) user ID resolved from the username at creation time. Keyword monitor endpoints return KeywordMonitor with the normalized X search query. Both monitor types include eventTypes, isActive, createdAt, and nextBillingAt for active monitor billing.
Events
Event represents a single tracked action from an account or keyword monitor. monitorType is account or keyword; monitorId points to the source monitor. Account events include username; keyword events include query and keywordMonitorId. The data field contains tweet event data with id, text, author, isRetweet, isReply, isQuote, and createdAt. Replies include inReplyToId, quotes include a nested quoted_tweet object. Retweets are identified by isRetweet: true. See the TweetEventData interface in the Shared types tab for the full shape. EventList wraps paginated responses. Use nextCursor with the after query parameter to fetch subsequent pages.
Webhooks
Similar to API keys, webhooks have two shapes.WebhookCreated includes the secret field used for HMAC signature verification. Webhook (from list) never exposes the secret. If you lose the secret, delete and recreate the webhook.
Deliveries
EachDelivery represents one attempt to send an event to a webhook endpoint. Status progresses from pending to delivered (success) or through failed to exhausted (all retries failed). lastStatusCode and lastError help diagnose delivery failures.
Webhook payload
TheWebhookPayload type describes the JSON body your endpoint receives on each delivery. Normal monitor events include schemaVersion, deliveryId, streamEventId, occurredAt, eventType, and data. Account monitor events include username; keyword monitor events include query. Verify authenticity with the X-Xquik-Signature header and your webhook secret. See Webhook Verification for implementation details.
webhook.test payloads include timestamp and omit monitor-only fields because they are not tied to a stored event. In normal event payloads, timestamp is omitted.Draws
Draw is the full draw object returned by GET /api/v1/draws/{id} with tweet metadata and engagement counts. DrawListItem is the compact shape returned in list responses. DrawWinner contains the position, username, tweet ID, and backup flag for each winner. Filter fields on CreateDrawRequest control which entries qualify for the draw.
Extractions
ExtractionJob represents a completed or failed extraction job. The target fields (targetTweetId, targetUsername, etc.) vary by toolType. ExtractionResult contains the core user and tweet data returned by the API. Results are paginated in the get endpoint with up to 1,000 results per page. Exports (CSV, XLSX, Markdown) include additional enrichment columns not present in the API response. See Export Extraction for the full column list. ExtractionEstimate previews the cost before running a job.
X API
Direct X data lookup types.Tweet and TweetAuthor are returned by the tweet lookup endpoint. TweetSearchResult is returned in search results with an inline author object. UserProfile contains the full user profile. FollowerCheck returns the bidirectional follow relationship between two users. Both Tweet and TweetSearchResult include an optional media array of TweetMediaItem objects, present only when the tweet has attached media. Media types are photo, video, or animated_gif.
Trends
Trend represents a single trending topic on X. The description, rank, and query fields are omitted when unavailable. TrendList wraps the GET /api/v1/trends response. total is the number of trends returned, woeid is the region ID.
Radar
RadarItem represents a single trending topic or news item from Xquik’s own infrastructure. The source field identifies the Radar stream, and the metadata object contains stream-specific fields such as author, category, language, score, volume, views, or community signals when available. RadarList wraps paginated responses from GET /api/v1/radar. Use nextCursor with the after query parameter to fetch subsequent pages.
Styles
StyleProfile is returned by the analyze style (POST /api/v1/styles) and get style (GET /api/v1/styles/{id}) endpoints. It includes the cached tweets array with text, media, and timestamps. StyleListItem is the compact shape returned by GET /api/v1/styles (no tweets). StyleComparison wraps two full profiles for side-by-side comparison. PerformanceAnalysis adds engagement metrics (likes, retweets, replies, quotes, views, bookmarks) to each cached tweet. isOwnAccount is true when the analyzed username matches the authenticated user’s linked X identity.
Drafts
Draft represents a saved tweet draft. List, create, and get responses include id, text, createdAt, and updatedAt. Optional topic and goal fields are omitted (not null) when not set. DraftList wraps paginated responses. Use nextCursor with the afterCursor query parameter to fetch subsequent pages. Maximum 50 drafts per page.
X Accounts
XAccount represents a linked X account. displayName is the user’s display name on X. isActive indicates whether the account is currently connected and usable for API operations.
Compose
ComposeRequest drives the 3-step tweet composition flow: compose returns algorithm rules, follow-up questions, and an intentUrl built from the topic; refine returns composition guidance and example patterns; score evaluates a draft’s quality. styleUsername accepts a cached style username for voice matching. Compose responses can include savedStyles, styleTweets, or styleNote depending on the cached style state.
X Write
XWriteResponse is returned by write operations (post, retweet, like, reply). success indicates whether the operation completed. The optional data field contains platform-specific response data when available.
Support tickets
SupportTicket is the compact shape returned in list responses. SupportTicketDetail includes the full messages array. Each SupportMessage has a sender field indicating whether the message is from the user or support team. Status progresses from open through in_progress to resolved or closed.
Request bodies
All request body types use optional fields for update operations (PATCH) and required fields for creation (POST). The API validates request bodies and returns400 invalid_input for missing or malformed fields.