Create compliance job

POST /2/compliance/jobs

Creates a compliance for the given job type

Body Required

  • type string Required

    Type of compliance job to list.

    Values are tweets or users.

  • resumable boolean

    If true, this endpoint will return a pre-signed URL with resumable uploads enabled

  • name string

    User-provided name for a compliance job

    Maximum length is 64.

Responses

  • 200

    The request was successful

    Hide response attributes Show response attributes object
    • data object
      Hide data attributes Show data attributes object
      • id string Required

        Compliance Job ID

        Format should match the following pattern: ^[0-9]{1,19}$.

      • type string Required

        Type of compliance job to list.

        Values are tweets or users.

      • created_at string(date-time) Required

        Creation time of the compliance job.

      • upload_url string(uri) Required

        URL to which the user will upload their tweet or user IDs

      • upload_expires_at string(date-time) Required

        Expiration time of the upload URL

      • download_url string(uri) Required

        URL from which the user will retrieve their compliance results

      • download_expires_at string(date-time) Required

        Expiration time of the download URL

      • name string

        User-provided name for a compliance job

        Maximum length is 64.

      • status string Required

        Status of a compliance job

        Values are created, in_progress, failed, or complete.

    • errors array[object]

      An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807).

      At least 1 element.

      Hide errors attributes Show errors attributes array[object]
      • type string Required
      • title string Required
      • detail string
      • status integer
  • default

    The request has failed.

    Hide response attributes Show response attributes object
    • code integer(int32) Required
    • message string Required
POST /2/compliance/jobs
curl \
 -X POST https://api.twitter.com/2/compliance/jobs \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"type":"tweets","resumable":true,"name":"my-job"}'
Request example
{
  "type": "tweets",
  "resumable": true,
  "name": "my-job"
}
Request examples
{
  "type": "tweets",
  "resumable": true,
  "name": "my-job"
}
Response examples (200)
{
  "data": {
    "id": "1372966999991541762",
    "type": "tweets",
    "created_at": "2021-01-06T18:40:40.000Z",
    "upload_url": "https://example.com",
    "upload_expires_at": "2021-01-06T18:40:40.000Z",
    "download_url": "https://example.com",
    "download_expires_at": "2021-01-06T18:40:40.000Z",
    "name": "my-job",
    "status": "created"
  },
  "errors": [
    {
      "type": "string",
      "title": "string",
      "detail": "string",
      "status": 42
    }
  ]
}
Response examples (200)
{
  "data": {
    "id": "1372966999991541762",
    "type": "tweets",
    "created_at": "2021-01-06T18:40:40.000Z",
    "upload_url": "https://example.com",
    "upload_expires_at": "2021-01-06T18:40:40.000Z",
    "download_url": "https://example.com",
    "download_expires_at": "2021-01-06T18:40:40.000Z",
    "name": "my-job",
    "status": "created"
  },
  "errors": [
    {
      "type": "string",
      "title": "string",
      "detail": "string",
      "status": 42
    }
  ]
}
Response examples (default)
{
  "code": 42,
  "message": "string"
}
Response examples (default)
{
  "code": 42,
  "message": "string"
}