openapi: 3.0.3 info: title: Twitter OpenAPI version: 0.0.1 paths: {} components: schemas: ContentUnion: oneOf: - $ref: "#/components/schemas/TimelineTimelineItem" - $ref: "#/components/schemas/TimelineTimelineModule" - $ref: "#/components/schemas/TimelineTimelineCursor" discriminator: propertyName: entryType mapping": # deprecated TimelineTimelineItem: "#/components/schemas/TimelineTimelineItem" TimelineTimelineModule: "#/components/schemas/TimelineTimelineModule" TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor" ContentEntryType: type: string enum: [TimelineTimelineItem, TimelineTimelineCursor, TimelineTimelineModule] CursorType: type: string enum: [Top, Bottom, ShowMore, ShowMoreThreads, Gap] # Gap??? TimelineTimelineItem: required: - "__typename" - "entryType" - "itemContent" properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineItem entryType: $ref: "#/components/schemas/ContentEntryType" # TimelineTimelineItem itemContent: $ref: "#/components/schemas/ItemContentUnion" clientEventInfo: $ref: "#/components/schemas/ClientEventInfo" feedbackInfo: type: object additionalProperties: true # todo TimelineTimelineModule: required: - "__typename" - "entryType" - "displayType" # - "items" - "clientEventInfo" properties: __typename: type: string $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineModule entryType: $ref: "#/components/schemas/ContentEntryType" # TimelineTimelineCursor displayType: $ref: "#/components/schemas/DisplayType" items: type: array items: $ref: "#/components/schemas/ModuleItem" footer: type: object additionalProperties: true # todo header: type: object additionalProperties: true # todo clientEventInfo: type: object additionalProperties: true # todo metadata: type: object additionalProperties: true # todo feedbackInfo: $ref: "#/components/schemas/FeedbackInfo" TimelineTimelineCursor: required: - "__typename" - "cursorType" - "value" - "stopOnEmptyResponse" properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineCursor entryType: $ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor itemType: $ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor cursorType: $ref: "#/components/schemas/CursorType" value: type: string stopOnEmptyResponse: type: boolean default: false displayTreatment: $ref: "#/components/schemas/DisplayTreatment" DisplayTreatment: type: object required: - "actionText" properties: actionText: type: string # ================= Module ================= DisplayType: type: string enum: - Vertical - VerticalConversation - VerticalGrid - Carousel ModuleItem: required: - "entryId" - "item" properties: entryId: type: string pattern: "^(([a-z]+|[0-9]+|[0-9a-f]+)(-|$))+" item: $ref: "#/components/schemas/ModuleEntry" ModuleEntry: required: - "itemContent" properties: clientEventInfo: $ref: "#/components/schemas/ClientEventInfo" itemContent: $ref: "#/components/schemas/ItemContentUnion" feedbackInfo: $ref: "#/components/schemas/FeedbackInfo" FeedbackInfo: required: - "feedbackType" properties: feedbackKeys: type: array items: type: string # ================= ContentItem ================= ItemContentUnion: oneOf: - $ref: "#/components/schemas/TimelineTweet" - $ref: "#/components/schemas/TimelineTimelineCursor" - $ref: "#/components/schemas/TimelineUser" - $ref: "#/components/schemas/TimelinePrompt" - $ref: "#/components/schemas/TimelineMessagePrompt" - $ref: "#/components/schemas/TimelineCommunity" discriminator: propertyName: __typename mapping": # deprecated TimelineTweet: "#/components/schemas/TimelineTweet" TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor" TimelineUser: "#/components/schemas/TimelineUser" TimelinePrompt: "#/components/schemas/TimelinePrompt" TimelineMessagePrompt: "#/components/schemas/TimelineMessagePrompt" TimelineCommunity: "#/components/schemas/TimelineCommunity" ContentItemType: type: string enum: [ TimelineTweet, TimelineTimelineCursor, TimelineUser, TimelinePrompt, TimelineMessagePrompt, TimelineCommunity, ] TimelineTweet: required: - "__typename" - "itemType" - "tweetDisplayType" - "tweet_results" properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTweet itemType: $ref: "#/components/schemas/ContentItemType" # TimelineTweet tweetDisplayType: type: string enum: [Tweet, SelfThread, MediaGrid, CondensedTweet] tweet_results: $ref: "#/components/schemas/ItemResult" socialContext: $ref: "#/components/schemas/SocialContextUnion" promotedMetadata: type: object additionalProperties: true # todo highlights: $ref: "#/components/schemas/Highlight" TimelineUser: required: - "__typename" - "itemType" - "userDisplayType" - "user_results" properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineUser itemType: $ref: "#/components/schemas/ContentItemType" # TimelineUser socialContext: $ref: "#/components/schemas/SocialContextUnion" userDisplayType: type: string enum: [User, UserDetailed, SubscribableUser] user_results: $ref: "./user.yaml#/components/schemas/UserResults" ItemResult: properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # null | TimelineTweet result: $ref: "./tweet.yaml#/components/schemas/TweetUnion" SocialContextUnion: oneOf: - $ref: "#/components/schemas/TimelineGeneralContext" - $ref: "#/components/schemas/TimelineTopicContext" discriminator: propertyName: type mapping": # deprecated TimelineGeneralContext: "#/components/schemas/TimelineGeneralContext" TimelineTopicContext: "#/components/schemas/TimelineTopicContext" SocialContextUnionType: type: string enum: - TimelineGeneralContext - TimelineTopicContext TimelineGeneralContext: type: object properties: type: $ref: "#/components/schemas/SocialContextUnionType" contextType: type: string # enum enum: - "Follow" - "Pin" - "Like" - "Location" - "Sparkle" - "Conversation" - "List" text: type: string landingUrl: $ref: "#/components/schemas/SocialContextLandingUrl" TimelineTopicContext: type: object properties: type: $ref: "#/components/schemas/SocialContextUnionType" topic: $ref: "#/components/schemas/TopicContext" functionalityType: type: string enum: ["Basic"] TopicContext: type: object properties: id: type: string topic_id: type: string name: type: string description: type: string icon_url: type: string format: uri following: type: boolean not_interested: type: boolean SocialContextLandingUrl: type: object properties: urlType: type: string # enum enum: ["DeepLink", "UrtEndpoint", "ExternalUrl"] url: type: string # twitter://user?id=900282258736545792 format: uri urtEndpointOptions: $ref: "#/components/schemas/UrtEndpointOptions" UrtEndpointOptions: type: object required: - "title" - "requestParams" properties: title: type: string requestParams: type: array items: $ref: "#/components/schemas/UrtEndpointRequestParams" UrtEndpointRequestParams: type: object required: - "key" - "value" properties: key: type: string value: type: string Highlight: type: object required: - "textHighlights" properties: textHighlights: type: array items: $ref: "#/components/schemas/TextHighlight" TextHighlight: type: object required: - "startIndex" - "endIndex" properties: startIndex: type: integer endIndex: type: integer TimelinePrompt: properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelinePrompt additionalProperties: true # todo TimelineMessagePrompt: properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineMessagePrompt additionalProperties: true # todo TimelineCommunity: properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineCommunity additionalProperties: true # todo ClientEventInfo: properties: component: # enum half_cover type: string element: type: string # august-2023-privacy-prompt-candidate # pattern: "(([a-z]+|[0-9]+|[0-9a-f]+)(-|$))+" # pattern: "^(january|february|march|april|may|june|july|august|september|october|november|december)-[0-9]{4}-([a-z]-)+[a-z]+$" details: type: object additionalProperties: true # todo