> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-58ae8dc1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream Users compliance data

> Streams all compliance data related to Users.



## OpenAPI

````yaml get /2/users/compliance/stream
openapi: 3.0.0
info:
  description: X API v2 core endpoints
  version: '2.167'
  title: X API v2
  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
security: []
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
  - 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
  - name: Articles
    description: Endpoints related to retrieving, creating & modifying Articles
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/articles/introduction
  - name: Broadcasts
    description: Endpoints related to live broadcasts and their chat
    externalDocs:
      description: Find out more
      url: https://developer.x.com/
  - name: Chat
    description: Endpoints related to Chat encrypted messaging
    externalDocs:
      description: Find out more
      url: https://developer.x.com/
  - name: Communities
    description: Endpoints related to retrieving and managing Communities
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/communities/introduction
  - name: Community Notes
    description: Endpoints related to retrieving, searching, and modifying Community Notes
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/community-notes/introduction
  - name: Compliance
    description: Endpoints related to keeping X data in your systems compliant
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/compliance/batch-compliance/introduction
  - name: Connections
    description: Endpoints related to streaming connections
    externalDocs:
      description: Find out more
      url: https://developer.x.com/en/docs/x-api/connections
  - name: Direct Messages
    description: Endpoints related to retrieving, managing Direct Messages
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/direct-messages/introduction
  - name: General
    description: Miscellaneous endpoints for general API functionality
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/introduction
  - name: Lists
    description: Endpoints related to retrieving, managing Lists
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/lists/introduction
  - name: Media
    description: Endpoints related to retrieving and uploading Media
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/media/introduction
  - name: News
    description: Endpoint for retrieving news stories
    externalDocs:
      description: Find out more
      url: https://developer.x.com/
  - name: Posts
    description: Endpoints related to retrieving, searching, and modifying Posts
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/posts/introduction
  - name: Spaces
    description: Endpoints related to retrieving, managing Spaces
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/spaces/introduction
  - name: Stream
    description: Endpoints related to streaming
    externalDocs:
      description: Find out more
      url: https://developer.x.com/
  - name: Trends
    description: Endpoint for retrieving trends
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/trends/introduction
  - name: Usage
    description: Endpoints related to retrieving usage
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/usage/introduction
  - name: Users
    description: Endpoints related to retrieving, managing relationships of Users
    externalDocs:
      description: Find out more
      url: https://docs.x.com/x-api/users/introduction
  - name: Webhooks
    description: Endpoints relating to retrieving, managing webhooks and webhook configs
    externalDocs:
      description: Find out more
      url: >-
        https://docs.x.com/x-api/enterprise-gnip-2.0/fundamentals/account-activity
