X

X Account Activity API

Endpoints relating to retrieving, managing Account Activity subscriptions — 5 operation(s) in the X-published contract.

Business capability
Webhook & Event Subscription Management BC-4270.80

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /2/account_activity/subscriptions/count Count Account Activity subscriptions · Get Account Activity Subscription Count #
Ask an LLM
“How many Account Activity subscriptions does my app currently have?”
“Am I close to the subscription cap for Account Activity on X?”
Tell an agent
Show the total number of Account Activity subscriptions for my app.
Count how many users are subscribed through Account Activity right now.
GET /2/account_activity/webhooks/{webhook_id}/subscriptions/all Check a user's Account Activity subscription · Validate Account Activity Subscription #
Ask an LLM
“How can I confirm the authenticated user is subscribed to a given Account Activity webhook?”
“Is my user's Account Activity subscription on this webhook still valid?”
Tell an agent
Check whether I'm subscribed to Account Activity events on webhook {webhook_id}.
Validate my Account Activity subscription for webhook {webhook_id}.
POST /2/account_activity/webhooks/{webhook_id}/subscriptions/all Subscribe a user to Account Activity events · Create subscription #
Ask an LLM
“How do I start receiving Account Activity events for a user on my webhook?”
“Can I subscribe the authenticated user's activity to a registered webhook?”
Tell an agent
Subscribe my account's activity to webhook {webhook_id}.
Start delivering my Account Activity events to webhook {webhook_id}.
GET /2/account_activity/webhooks/{webhook_id}/subscriptions/all/list List subscriptions on an Account Activity webhook · Get Account Activity Subscriptions #
Ask an LLM
“Which users are subscribed to my Account Activity webhook?”
“What subscriptions exist under a particular Account Activity webhook?”
Tell an agent
List every Account Activity subscription on webhook {webhook_id}.
Show which user IDs are subscribed to webhook {webhook_id}.
DELETE /2/account_activity/webhooks/{webhook_id}/subscriptions/{user_id}/all Remove a user's Account Activity subscription · Delete subscription #
Ask an LLM
“How do I stop sending a user's Account Activity events to my webhook?”
“Can I unsubscribe one specific user from an Account Activity webhook?”
Tell an agent destructive · confirm first
Unsubscribe user {user_id} from Account Activity webhook {webhook_id}.
Delete the Account Activity subscription for {user_id} on webhook {webhook_id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/x:x-account-activity-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

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 Specification

x-account-activity-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: X API v2 core endpoints
  version: '2.168'
  title: X API v2 Account 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: Account Activity
  description: Endpoints relating to retrieving, managing Account Activity subscriptions
  externalDocs:
    description: Find out more
    url: https://docs.x.com/x-api/enterprise-gnip-2.0/fundamentals/account-activity
paths:
  /2/account_activity/subscriptions/count:
    get:
      security:
      - BearerToken: []
      tags:
      - Account Activity
      summary: Get Account Activity Subscription Count
      operationId: getAccountActivitySubscriptionCount
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccountActivitySubscriptionCountResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
  /2/account_activity/webhooks/{webhook_id}/subscriptions/all:
    get:
      security:
      - OAuth2UserToken:
        - dm.read
        - dm.write
        - users.read
        - tweet.read
      - UserToken: []
      tags:
      - Account Activity
      summary: Validate Account Activity Subscription
      operationId: validateAccountActivitySubscription
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/WebhookConfigId'
        style: simple
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateAccountActivitySubscriptionResponse'
        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:
        - dm.read
        - tweet.read
        - users.read
        - dm.write
      - UserToken: []
      tags:
      - Account Activity
      summary: Create subscription
      description: Creates an Account Activity subscription for the user and the given webhook.
      externalDocs:
        url: https://docs.x.com/x-api/account-activity/introduction
      operationId: createAccountActivitySubscription
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/WebhookConfigId'
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAccountActivitySubscriptionRequest'
        required: true
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAccountActivitySubscriptionResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
  /2/account_activity/webhooks/{webhook_id}/subscriptions/all/list:
    get:
      security:
      - BearerToken: []
      tags:
      - Account Activity
      summary: Get Account Activity Subscriptions
      operationId: getAccountActivitySubscriptions
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/WebhookConfigId'
        style: simple
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccountActivitySubscriptionsResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
  /2/account_activity/webhooks/{webhook_id}/subscriptions/{user_id}/all:
    delete:
      security:
      - BearerToken: []
      tags:
      - Account Activity
      summary: Delete subscription
      description: Deletes an Account Activity subscription for the given webhook and user ID.
      externalDocs:
        url: https://docs.x.com/x-api/account-activity/introduction
      operationId: deleteAccountActivitySubscription
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/WebhookConfigId'
        style: simple
      - name: user_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/UserId'
        style: simple
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteAccountActivitySubscriptionResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
components:
  schemas:
    GetAccountActivitySubscriptionsResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/GetAccountActivitySubscriptionsResponseData'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Problem'
    CreateAccountActivitySubscriptionResponseData:
      type: object
      required:
      - subscribed
      properties:
        subscribed:
          type: boolean
          description: Whether the subscription is active.
    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
    CreateAccountActivitySubscriptionRequest:
      type: object
      properties: {}
    WebhookConfigId:
      type: string
      description: Unique identifier of a WebhookConfig
      pattern: ^[0-9]{1,19}$
    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
    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
    GetAccountActivitySubscriptionCountResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/GetAccountActivitySubscriptionCountResponseData'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Problem'
    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
    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
    DeleteAccountActivitySubscriptionResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/DeleteAccountActivitySubscriptionResponseData'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Problem'
    GetAccountActivitySubscriptionsResponseDataSubscriptions:
      type: object
      properties:
        user_id:
          type: string
          description: Subscribed user.
      additionalProperties: false
    DeleteAccountActivitySubscriptionResponseData:
      type: object
      required:
      - subscribed
      properties:
        subscribed:
          type: boolean
          description: Whether the user has an active subscription.
    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'
    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
    ValidateAccountActivitySubscriptionResponseData:
      type: object
      required:
      - subscribed
      properties:
        subscribed:
          type: boolean
          description: Whether the user has an active subscription.
    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
    GetAccountActivitySubscriptionsResponseData:
      type: object
      properties:
        application_id:
          type: string
          description: App the subscriptions belong to.
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/GetAccountActivitySubscriptionsResponseDataSubscriptions'
        webhook_id:
          type: string
          description: Webhook receiving the subscription events.
        webhook_url:
          type: string
          description: URL the webhook delivers events to.
    ValidateAccountActivitySubscriptionResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ValidateAccountActivitySubscriptionResponseData'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Problem'
    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
    UserId:
      type: string
      description: Unique identifier of a User
      pattern: ^[0-9]{1,19}$
      example: '2244994945'
    CreateAccountActivitySubscriptionResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CreateAccountActivitySubscriptionResponseData'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Problem'
    GetAccountActivitySubscriptionCountResponseData:
      type: object
      properties:
        account_name:
          type: string
          description: Name of the subscribing account.
        provisioned_count:
          type: string
          description: Number of subscriptions provisioned for the app.
        subscriptions_count_all:
          type: string
          description: Number of active subscriptions across all event types.
        subscriptions_count_direct_messages:
          type: string
          description: Number of active Direct Message subscriptions.
  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