Skip to content

Commit 2737ee7

Browse files
committed
Update documentation with latest OpenAPI spec
1 parent 0e3f845 commit 2737ee7

2 files changed

Lines changed: 306 additions & 0 deletions

File tree

openapi.json

Lines changed: 303 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,170 @@
931931
}
932932
}
933933
},
934+
"/2/chat/conversations/{id}" : {
935+
"get" : {
936+
"security" : [
937+
{
938+
"OAuth2UserToken" : [
939+
"dm.read",
940+
"tweet.read",
941+
"users.read"
942+
]
943+
},
944+
{
945+
"UserToken" : [ ]
946+
}
947+
],
948+
"tags" : [
949+
"Chat"
950+
],
951+
"summary" : "Get Chat Conversation",
952+
"description" : "Returns metadata for a Chat conversation including type, muted status, and group details. Use chat_conversation.fields to select which fields are returned. Use expansions to hydrate member, admin, or participant user objects. Use user.fields to control which profile fields are returned for expanded users.",
953+
"externalDocs" : {
954+
"url" : "https://developer.x.com/"
955+
},
956+
"operationId" : "getChatConversation",
957+
"parameters" : [
958+
{
959+
"name" : "id",
960+
"in" : "path",
961+
"description" : "The conversation ID. For 1:1 conversations, use the recipient user ID or dash-separated canonical ID. For group conversations, use the group ID (prefixed with 'g').",
962+
"required" : true,
963+
"schema" : {
964+
"type" : "string"
965+
},
966+
"style" : "simple"
967+
},
968+
{
969+
"$ref" : "#/components/parameters/ChatConversationFieldsParameter"
970+
},
971+
{
972+
"$ref" : "#/components/parameters/ChatConversationExpansionsParameter"
973+
},
974+
{
975+
"$ref" : "#/components/parameters/UserFieldsParameter"
976+
}
977+
],
978+
"responses" : {
979+
"200" : {
980+
"description" : "The request has succeeded.",
981+
"content" : {
982+
"application/json" : {
983+
"schema" : {
984+
"$ref" : "#/components/schemas/ChatGetConversationsResponse"
985+
}
986+
}
987+
}
988+
},
989+
"default" : {
990+
"description" : "The request has failed.",
991+
"content" : {
992+
"application/json" : {
993+
"schema" : {
994+
"$ref" : "#/components/schemas/Error"
995+
}
996+
},
997+
"application/problem+json" : {
998+
"schema" : {
999+
"$ref" : "#/components/schemas/Problem"
1000+
}
1001+
}
1002+
}
1003+
}
1004+
}
1005+
}
1006+
},
1007+
"/2/chat/conversations/{id}/events" : {
1008+
"get" : {
1009+
"security" : [
1010+
{
1011+
"OAuth2UserToken" : [
1012+
"dm.read",
1013+
"tweet.read",
1014+
"users.read"
1015+
]
1016+
},
1017+
{
1018+
"UserToken" : [ ]
1019+
}
1020+
],
1021+
"tags" : [
1022+
"Chat"
1023+
],
1024+
"summary" : "Get Chat Conversation Events",
1025+
"description" : "Retrieves messages and key change events for a specific Chat conversation with pagination support. For 1:1 conversations, provide the recipient's user ID; the server constructs the canonical conversation ID from the authenticated user and recipient.",
1026+
"externalDocs" : {
1027+
"url" : "https://developer.x.com/"
1028+
},
1029+
"operationId" : "getChatConversationEvents",
1030+
"parameters" : [
1031+
{
1032+
"name" : "id",
1033+
"in" : "path",
1034+
"description" : "The recipient's user ID for a 1:1 conversation, or a group conversation ID (prefixed with 'g').",
1035+
"required" : true,
1036+
"schema" : {
1037+
"$ref" : "#/components/schemas/ChatConversationOrRecipientId"
1038+
},
1039+
"style" : "simple"
1040+
},
1041+
{
1042+
"name" : "max_results",
1043+
"in" : "query",
1044+
"description" : "Maximum number of message events to return.",
1045+
"required" : false,
1046+
"schema" : {
1047+
"type" : "integer",
1048+
"minimum" : 1,
1049+
"maximum" : 100,
1050+
"format" : "int32",
1051+
"default" : 10
1052+
},
1053+
"style" : "form"
1054+
},
1055+
{
1056+
"name" : "pagination_token",
1057+
"in" : "query",
1058+
"description" : "Token for pagination to retrieve the next page of results.",
1059+
"required" : false,
1060+
"schema" : {
1061+
"type" : "string"
1062+
},
1063+
"style" : "form"
1064+
},
1065+
{
1066+
"$ref" : "#/components/parameters/ChatMessageEventFieldsParameter"
1067+
}
1068+
],
1069+
"responses" : {
1070+
"200" : {
1071+
"description" : "The request has succeeded.",
1072+
"content" : {
1073+
"application/json" : {
1074+
"schema" : {
1075+
"$ref" : "#/components/schemas/ChatGetConversationResponse"
1076+
}
1077+
}
1078+
}
1079+
},
1080+
"default" : {
1081+
"description" : "The request has failed.",
1082+
"content" : {
1083+
"application/json" : {
1084+
"schema" : {
1085+
"$ref" : "#/components/schemas/Error"
1086+
}
1087+
},
1088+
"application/problem+json" : {
1089+
"schema" : {
1090+
"$ref" : "#/components/schemas/Problem"
1091+
}
1092+
}
1093+
}
1094+
}
1095+
}
1096+
}
1097+
},
9341098
"/2/chat/conversations/{id}/keys" : {
9351099
"post" : {
9361100
"security" : [
@@ -14640,6 +14804,49 @@
1464014804
}
1464114805
}
1464214806
},
14807+
"ChatGetConversationResponse" : {
14808+
"type" : "object",
14809+
"properties" : {
14810+
"data" : {
14811+
"type" : "array",
14812+
"description" : "List of message events in the conversation.",
14813+
"items" : {
14814+
"$ref" : "#/components/schemas/ChatMessageEvent"
14815+
}
14816+
},
14817+
"errors" : {
14818+
"type" : "array",
14819+
"minItems" : 1,
14820+
"items" : {
14821+
"$ref" : "#/components/schemas/Problem"
14822+
}
14823+
},
14824+
"meta" : {
14825+
"type" : "object",
14826+
"properties" : {
14827+
"conversation_key_events" : {
14828+
"type" : "array",
14829+
"description" : "Conversation key change events needed for decryption.",
14830+
"items" : {
14831+
"type" : "string"
14832+
}
14833+
},
14834+
"has_more" : {
14835+
"type" : "boolean",
14836+
"description" : "Whether there are more messages to fetch."
14837+
},
14838+
"next_token" : {
14839+
"type" : "string",
14840+
"description" : "Token to retrieve the next page of results."
14841+
},
14842+
"result_count" : {
14843+
"type" : "integer",
14844+
"description" : "The number of message events returned."
14845+
}
14846+
}
14847+
}
14848+
}
14849+
},
1464314850
"ChatGetConversationsResponse" : {
1464414851
"type" : "object",
1464514852
"properties" : {
@@ -14991,6 +15198,54 @@
1499115198
}
1499215199
}
1499315200
},
15201+
"ChatMessageEvent" : {
15202+
"type" : "object",
15203+
"description" : "An Chat message event with extracted envelope fields and the original encoded event.",
15204+
"required" : [
15205+
"encoded_event"
15206+
],
15207+
"properties" : {
15208+
"conversation_id" : {
15209+
"type" : "string",
15210+
"description" : "The conversation ID this message belongs to."
15211+
},
15212+
"conversation_token" : {
15213+
"type" : "string",
15214+
"description" : "The conversation token for this message."
15215+
},
15216+
"created_at_msec" : {
15217+
"type" : "string",
15218+
"description" : "The creation timestamp in milliseconds."
15219+
},
15220+
"encoded_event" : {
15221+
"type" : "string",
15222+
"description" : "Base64-encoded MessageEvent for client decoding."
15223+
},
15224+
"id" : {
15225+
"type" : "string",
15226+
"description" : "The unique identifier for this message event (message_id)."
15227+
},
15228+
"is_trusted" : {
15229+
"type" : "boolean",
15230+
"description" : "Whether the message is from a trusted source."
15231+
},
15232+
"message_event_signature" : {
15233+
"$ref" : "#/components/schemas/ChatMessageEventSignature"
15234+
},
15235+
"previous_sequence_id" : {
15236+
"type" : "string",
15237+
"description" : "The sequence ID of the previous message."
15238+
},
15239+
"sender_id" : {
15240+
"type" : "string",
15241+
"description" : "The user ID of the message sender."
15242+
},
15243+
"sequence_id" : {
15244+
"type" : "string",
15245+
"description" : "The sequence identifier for ordering messages."
15246+
}
15247+
}
15248+
},
1499415249
"ChatMessageEventSignature" : {
1499515250
"type" : "object",
1499615251
"description" : "Message event signature for verification.",
@@ -16453,6 +16708,54 @@
1645316708
}
1645416709
]
1645516710
},
16711+
"Get2ChatConversationsIdEventsResponse" : {
16712+
"type" : "object",
16713+
"properties" : {
16714+
"data" : {
16715+
"type" : "array",
16716+
"minItems" : 1,
16717+
"items" : {
16718+
"$ref" : "#/components/schemas/ChatMessageEvent"
16719+
}
16720+
},
16721+
"errors" : {
16722+
"type" : "array",
16723+
"minItems" : 1,
16724+
"items" : {
16725+
"$ref" : "#/components/schemas/Problem"
16726+
}
16727+
},
16728+
"meta" : {
16729+
"type" : "object",
16730+
"properties" : {
16731+
"next_token" : {
16732+
"$ref" : "#/components/schemas/NextToken"
16733+
},
16734+
"result_count" : {
16735+
"$ref" : "#/components/schemas/ResultCount"
16736+
}
16737+
}
16738+
}
16739+
}
16740+
},
16741+
"Get2ChatConversationsIdResponse" : {
16742+
"type" : "object",
16743+
"properties" : {
16744+
"data" : {
16745+
"$ref" : "#/components/schemas/ChatConversation"
16746+
},
16747+
"errors" : {
16748+
"type" : "array",
16749+
"minItems" : 1,
16750+
"items" : {
16751+
"$ref" : "#/components/schemas/Problem"
16752+
}
16753+
},
16754+
"includes" : {
16755+
"$ref" : "#/components/schemas/Expansions"
16756+
}
16757+
}
16758+
},
1645616759
"Get2ChatConversationsResponse" : {
1645716760
"type" : "object",
1645816761
"properties" : {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
openapi: get /2/chat/conversations/{id}/events
3+
---

0 commit comments

Comments
 (0)