paths:
  /2/users/compliance/stream:
    get:
      tags:
        - Stream
      summary: Stream Users compliance data
      description: Streams all compliance data related to Users.
      operationId: streamUsersCompliance
      parameters:
        - name: backfill_minutes
          in: query
          description: The number of minutes of backfill requested.
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 5
            format: int32
          style: form
        - name: partition
          in: query
          description: The partition number.
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 4
            format: int32
          style: form
        - name: start_time
          in: query
          description: >-
            YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User
            Compliance events will be provided.
          required: false
          schema:
            type: string
            format: date-time
          style: form
        - name: end_time
          in: query
          description: >-
            YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User
            Compliance events will be provided.
          required: false
          schema:
            type: string
            format: date-time
          style: form
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreamUsersComplianceResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - BearerToken: []
components:
  schemas:
    StreamUsersComplianceResponse:
      description: User compliance stream events.
      oneOf:
        - type: object
          description: User compliance event.
          required:
            - data
          properties:
            data:
              $ref: '#/components/schemas/UserComplianceData'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/Problem'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
    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:
            $ref: '#/components/schemas/DisallowedResourceProblem'
          https://api.x.com/2/problems/field-hydration-failure:
            $ref: '#/components/schemas/FieldHydrationFailureProblem'
          https://api.x.com/2/problems/field-unauthorized:
            $ref: '#/components/schemas/FieldUnauthorizedProblem'
          https://api.x.com/2/problems/internal-error:
            $ref: '#/components/schemas/InternalErrorProblem'
          https://api.x.com/2/problems/invalid-request:
            $ref: '#/components/schemas/InvalidRequestProblem'
          https://api.x.com/2/problems/not-authorized-for-field:
            $ref: '#/components/schemas/NotAuthorizedForFieldProblem'
          https://api.x.com/2/problems/not-authorized-for-resource:
            $ref: '#/components/schemas/NotAuthorizedForResourceProblem'
          https://api.x.com/2/problems/resource-not-found:
            $ref: '#/components/schemas/ResourceNotFoundProblem'
          https://api.x.com/2/problems/resource-unavailable:
            $ref: '#/components/schemas/ResourceUnavailableProblem'
    UserComplianceData:
      description: User compliance data.
      oneOf:
        - $ref: '#/components/schemas/UserProtectComplianceSchema'
        - $ref: '#/components/schemas/UserUnprotectComplianceSchema'
        - $ref: '#/components/schemas/UserDeleteComplianceSchema'
        - $ref: '#/components/schemas/UserUndeleteComplianceSchema'
        - $ref: '#/components/schemas/UserSuspendComplianceSchema'
        - $ref: '#/components/schemas/UserUnsuspendComplianceSchema'
        - $ref: '#/components/schemas/UserWithheldComplianceSchema'
        - $ref: '#/components/schemas/UserScrubGeoSchema'
        - $ref: '#/components/schemas/UserProfileModificationComplianceSchema'
    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
    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
    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
    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
    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
    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
    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
    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
    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
    UserProtectComplianceSchema:
      type: object
      required:
        - user_protect
      properties:
        user_protect:
          $ref: '#/components/schemas/UserComplianceSchema'
    UserUnprotectComplianceSchema:
      type: object
      required:
        - user_unprotect
      properties:
        user_unprotect:
          $ref: '#/components/schemas/UserComplianceSchema'
    UserDeleteComplianceSchema:
      type: object
      required:
        - user_delete
      properties:
        user_delete:
          $ref: '#/components/schemas/UserComplianceSchema'
    UserUndeleteComplianceSchema:
      type: object
      required:
        - user_undelete
      properties:
        user_undelete:
          $ref: '#/components/schemas/UserComplianceSchema'
    UserSuspendComplianceSchema:
      type: object
      required:
        - user_suspend
      properties:
        user_suspend:
          $ref: '#/components/schemas/UserComplianceSchema'
    UserUnsuspendComplianceSchema:
      type: object
      required:
        - user_unsuspend
      properties:
        user_unsuspend:
          $ref: '#/components/schemas/UserComplianceSchema'
    UserWithheldComplianceSchema:
      type: object
      required:
        - user_withheld
      properties:
        user_withheld:
          $ref: '#/components/schemas/UserTakedownComplianceSchema'
    UserScrubGeoSchema:
      type: object
      required:
        - scrub_geo
      properties:
        scrub_geo:
          $ref: '#/components/schemas/UserScrubGeoObjectSchema'
    UserProfileModificationComplianceSchema:
      type: object
      required:
        - user_profile_modification
      properties:
        user_profile_modification:
          $ref: '#/components/schemas/UserProfileModificationObjectSchema'
    UserComplianceSchema:
      type: object
      required:
        - user
        - event_at
      properties:
        event_at:
          type: string
          description: Event time.
          format: date-time
          example: '2021-07-06T18:40:40.000Z'
        user:
          type: object
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/UserId'
    UserTakedownComplianceSchema:
      type: object
      required:
        - user
        - withheld_in_countries
        - event_at
      properties:
        event_at:
          type: string
          description: Event time.
          format: date-time
          example: '2021-07-06T18:40:40.000Z'
        user:
          type: object
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/UserId'
        withheld_in_countries:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/CountryCode'
    UserScrubGeoObjectSchema:
      type: object
      required:
        - user
        - up_to_tweet_id
        - event_at
      properties:
        event_at:
          type: string
          description: Event time.
          format: date-time
          example: '2021-07-06T18:40:40.000Z'
        up_to_tweet_id:
          $ref: '#/components/schemas/PostId'
        user:
          type: object
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/UserId'
    UserProfileModificationObjectSchema:
      type: object
      required:
        - user
        - profile_field
        - new_value
        - event_at
      properties:
        event_at:
          type: string
          description: Event time.
          format: date-time
          example: '2021-07-06T18:40:40.000Z'
        new_value:
          type: string
        profile_field:
          type: string
        user:
          type: object
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/UserId'
    UserId:
      type: string
      description: Unique identifier of a User
      pattern: ^[0-9]{1,19}$
      example: '2244994945'
    CountryCode:
      type: string
      description: A two-letter ISO 3166-1 alpha-2 country code.
      pattern: ^[A-Z]{2}$
      example: US
    PostId:
      type: string
      description: Unique identifier of a Post
      pattern: ^[0-9]{1,19}$
      example: '1346889436626259968'
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer

````