Skip to main content
Batches

List Batches

GET /api/v1/forward/batches Returns the batches created by the current PAT user, sorted by creation time in descending order.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>

Query parameters

ParameterTypeRequiredDefaultDescription
statusstringNo-Filter by status.
limitintegerNo20Page size. Maximum 100.
after_idstringNo-Cursor for forward pagination.
before_idstringNo-Cursor for backward pagination.

Example request

curl -s -X GET 'https://api.qoder.com.cn/api/v1/forward/batches?limit=10' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

Example response

HTTP 200 OK
{
  "object": "list",
  "data": [
    {
      "id": "batch_completed001",
      "object": "batch",
      "status": "completed",
      "input_file_id": "file_input001",
      "output_file_id": "file_output001",
      "completion_window": "24h",
      "created_at": "2026-07-07T07:25:01Z",
      "expires_at": "2026-07-08T07:25:01Z",
      "request_counts": {
        "total": 30,
        "pending": 0,
        "running": 0,
        "completed": 30,
        "failed": 0,
        "cancelled": 0,
        "expired": 0
      },
      "usage": {
        "total_credits": 48.25
      }
    },
    {
      "id": "batch_processing001",
      "object": "batch",
      "status": "processing",
      "input_file_id": "file_input002",
      "completion_window": "24h",
      "created_at": "2026-07-06T11:59:02Z",
      "expires_at": "2026-07-07T11:59:02Z",
      "request_counts": {
        "total": 50,
        "pending": 20,
        "running": 5,
        "completed": 25,
        "failed": 0,
        "cancelled": 0,
        "expired": 0
      },
      "usage": {
        "total_credits": 12.5
      }
    }
  ],
  "has_more": true,
  "first_id": "batch_completed001",
  "last_id": "batch_processing001"
}

Response fields

FieldTypeDescription
objectstringAlways list.
dataarrayBatch objects on the current page.
first_idstringID of the first record on the page.
last_idstringID of the last record on the page.
has_morebooleanWhether more records are available.

Error codes

HTTPTypeCodeTrigger
400invalid_request_errorinvalid_paginationPagination parameters are invalid.
401authentication_errorauthentication_requiredPAT is invalid or expired.

Notes

  • When has_more=true, use last_id as after_id to continue paging.
  • output_file_id and error_file_id only appear after a terminal state is reached.
  • error_message only appears when status is failed.
  • usage follows the same definition as batch details. It returns the current aggregate total_credits after at least one subtask has valid CAS Session usage; otherwise it is null. The unit is CAS Credit, not tokens or currency.
  • Only batches created by the current PAT user are returned.