Skip to content

Commit ccd4b48

Browse files
authored
Merge pull request #34 from xdevplatform/filtered-stream-webhooks
Filtered Stream Webhooks Docs
2 parents 1a71831 + 0ae6603 commit ccd4b48

10 files changed

Lines changed: 549 additions & 28 deletions

File tree

docs.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,16 @@
811811
"x-api/media/get-media-analytics"
812812
]
813813
},
814+
{
815+
"group": "Webhooks",
816+
"pages": [
817+
"x-api/webhooks/introduction",
818+
"x-api/webhooks/create-webhook",
819+
"x-api/webhooks/delete-webhook",
820+
"x-api/webhooks/get-webhook",
821+
"x-api/webhooks/validate-webhook"
822+
]
823+
},
814824
{
815825
"group": "Account Activity",
816826
"pages": [
@@ -830,13 +840,13 @@
830840
]
831841
},
832842
{
833-
"group": "Webhooks",
843+
"group": "Filtered Stream Webhooks",
834844
"pages": [
835-
"x-api/webhooks/introduction",
836-
"x-api/webhooks/create-webhook",
837-
"x-api/webhooks/delete-webhook",
838-
"x-api/webhooks/get-webhook",
839-
"x-api/webhooks/validate-webhook"
845+
"x-api/webhooks/stream/introduction",
846+
"x-api/webhooks/stream/quickstart",
847+
"x-api/webhooks/create-stream-link",
848+
"x-api/webhooks/delete-stream-link",
849+
"x-api/webhooks/get-stream-links"
840850
]
841851
},
842852
{

openapi.json

Lines changed: 316 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi" : "3.0.0",
33
"info" : {
44
"description" : "X API v2 available endpoints",
5-
"version" : "2.148",
5+
"version" : "2.149",
66
"title" : "X API v2",
77
"termsOfService" : "https://developer.x.com/en/developer-terms/agreement-and-policy.html",
88
"contact" : {
@@ -6732,6 +6732,227 @@
67326732
}
67336733
}
67346734
},
6735+
"/2/tweets/search/webhooks" : {
6736+
"get" : {
6737+
"security" : [
6738+
{
6739+
"BearerToken" : [ ]
6740+
}
6741+
],
6742+
"tags" : [
6743+
"Webhooks",
6744+
"Stream"
6745+
],
6746+
"summary" : "Get stream links",
6747+
"description" : "Get a list of webhook links associated with a filtered stream ruleset.",
6748+
"externalDocs" : {
6749+
"url" : "https://docs.x.com/x-api/webhooks/introduction"
6750+
},
6751+
"operationId" : "getWebhooksStreamLinks",
6752+
"parameters" : [ ],
6753+
"responses" : {
6754+
"200" : {
6755+
"description" : "The request has succeeded.",
6756+
"content" : {
6757+
"application/json" : {
6758+
"schema" : {
6759+
"$ref" : "#/components/schemas/WebhookLinksGetResponse"
6760+
}
6761+
}
6762+
}
6763+
},
6764+
"default" : {
6765+
"description" : "The request has failed.",
6766+
"content" : {
6767+
"application/json" : {
6768+
"schema" : {
6769+
"$ref" : "#/components/schemas/Error"
6770+
}
6771+
},
6772+
"application/problem+json" : {
6773+
"schema" : {
6774+
"$ref" : "#/components/schemas/Problem"
6775+
}
6776+
}
6777+
}
6778+
}
6779+
}
6780+
}
6781+
},
6782+
"/2/tweets/search/webhooks/{webhook_id}" : {
6783+
"delete" : {
6784+
"security" : [
6785+
{
6786+
"BearerToken" : [ ]
6787+
}
6788+
],
6789+
"tags" : [
6790+
"Webhooks",
6791+
"Stream"
6792+
],
6793+
"summary" : "Delete stream link",
6794+
"description" : "Deletes a link from FilteredStream events to the given webhook.",
6795+
"externalDocs" : {
6796+
"url" : "https://docs.x.com/x-api/webhooks/introduction"
6797+
},
6798+
"operationId" : "deleteWebhooksStreamLink",
6799+
"parameters" : [
6800+
{
6801+
"name" : "webhook_id",
6802+
"in" : "path",
6803+
"description" : "The webhook ID to link to your FilteredStream ruleset.",
6804+
"required" : true,
6805+
"schema" : {
6806+
"$ref" : "#/components/schemas/WebhookConfigId"
6807+
},
6808+
"style" : "simple"
6809+
}
6810+
],
6811+
"responses" : {
6812+
"200" : {
6813+
"description" : "The request has succeeded.",
6814+
"content" : {
6815+
"application/json" : {
6816+
"schema" : {
6817+
"$ref" : "#/components/schemas/WebhookLinksDeleteResponse"
6818+
}
6819+
}
6820+
}
6821+
},
6822+
"default" : {
6823+
"description" : "The request has failed.",
6824+
"content" : {
6825+
"application/json" : {
6826+
"schema" : {
6827+
"$ref" : "#/components/schemas/Error"
6828+
}
6829+
},
6830+
"application/problem+json" : {
6831+
"schema" : {
6832+
"$ref" : "#/components/schemas/Problem"
6833+
}
6834+
}
6835+
}
6836+
}
6837+
}
6838+
},
6839+
"post" : {
6840+
"security" : [
6841+
{
6842+
"BearerToken" : [ ]
6843+
}
6844+
],
6845+
"tags" : [
6846+
"Webhooks",
6847+
"Stream"
6848+
],
6849+
"summary" : "Create stream link",
6850+
"description" : "Creates a link to deliver FilteredStream events to the given webhook.",
6851+
"externalDocs" : {
6852+
"url" : "https://docs.x.com/x-api/webhooks/introduction"
6853+
},
6854+
"operationId" : "createWebhooksStreamLink",
6855+
"parameters" : [
6856+
{
6857+
"name" : "webhook_id",
6858+
"in" : "path",
6859+
"description" : "The webhook ID to link to your FilteredStream ruleset.",
6860+
"required" : true,
6861+
"schema" : {
6862+
"$ref" : "#/components/schemas/WebhookConfigId"
6863+
},
6864+
"style" : "simple"
6865+
},
6866+
{
6867+
"name" : "tweet.fields",
6868+
"in" : "query",
6869+
"description" : "A comma separated list of Tweet fields to display.",
6870+
"required" : false,
6871+
"schema" : {
6872+
"type" : "string"
6873+
},
6874+
"style" : "form"
6875+
},
6876+
{
6877+
"name" : "expansions",
6878+
"in" : "query",
6879+
"description" : "A comma separated list of fields to expand.",
6880+
"required" : false,
6881+
"schema" : {
6882+
"type" : "string"
6883+
},
6884+
"style" : "form"
6885+
},
6886+
{
6887+
"name" : "media.fields",
6888+
"in" : "query",
6889+
"description" : "A comma separated list of Media fields to display.",
6890+
"required" : false,
6891+
"schema" : {
6892+
"type" : "string"
6893+
},
6894+
"style" : "form"
6895+
},
6896+
{
6897+
"name" : "poll.fields",
6898+
"in" : "query",
6899+
"description" : "A comma separated list of Poll fields to display.",
6900+
"required" : false,
6901+
"schema" : {
6902+
"type" : "string"
6903+
},
6904+
"style" : "form"
6905+
},
6906+
{
6907+
"name" : "user.fields",
6908+
"in" : "query",
6909+
"description" : "A comma separated list of User fields to display.",
6910+
"required" : false,
6911+
"schema" : {
6912+
"type" : "string"
6913+
},
6914+
"style" : "form"
6915+
},
6916+
{
6917+
"name" : "place.fields",
6918+
"in" : "query",
6919+
"description" : "A comma separated list of Place fields to display.",
6920+
"required" : false,
6921+
"schema" : {
6922+
"type" : "string"
6923+
},
6924+
"style" : "form"
6925+
}
6926+
],
6927+
"responses" : {
6928+
"200" : {
6929+
"description" : "The request has succeeded.",
6930+
"content" : {
6931+
"application/json" : {
6932+
"schema" : {
6933+
"$ref" : "#/components/schemas/WebhookLinksCreateResponse"
6934+
}
6935+
}
6936+
}
6937+
},
6938+
"default" : {
6939+
"description" : "The request has failed.",
6940+
"content" : {
6941+
"application/json" : {
6942+
"schema" : {
6943+
"$ref" : "#/components/schemas/Error"
6944+
}
6945+
},
6946+
"application/problem+json" : {
6947+
"schema" : {
6948+
"$ref" : "#/components/schemas/Problem"
6949+
}
6950+
}
6951+
}
6952+
}
6953+
}
6954+
}
6955+
},
67356956
"/2/tweets/{id}" : {
67366957
"delete" : {
67376958
"security" : [
@@ -20009,6 +20230,100 @@
2000920230
}
2001020231
}
2001120232
}
20233+
},
20234+
"WebhookLinksCreateResponse" : {
20235+
"type" : "object",
20236+
"properties" : {
20237+
"data" : {
20238+
"type" : "object",
20239+
"properties" : {
20240+
"provisioned" : {
20241+
"type" : "boolean"
20242+
}
20243+
}
20244+
},
20245+
"errors" : {
20246+
"type" : "array",
20247+
"minItems" : 1,
20248+
"items" : {
20249+
"$ref" : "#/components/schemas/Problem"
20250+
}
20251+
}
20252+
}
20253+
},
20254+
"WebhookLinksDeleteResponse" : {
20255+
"type" : "object",
20256+
"properties" : {
20257+
"data" : {
20258+
"type" : "object",
20259+
"properties" : {
20260+
"deleted" : {
20261+
"type" : "boolean"
20262+
}
20263+
}
20264+
},
20265+
"errors" : {
20266+
"type" : "array",
20267+
"minItems" : 1,
20268+
"items" : {
20269+
"$ref" : "#/components/schemas/Problem"
20270+
}
20271+
}
20272+
}
20273+
},
20274+
"WebhookLinksGetResponse" : {
20275+
"type" : "object",
20276+
"properties" : {
20277+
"data" : {
20278+
"type" : "object",
20279+
"description" : "The list of active webhook links for a given stream",
20280+
"required" : [
20281+
"links"
20282+
],
20283+
"properties" : {
20284+
"links" : {
20285+
"type" : "array",
20286+
"description" : "list of links",
20287+
"items" : {
20288+
"type" : "object",
20289+
"properties" : {
20290+
"application_id" : {
20291+
"type" : "string",
20292+
"description" : "The application ID"
20293+
},
20294+
"business_user_id" : {
20295+
"type" : "string",
20296+
"description" : "The user ID"
20297+
},
20298+
"fields" : {
20299+
"type" : "array",
20300+
"description" : "Requested fields to be rendered",
20301+
"items" : {
20302+
"type" : "string",
20303+
"description" : "A query-parameter formatted field or expansion, e.g., 'expansions=author_id' or 'user.fields=name,username'"
20304+
}
20305+
},
20306+
"instance_id" : {
20307+
"type" : "string",
20308+
"description" : "The stream ID associated with the FilteredStream instance"
20309+
},
20310+
"webhook_id" : {
20311+
"type" : "string",
20312+
"description" : "The unique identifier for the webhook"
20313+
}
20314+
}
20315+
}
20316+
}
20317+
}
20318+
},
20319+
"errors" : {
20320+
"type" : "array",
20321+
"minItems" : 1,
20322+
"items" : {
20323+
"$ref" : "#/components/schemas/Problem"
20324+
}
20325+
}
20326+
}
2001220327
}
2001320328
},
2001420329
"parameters" : {

overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Button } from '/snippets/button.mdx';
99

1010
Build, analyze, and innovate with X's real-time, global data and APIs. Whether you're creating new apps, integrating with X, or analyzing trends, our platform gives you the tools to get started quickly.
1111

12-
<Card title="Account Activity API v2: Now Available" icon="bolt" iconType="solid">
12+
<Card title="Filtered Stream Webhooks: Now Available" icon="bolt" iconType="solid">
1313
<div style={{
1414
position: 'relative',
1515
minHeight: '90px'
@@ -29,7 +29,7 @@ Build, analyze, and innovate with X's real-time, global data and APIs. Whether y
2929
<img src="/logo/logo.svg" alt="X logo" style={{ width: '100%' }} />
3030
</div>
3131
<div style={{ position: 'relative', zIndex: 1 }}>
32-
Get real-time events for X accounts—post creation, @mentions, replies, follows, DMs, and more—delivered to your webhook.
32+
Filter and get real-time events for public Posts — delivered to your webhook.
3333
<br /><br />
3434
<Button href="/x-api/account-activity/introduction">Learn more</Button>
3535
</div>

0 commit comments

Comments
 (0)