Skip to main content
Batches

Get the error file

GET /api/v1/forward/batches/{batch_id}/error Returns a pre-signed download URL for the Batch error.jsonl file. The Batch must be in a terminal state. If there are no qualifying terminal failed tasks, error.jsonl is not generated and the endpoint returns 404 error_file_not_found.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>

Path parameters

ParameterTypeRequiredDescription
batch_idstringYesBatch ID.

Example request

curl -s -X GET 'https://api.qoder.com/api/v1/forward/batches/batch_failed001/error' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

Example response

HTTP 200 OK
{
  "url": "https://cloud-agents-storage.oss-cn-beijing.aliyuncs.com/files%2F<user_id>%2F<file_id>%2Fcontent?Expires=1783685162&OSSAccessKeyId=<ak>&Signature=<sig>&response-content-disposition=attachment%3B%20filename%3Dbatch-batch_failed001-error.jsonl",
  "expires_at": "2026-07-10T12:06:02Z"
}

Download the file

error_url="$(
  curl -fsS \
    "${FORWARD_BASE_URL}/api/v1/forward/batches/${BATCH_ID}/error" \
    -H "Authorization: Bearer ${QODER_ACCESS_TOKEN}" \
  | jq -er '.url'
)"

curl -fL \
  --output "batch-${BATCH_ID}-error.jsonl" \
  "${error_url}"
unset error_url
The signed URL contains temporary access credentials. Do not print, log, or commit the URL, and do not run these commands while set -x is enabled. The output_file_id and error_file_id generated by a Batch are internal result file identifiers. They are not registered as general Forward file resources and therefore cannot be retrieved through /api/v1/forward/files/{file_id} or /content.

Error codes

HTTPTypeCodeTrigger
400invalid_request_errorbatch_not_readyBatch is not in a terminal state.
404not_found_errorbatch_not_foundBatch does not exist or belongs to another user.
404not_found_errorerror_file_not_foundBatch did not generate error.jsonl.
410not_found_errorfile_expiredThe error file passed its 30-day retention and was purged.
401authentication_errorauthentication_requiredPAT or SAT is invalid or expired.