X Activity API
Endpoints relating to retrieving, managing activity subscriptions — 5 operation(s) in the X-published contract.
Endpoints relating to retrieving, managing activity subscriptions — 5 operation(s) in the X-published contract.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/x-activity-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
description: X API v2 core endpoints
version: '2.168'
title: X API v2 Activity API
termsOfService: https://developer.x.com/en/developer-terms/agreement-and-policy.html
contact:
name: X Developers
url: https://developer.x.com/
license:
name: X Developer Agreement and Policy
url: https://developer.x.com/en/developer-terms/agreement-and-policy.html
servers:
- description: X API
url: https://api.x.com
tags:
- name: Activity
description: Endpoints relating to retrieving, managing activity subscriptions
externalDocs:
description: Find out more
url: https://docs.x.com/x-api/enterprise-gnip-2.0/fundamentals/account-activity
paths:
/2/activity/subscriptions:
delete:
security:
- BearerToken: []
tags:
- Activity
summary: Delete X activity subscriptions by IDs
description: Deletes multiple subscriptions for X activity events by their IDs
externalDocs:
url: https://docs.x.com/x-api/activity/delete-x-activity-subscriptions-by-ids
operationId: deleteActivitySubscriptionsByIds
parameters:
- name: ids
in: query
required: true
schema:
type: array
minItems: 1
maxItems: 100
items:
type: string
pattern: ^[0-9]{1,19}$
explode: false
style: form
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteActivitySubscriptionsByIdsResponse'
default:
description: The request has failed.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
get:
security:
- OAuth2UserToken:
- like.read
- tweet.read
- UserToken: []
- BearerToken: []
tags:
- Activity
summary: Get X activity subscriptions
description: Get a list of active subscriptions for XAA
externalDocs:
url: https://docs.x.com/x-api/activity/get-x-activity-subscriptions
operationId: getActivitySubscriptions
parameters:
- name: max_results
in: query
required: false
schema:
type: integer
minimum: 1
maximum: 1000
format: int32
default: 1000
style: form
- name: pagination_token
in: query
description: A base32hex-encoded pagination token.
required: false
schema:
type: string
minLength: 16
style: form
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
$ref: '#/components/schemas/GetActivitySubscriptionsResponse'
default:
description: The request has failed.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
post:
security:
- OAuth2UserToken: []
- UserToken: []
- BearerToken: []
tags:
- Activity
summary: Create X activity subscription
description: 'Creates a subscription for an X activity event. OAuth2 user-context tokens must hold the scope matching the requested event_type: dm.read for chat.* and dm.* events, like.read for like.* events, mute.read for mute.* events, block.read for block.* events, and tweet.read for all other event types. Mute and block subscriptions are actor-only: filter.user_id must identify the authenticated user and direction is not supported. Optional filter.qualifiers further narrow supported chat, follow, unfollow, and like events.'
externalDocs:
url: https://docs.x.com/x-api/activity/create-x-activity-subscription
operationId: createActivitySubscription
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateActivitySubscriptionRequest'
required: true
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
$ref: '#/components/schemas/CreateActivitySubscriptionResponse'
default:
description: The request has failed.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/2/activity/subscriptions/{subscription_id}:
delete:
security:
- BearerToken: []
tags:
- Activity
summary: Deletes X activity subscription
description: Deletes a subscription for an X activity event
externalDocs:
url: https://docs.x.com/x-api/activity/deletes-x-activity-subscription
operationId: deleteActivitySubscription
parameters:
- name: subscription_id
in: path
required: true
schema:
type: string
pattern: ^[0-9]{1,19}$
style: simple
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteActivitySubscriptionResponse'
default:
description: The request has failed.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
put:
security:
- BearerToken: []
tags:
- Activity
summary: Update X activity subscription
description: Updates a subscription for an X activity event
externalDocs:
url: https://docs.x.com/x-api/activity/update-x-activity-subscription
operationId: updateActivitySubscription
parameters:
- name: subscription_id
in: path
required: true
schema:
type: string
pattern: ^[0-9]{1,19}$
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateActivitySubscriptionRequest'
required: true
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateActivitySubscriptionResponse'
default:
description: The request has failed.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
components:
schemas:
UpdateActivitySubscriptionResponseData:
type: object
properties:
subscription:
$ref: '#/components/schemas/UpdateActivitySubscriptionResponseDataSubscription'
total_subscriptions:
type: integer
description: Total active subscriptions for the instance.
UpdateActivitySubscriptionResponseDataSubscriptionFilter:
type: object
properties:
direction:
type: string
description: Optional direction filter for directional events. Not present for mute.* or block.* events.
keyword:
type: string
description: Optional keyword filter.
qualifiers:
type: object
description: Event-specific string predicates applied to the subscription.
user_id:
type: string
description: User the subscription is scoped to.
additionalProperties: false
UpdateActivitySubscriptionResponseDataSubscription:
type: object
properties:
created_at:
type: string
description: Subscription creation time.
event_type:
type: string
description: Activity event type in dot notation.
filter:
description: Subscription filter.
$ref: '#/components/schemas/UpdateActivitySubscriptionResponseDataSubscriptionFilter'
subscription_id:
type: string
description: Unique identifier of the subscription.
tag:
type: string
description: Optional caller-defined tag.
updated_at:
type: string
description: Subscription last-update time.
webhook_id:
type: string
description: Webhook receiving the subscription events.
additionalProperties: false
FieldHydrationFailureProblem:
type: object
required:
- type
- title
- detail
- field
properties:
detail:
type: string
field:
type: string
resource_type:
type: string
section:
type: string
status:
type: integer
title:
type: string
type:
type: string
enum:
- https://api.x.com/2/problems/field-hydration-failure
NotAuthorizedForResourceProblem:
type: object
required:
- type
- title
- detail
- resource_type
properties:
detail:
type: string
parameter:
type: string
resource_id:
type: string
resource_type:
type: string
section:
type: string
status:
type: integer
title:
type: string
type:
type: string
enum:
- https://api.x.com/2/problems/not-authorized-for-resource
value:
type: string
GetActivitySubscriptionsResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/GetActivitySubscriptionsResponseData'
errors:
type: array
items:
$ref: '#/components/schemas/Problem'
DeleteActivitySubscriptionsByIdsResponse:
type: object
properties:
data:
type: array
items:
type: object
properties:
deleted:
type: boolean
description: Whether the subscription was deleted.
subscription_id:
type: string
description: Id of the deleted subscription.
errors:
type: array
description: Per-id failures; deletion continues for the remaining ids.
items:
type: object
properties:
message:
type: string
description: Human-readable failure detail.
reason:
type: string
description: Machine-readable failure reason.
subscription_id:
type: string
description: Id the failure applies to.
meta:
type: object
properties:
total_subscriptions:
type: integer
description: Subscriptions remaining after deletion.
format: int32
CreateActivitySubscriptionResponseData:
type: object
properties:
subscription:
$ref: '#/components/schemas/CreateActivitySubscriptionResponseDataSubscription'
NotAuthorizedForFieldProblem:
type: object
required:
- type
- title
- detail
- field
properties:
detail:
type: string
field:
type: string
parameter:
type: string
resource_id:
type: string
resource_type:
type: string
section:
type: string
status:
type: integer
title:
type: string
type:
type: string
enum:
- https://api.x.com/2/problems/not-authorized-for-field
value:
type: string
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
InvalidRequestProblem:
type: object
required:
- type
- title
- detail
properties:
detail:
type: string
parameter:
type: string
status:
type: integer
title:
type: string
type:
type: string
enum:
- https://api.x.com/2/problems/invalid-request
value:
type: string
ResourceUnavailableProblem:
type: object
required:
- type
- title
- detail
- resource_type
properties:
detail:
type: string
resource_id:
type: string
resource_type:
type: string
status:
type: integer
title:
type: string
type:
type: string
enum:
- https://api.x.com/2/problems/resource-unavailable
CreateActivitySubscriptionFilter:
type: object
properties:
direction:
type: string
description: Optional direction filter for directional events. Not supported for mute.* or block.* events.
enum:
- inbound
- outbound
keyword:
type: string
description: Optional keyword filter.
qualifiers:
type: object
description: Optional event-specific string predicates.
user_id:
type: string
description: User the subscription is scoped to. For mute.* and block.* events, this must be the authenticated source user.
additionalProperties: false
UpdateActivitySubscriptionRequest:
type: object
properties:
tag:
type: string
description: Optional caller-defined tag.
minLength: 1
maxLength: 200
webhook_id:
type: string
description: Webhook to deliver the subscription events to.
pattern: ^[0-9]{1,19}$
additionalProperties: false
CreateActivitySubscriptionResponseDataSubscriptionFilter:
type: object
properties:
direction:
type: string
description: Optional direction filter for directional events. Not present for mute.* or block.* events.
keyword:
type: string
description: Optional keyword filter.
qualifiers:
type: object
description: Event-specific string predicates applied to the subscription.
user_id:
type: string
description: User the subscription is scoped to.
additionalProperties: false
DisallowedResourceProblem:
type: object
required:
- type
- title
- detail
properties:
detail:
type: string
resource_id:
type: string
resource_type:
type: string
section:
type: string
status:
type: integer
title:
type: string
type:
type: string
enum:
- https://api.x.com/2/problems/disallowed-resource
CreateActivitySubscriptionResponseDataSubscription:
type: object
properties:
created_at:
type: string
description: Subscription creation time.
event_type:
type: string
description: Activity event type in dot notation.
filter:
description: Subscription filter.
$ref: '#/components/schemas/CreateActivitySubscriptionResponseDataSubscriptionFilter'
subscription_id:
type: string
description: Unique identifier of the subscription.
tag:
type: string
description: Optional caller-defined tag.
updated_at:
type: string
description: Subscription last-update time.
webhook_id:
type: string
description: Webhook receiving the subscription events.
additionalProperties: false
InternalErrorProblem:
type: object
required:
- type
- title
- detail
properties:
detail:
type: string
status:
type: integer
title:
type: string
type:
type: string
enum:
- https://api.x.com/2/problems/internal-error
Problem:
oneOf:
- $ref: '#/components/schemas/ResourceNotFoundProblem'
- $ref: '#/components/schemas/InvalidRequestProblem'
- $ref: '#/components/schemas/NotAuthorizedForResourceProblem'
- $ref: '#/components/schemas/NotAuthorizedForFieldProblem'
- $ref: '#/components/schemas/FieldUnauthorizedProblem'
- $ref: '#/components/schemas/FieldHydrationFailureProblem'
- $ref: '#/components/schemas/ResourceUnavailableProblem'
- $ref: '#/components/schemas/DisallowedResourceProblem'
- $ref: '#/components/schemas/InternalErrorProblem'
discriminator:
propertyName: type
mapping:
https://api.x.com/2/problems/disallowed-resource: '#/components/schemas/DisallowedResourceProblem'
https://api.x.com/2/problems/field-hydration-failure: '#/components/schemas/FieldHydrationFailureProblem'
https://api.x.com/2/problems/field-unauthorized: '#/components/schemas/FieldUnauthorizedProblem'
https://api.x.com/2/problems/internal-error: '#/components/schemas/InternalErrorProblem'
https://api.x.com/2/problems/invalid-request: '#/components/schemas/InvalidRequestProblem'
https://api.x.com/2/problems/not-authorized-for-field: '#/components/schemas/NotAuthorizedForFieldProblem'
https://api.x.com/2/problems/not-authorized-for-resource: '#/components/schemas/NotAuthorizedForResourceProblem'
https://api.x.com/2/problems/resource-not-found: '#/components/schemas/ResourceNotFoundProblem'
https://api.x.com/2/problems/resource-unavailable: '#/components/schemas/ResourceUnavailableProblem'
UpdateActivitySubscriptionResponse:
type: object
properties:
data:
$ref: '#/components/schemas/UpdateActivitySubscriptionResponseData'
errors:
type: array
items:
$ref: '#/components/schemas/Problem'
ResourceNotFoundProblem:
type: object
required:
- type
- title
- detail
- resource_type
properties:
detail:
type: string
parameter:
type: string
resource_id:
type: string
resource_type:
type: string
status:
type: integer
title:
type: string
type:
type: string
enum:
- https://api.x.com/2/problems/resource-not-found
value:
type: string
CreateActivitySubscriptionRequest:
type: object
required:
- event_type
- filter
properties:
event_type:
type: string
description: Activity event type in dot notation. `chat.conversation_join` is a deprecated alias of `chat.conversation.join`; responses always use the canonical name.
enum:
- profile.update.bio
- profile.update.profile_picture
- profile.update.banner_picture
- profile.update.screenname
- profile.update.geo
- profile.update.url
- profile.update.verified_badge
- profile.update.affiliate_badge
- profile.update.handle
- news.new
- follow.follow
- follow.unfollow
- spaces.start
- spaces.end
- broadcast.start
- broadcast.end
- broadcast.chat
- chat.received
- chat.sent
- chat.conversation.join
- chat.conversation_join
- chat.conversation.member_added
- chat.conversation.member_removed
- chat.conversation.admin_added
- chat.conversation.admin_removed
- chat.update.group_name
- chat.update.restrictions
- dm.sent
- dm.received
- dm.indicate_typing
- dm.read
- post.create
- post.delete
- post.mention.create
- post.reply.create
- post.quote.create
- post.repost.create
- like.create
- mute.mute
- mute.unmute
- block.block
- block.unblock
filter:
description: Subscription filter.
$ref: '#/components/schemas/CreateActivitySubscriptionFilter'
tag:
type: string
description: Optional caller-defined tag.
minLength: 1
maxLength: 200
webhook_id:
type: string
description: Webhook to deliver the subscription events to.
pattern: ^[0-9]{1,19}$
additionalProperties: false
GetActivitySubscriptionsResponseDataFilter:
type: object
properties:
direction:
type: string
description: Optional direction filter for directional events. Not present for mute.* or block.* events.
keyword:
type: string
description: Optional keyword filter.
qualifiers:
type: object
description: Event-specific string predicates applied to the subscription.
user_id:
type: string
description: User the subscription is scoped to.
additionalProperties: false
FieldUnauthorizedProblem:
type: object
required:
- type
- title
- detail
- field
properties:
detail:
type: string
field:
type: string
resource_type:
type: string
section:
type: string
status:
type: integer
title:
type: string
type:
type: string
enum:
- https://api.x.com/2/problems/field-unauthorized
CreateActivitySubscriptionResponse:
type: object
properties:
data:
$ref: '#/components/schemas/CreateActivitySubscriptionResponseData'
errors:
type: array
items:
$ref: '#/components/schemas/Problem'
DeleteActivitySubscriptionResponse:
type: object
properties:
data:
$ref: '#/components/schemas/DeleteActivitySubscriptionResponseData'
errors:
type: array
items:
$ref: '#/components/schemas/Problem'
GetActivitySubscriptionsResponseData:
type: object
properties:
created_at:
type: string
description: Subscription creation time.
event_type:
type: string
description: Activity event type in dot notation.
filter:
$ref: '#/components/schemas/GetActivitySubscriptionsResponseDataFilter'
subscription_id:
type: string
description: Unique identifier of the subscription.
tag:
type: string
description: Optional caller-defined tag.
updated_at:
type: string
description: Subscription last-update time.
webhook_id:
type: string
description: Webhook receiving the subscription events.
DeleteActivitySubscriptionResponseData:
type: object
required:
- deleted
properties:
deleted:
type: boolean
description: Whether the subscription was deleted.
securitySchemes:
BearerToken:
type: http
scheme: bearer
OAuth2UserToken:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://api.x.com/2/oauth2/authorize
tokenUrl: https://api.x.com/2/oauth2/token
scopes:
block.read: View accounts you have blocked.
block.write: Block and unblock accounts on your behalf.
bookmark.read: Read your bookmarked Posts.
bookmark.write: Create and delete your bookmarks.
broadcast.read: View your live broadcasts and their chat.
broadcast.write: Manage your live broadcasts and send chat messages on your behalf.
developer.read: View your developer accounts, apps, and settings.
developer.write: Create and manage your X Developer Platform account.
dm.read: Read all your Direct Messages.
dm.write: Send and manage your Direct Messages.
follows.read: View accounts you follow and accounts following you.
follows.write: Follow and unfollow accounts on your behalf.
like.read: View Posts you have liked and likes you can see.
like.write: Like and unlike Posts on your behalf.
list.read: View Lists, members, and followers of Lists you created or are a member of, including private Lists.
list.write: Create and manage Lists on your behalf.
media.write: Upload media, such as photos and videos, on your behalf.
mute.read: View accounts you have muted.
mute.write: Mute and unmute accounts on your behalf.
offline.access: Request a refresh token for the app.
space.read: View all Spaces you have access to.
timeline.read: View all Custom Timelines you can see.
tweet.moderate.write: Hide and unhide replies to your posts.
tweet.read: View all posts you can see, including those from protected accounts.
tweet.write: Create and repost on your behalf.
users.read: View any account you can see, including protected accounts.
UserToken:
type: http
scheme: OAuth