Activity

Create X Activity Subscription

Changed on

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, follows.read for subscriptions.* 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. subscriptions.* events require a user-context token and filter.user_id must identify the authenticated user. Optional filter.qualifiers further narrow supported chat, follow, unfollow, like, and subscriptions events.

post/2/activity/subscriptions

Request

  • Base URL
    https://api.x.com
  • URL
    https://api.x.com/2/activity/subscriptions
  • Auth
    • OAuth 2
      Authorization code: https://api.x.com/2/oauth2/authorize
      Token URL: https://api.x.com/2/oauth2/token
    • or HTTP oauth
    • or HTTP bearer

Request body

event_type'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' | 'subscriptions.subscribe' | 'subscriptions.unsubscribe' | 'spaces.start' | 'spaces.end' | 'broadcast.start' | 'broadcast.end' | 'broadcast.chat' | 'broadcast.chat.remove' | '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' required

Activity event type in dot notation. chat.conversation_join is a deprecated alias of chat.conversation.join; responses always use the canonical name.

expires_atstring

Optional RFC 3339 expiration time. Re-creating the same subscription refreshes this value; omitting it makes the subscription permanent.

tagstring

Optional caller-defined tag.

webhook_idstring

Webhook to deliver the subscription events to.

Response

The request has succeeded.

Changes

    • breaking

      added to the response body oneOf list for the response status

    • breaking

      added to the / response property oneOf list for the response status

    • info

      added https://api.x.com/2/problems/dm-bad-attachment https://api.x.com/2/problems/dm-bad-cta https://api.x.com/2/problems/dm-bad-custom-profile https://api.x.com/2/problems/dm-bad-media https://api.x.com/2/problems/dm-bad-quick-reply https://api.x.com/2/problems/dm-bad-url https://api.x.com/2/problems/dm-conversation-name-too-long https://api.x.com/2/problems/dm-conversation-not-found https://api.x.com/2/problems/dm-duplicate https://api.x.com/2/problems/dm-inactive-device https://api.x.com/2/problems/dm-not-delivered https://api.x.com/2/problems/dm-not-found https://api.x.com/2/problems/dm-not-owner https://api.x.com/2/problems/dm-participant-not-added https://api.x.com/2/problems/dm-participant-not-found https://api.x.com/2/problems/dm-participant-restricted https://api.x.com/2/problems/dm-participant-unavailable https://api.x.com/2/problems/dm-rate-limited https://api.x.com/2/problems/dm-recipient-blocks-sender https://api.x.com/2/problems/dm-recipient-cannot-receive https://api.x.com/2/problems/dm-recipient-encrypted-unavailable https://api.x.com/2/problems/dm-recipient-not-accepting https://api.x.com/2/problems/dm-recipient-not-found https://api.x.com/2/problems/dm-recipient-restricts-groups https://api.x.com/2/problems/dm-recipient-unavailable https://api.x.com/2/problems/dm-request-in-progress https://api.x.com/2/problems/dm-safety-limited https://api.x.com/2/problems/dm-safety-rejected https://api.x.com/2/problems/dm-sender-blocks-recipient https://api.x.com/2/problems/dm-sender-declined-dms https://api.x.com/2/problems/dm-sender-dms-closed https://api.x.com/2/problems/dm-sender-encrypted-unavailable https://api.x.com/2/problems/dm-sender-not-in-conversation https://api.x.com/2/problems/dm-sender-not-permitted https://api.x.com/2/problems/dm-sender-not-verified https://api.x.com/2/problems/dm-sender-phone-required https://api.x.com/2/problems/dm-sender-read-only https://api.x.com/2/problems/dm-sender-unavailable https://api.x.com/2/problems/dm-text-empty https://api.x.com/2/problems/dm-text-too-long https://api.x.com/2/problems/dm-too-few-participants https://api.x.com/2/problems/dm-too-many-participants https://api.x.com/2/problems/dm-unsupported-message mapping keys to the response discriminator for the response status

    • info

      added https://api.x.com/2/problems/dm-bad-attachment https://api.x.com/2/problems/dm-bad-cta https://api.x.com/2/problems/dm-bad-custom-profile https://api.x.com/2/problems/dm-bad-media https://api.x.com/2/problems/dm-bad-quick-reply https://api.x.com/2/problems/dm-bad-url https://api.x.com/2/problems/dm-conversation-name-too-long https://api.x.com/2/problems/dm-conversation-not-found https://api.x.com/2/problems/dm-duplicate https://api.x.com/2/problems/dm-inactive-device https://api.x.com/2/problems/dm-not-delivered https://api.x.com/2/problems/dm-not-found https://api.x.com/2/problems/dm-not-owner https://api.x.com/2/problems/dm-participant-not-added https://api.x.com/2/problems/dm-participant-not-found https://api.x.com/2/problems/dm-participant-restricted https://api.x.com/2/problems/dm-participant-unavailable https://api.x.com/2/problems/dm-rate-limited https://api.x.com/2/problems/dm-recipient-blocks-sender https://api.x.com/2/problems/dm-recipient-cannot-receive https://api.x.com/2/problems/dm-recipient-encrypted-unavailable https://api.x.com/2/problems/dm-recipient-not-accepting https://api.x.com/2/problems/dm-recipient-not-found https://api.x.com/2/problems/dm-recipient-restricts-groups https://api.x.com/2/problems/dm-recipient-unavailable https://api.x.com/2/problems/dm-request-in-progress https://api.x.com/2/problems/dm-safety-limited https://api.x.com/2/problems/dm-safety-rejected https://api.x.com/2/problems/dm-sender-blocks-recipient https://api.x.com/2/problems/dm-sender-declined-dms https://api.x.com/2/problems/dm-sender-dms-closed https://api.x.com/2/problems/dm-sender-encrypted-unavailable https://api.x.com/2/problems/dm-sender-not-in-conversation https://api.x.com/2/problems/dm-sender-not-permitted https://api.x.com/2/problems/dm-sender-not-verified https://api.x.com/2/problems/dm-sender-phone-required https://api.x.com/2/problems/dm-sender-read-only https://api.x.com/2/problems/dm-sender-unavailable https://api.x.com/2/problems/dm-text-empty https://api.x.com/2/problems/dm-text-too-long https://api.x.com/2/problems/dm-too-few-participants https://api.x.com/2/problems/dm-too-many-participants https://api.x.com/2/problems/dm-unsupported-message discriminator mapping keys to the / response property for the response status

    • breaking

      added to the response body oneOf list for the response status

    • breaking

      added to the / response property oneOf list for the response status

    • info

      added the new optional request property

    • info

      added the new optional request property /

    • info

      added the new broadcast.chat.remove enum value to the request property

    • info

      added the new broadcast.end enum value to the request property

    • info

      added the new broadcast.start enum value to the request property

    • info

      added the new subscriptions.subscribe enum value to the request property

    • info

      added the new subscriptions.unsubscribe enum value to the request property

    • info

      added https://api.twitter.com/2/problems/duplicate-rules https://api.twitter.com/2/problems/invalid-rules https://api.x.com/2/problems/recipient-not-messageable mapping keys to the response discriminator for the response status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added https://api.twitter.com/2/problems/duplicate-rules https://api.twitter.com/2/problems/invalid-rules https://api.x.com/2/problems/recipient-not-messageable discriminator mapping keys to the / response property for the response status