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

# Batch Compliance

> Use the X API v2 Batch Compliance endpoints to upload Post ID or user ID datasets and retrieve current compliance status for deletions, suspensions, and edits.

export const Button = ({href, children}) => {
  return <div className="not-prose">
    <a href={href}>
      <button className="x-btn">
        <span>{children}</span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

The Batch Compliance endpoints let you upload datasets of Post IDs or user IDs and receive their current compliance status. Use this to identify deleted Posts, suspended accounts, and other compliance events.

## Overview

<CardGroup cols={2}>
  <Card title="Post compliance" icon="https://mintcdn.com/x-preview-mintlify-6d8eadf6/n02yn7ukCNWwbbxL/icons/xds/icon-chat.svg?fit=max&auto=format&n=n02yn7ukCNWwbbxL&q=85&s=d525f33208cf240bedcdd3cc32916921" width="24" height="24" data-path="icons/xds/icon-chat.svg">
    Check status of Posts in bulk
  </Card>

  <Card title="User compliance" icon="https://mintcdn.com/x-preview-mintlify-6d8eadf6/PpodpI_HowCtx-3w/icons/xds/icon-person.svg?fit=max&auto=format&n=PpodpI_HowCtx-3w&q=85&s=ee6f258e800b2b879c911b01ddd6bb56" width="24" height="24" data-path="icons/xds/icon-person.svg">
    Check status of users in bulk
  </Card>

  <Card title="Asynchronous" icon="clock">
    Submit jobs and retrieve results later
  </Card>

  <Card title="Large datasets" icon="database">
    Process millions of IDs
  </Card>
</CardGroup>

***

## How it works

1. **Create a job** — Specify the type (Posts or users) and upload URL
2. **Upload IDs** — Upload your dataset to the provided URL
3. **Wait for processing** — Job processes asynchronously
4. **Download results** — Get compliance status for each ID

***

## Endpoints

| Method | Endpoint                                                               | Description                                           |
| :----- | :--------------------------------------------------------------------- | :---------------------------------------------------- |
| POST   | [`/2/compliance/jobs`](/x-api/compliance/create-compliance-job)        | Create a new compliance job                           |
| GET    | [`/2/compliance/jobs/:id`](/x-api/compliance/get-compliance-job-by-id) | Get job status                                        |
| GET    | [`/2/compliance/jobs`](/x-api/compliance/get-compliance-jobs)          | List all jobs                                         |
| PUT    | [`upload_url`](/x-api/compliance/upload-compliance-job-submission)     | Upload your ID dataset (URL returned at job creation) |
| GET    | [`download_url`](/x-api/compliance/download-compliance-job-results)    | Download results (URL returned at job creation)       |
| DELETE | [`/2/compliance/jobs/:id`](/x-api/compliance/cancel-compliance-job)    | Cancel a job awaiting upload or processing            |

***

## Job types

| Type     | Description                  |
| :------- | :--------------------------- |
| `tweets` | Check Post compliance status |
| `users`  | Check user compliance status |

***

## Compliance events

Results carry an `action` — what you should do with your stored copy — and a
`reason` — why.

### Post events

| Action      | Reason         | Description                                                             |
| :---------- | :------------- | :---------------------------------------------------------------------- |
| `delete`    | `deleted`      | Post was deleted                                                        |
| `delete`    | `protected`    | Author's account became protected                                       |
| `delete`    | `deactivated`  | Author's account was deactivated                                        |
| `delete`    | `suspended`    | Author's account was suspended                                          |
| `rehydrate` | `tweet_edited` | Post was edited; re-fetch it to get the current revision                |
| `scrub_geo` | `geo_scrubbed` | Author removed geo data from their Posts; delete stored geo information |

### User events

| Action   | Reason        | Description              |
| :------- | :------------ | :----------------------- |
| `delete` | `deleted`     | Account was deleted      |
| `delete` | `protected`   | Account became protected |
| `delete` | `deactivated` | Account was deactivated  |
| `delete` | `suspended`   | Account was suspended    |

***

## Example: Create a job

```bash theme={null}
curl -X POST "https://api.x.com/2/compliance/jobs" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "tweets",
    "name": "my-compliance-job"
  }'
```

***

## Getting started

<Note>
  **Prerequisites**

  * An approved [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * A [Project and App](/resources/fundamentals/developer-apps) in the Developer Console
  * Your App's [Bearer Token](/resources/fundamentals/authentication)
</Note>

<CardGroup cols={2}>
  <Card title="Quickstart" icon="https://mintcdn.com/x-preview-mintlify-6d8eadf6/c5pmxlylrgjZbc7K/icons/xds/icon-rocket.svg?fit=max&auto=format&n=c5pmxlylrgjZbc7K&q=85&s=0082b4d402bc452feb6fb046011c99d7" href="/x-api/compliance/batch-compliance/quickstart" width="24" height="24" data-path="icons/xds/icon-rocket.svg">
    Create your first compliance job
  </Card>

  <Card title="Integration guide" icon="https://mintcdn.com/x-preview-mintlify-6d8eadf6/x_OGOw4l1_aDxlPY/icons/xds/icon-book.svg?fit=max&auto=format&n=x_OGOw4l1_aDxlPY&q=85&s=73860b7f3ff8e92d2d41da9ad02c485c" href="/x-api/compliance/batch-compliance/integrate" width="24" height="24" data-path="icons/xds/icon-book.svg">
    Key concepts and best practices
  </Card>

  <Card title="API Reference" icon="https://mintcdn.com/x-preview-mintlify-6d8eadf6/n02yn7ukCNWwbbxL/icons/xds/icon-code.svg?fit=max&auto=format&n=n02yn7ukCNWwbbxL&q=85&s=6ecdd528a6292ed5e268cb1c9369a567" href="/x-api/compliance/create-compliance-job" width="24" height="24" data-path="icons/xds/icon-code.svg">
    Full endpoint documentation
  </Card>
</CardGroup>
