PHP Client for Cloudflare API
R2

Jobs

Background jobs on an R2 bucket.

Background jobs on an R2 bucket.

List

List background jobs for a bucket.

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount Identifier.
bucketNamestringYesBucket Name.
paramsarrayNo[]Query Parameters: `jobType` (`prefixDelete`), `status` (`ENQUEUED`, `RUNNING`, `COMPLETED`, `FAILED` or `CANCELLED`, and only accepted alongside `jobType`), `maxKeys`, and `continuationToken` from the previous response's `nextContinuationToken`.
jurisdictionstring|nullNoJurisdiction where objects in this bucket are guaranteed to be stored.
php
$response = $client->r2()->jobs()->list('ACCOUNT_ID', 'BUCKET_NAME', [], 'JURISDICTION');
View this operation on the Cloudflare API Reference

Get

Get the current status of a background job.

$job = $client->r2()->objects()->emptyBucket('ACCOUNT_ID', 'my-bucket')->json('result.id');

$status = $client->r2()->jobs()->get('ACCOUNT_ID', 'my-bucket', $job)->json('result.status');
ParamTypeRequiredDefaultDescription
accountIdstringYesAccount Identifier.
bucketNamestringYesBucket Name.
jobIdstringYesJob identifier, as returned when the operation was submitted.
jurisdictionstring|nullNoJurisdiction where objects in this bucket are guaranteed to be stored.
php
$response = $client->r2()->jobs()->get('ACCOUNT_ID', 'BUCKET_NAME', 'JOB_ID', 'JURISDICTION');
View this operation on the Cloudflare API Reference
Copyright © 2026