Skip to main content
The Batch Compliance endpoints let you upload large datasets of Post IDs or user IDs and find out what action is needed to keep your datasets in sync with user intent and the current state of content on X. This guide covers how the upload and download flow works and the constraints to plan for.
Resumable uploads are no longer supported. Setting resumable in the body of POST /2/compliance/jobs returns a 400 error: Resumable uploads are not supported; create the job without resumable. Create the job without the resumable field and upload your file in a single PUT request.Upload and download URLs are now served from api.x.com with a signed token query parameter. Earlier versions of these endpoints returned Google Cloud Storage signed URLs (storage.googleapis.com) and used X-Goog-* headers; that guidance no longer applies.

How the upload flow works

When you create a job with POST /2/compliance/jobs, the response includes two pre-authorized URLs:
  • upload_url — a PUT endpoint of the form https://api.x.com/2/compliance/jobs/{id}/upload?token=.... Upload your newline-delimited ID file here. See Upload Compliance Job Submission.
  • download_url — a GET endpoint of the form https://api.x.com/2/compliance/jobs/{id}/download?token=.... Download results here once the job status is complete. See Download Compliance Job Results.
The token query parameter is an opaque signed token scoped to the job. Use each URL exactly as returned; do not modify or strip the token. Both URLs expire. The job object reports the expiry times in the upload_expires_at and download_expires_at fields. If a URL expires before you use it, create a new job.

Step one: create a job

Specify whether you are uploading Post IDs or user IDs with the type parameter (tweets or users). Replace $APP_ACCESS_TOKEN with your App only Access Token.
The response contains the job id, upload_url, download_url, and their expiry times:

Step two: upload your ID file

Prepare a plain text file with one Post ID or user ID per line, then PUT it to the upload_url from the create response:
Upload the complete file in a single request before upload_expires_at.

Step three: poll job status

Poll GET /2/compliance/jobs/{id} until the status is complete:

Step four: download results

Once the job status is complete, GET the download_url before download_expires_at:
Results are newline-delimited JSON with one object per ID that has a compliance event. IDs without compliance events are omitted and remain valid.

Constraints

  • One unfinished job per type at a time. Cancel an in-progress job with DELETE /2/compliance/jobs/{id} before creating another job of the same type.
  • The ID file must be plain text with exactly one numeric ID per line, and every ID must match the job type.
  • The job creation, status, and list endpoints are rate limited to 150 requests per 15 minutes per App. See Rate limits.

Next steps

Quickstart

Create your first compliance job

API Reference

Full endpoint documentation