Cloudflare

Upload assets

Upload assets

POST /cloudflare/client/v4/accounts/{account_id}/workers/assets/upload

Upload one batch as multipart form fields (hash → content; base64 when base64=true). Send the upload token as Authorization: Bearer and your API key in X-API-Key. Earlier batches answer 202; the last answers 201 with the completion token.

Support: partial

Upload one batch as multipart form fields (hash → content; base64 when base64=true). Send the upload token as Authorization: Bearer and your API key in X-API-Key. Earlier batches answer 202; the last answers 201 with the completion token.

Parameters

NameLocationTypeRequiredDescription
account_idpathstringtrueAny value; your account comes from the API key.
base64querybooleanfalseField values are base64.

Request body (multipart/form-data)

Required: true

NameTypeDescription
{
  "type": "object",
  "additionalProperties": {
    "type": "string"
  },
  "description": "One form field per file: the field name is the hash, the value the content."
}

Response

HTTP 201

Success

application/json

NameTypeDescription
successbooleanAlways true on success.
errorsarray<any>Always empty on success.
messagesarray<any>Always empty on success.
resultobject
result.jwtstring | nullCompletion token after the last batch; null for earlier batches.
result_infoobjectPresent on list responses.
result_info.pageintegerPage number.
result_info.per_pageintegerPage size.
result_info.countintegerItems on this page.

HTTP 202

Batch stored; more batches remain (no completion token yet).

application/json

NameTypeDescription
successbooleanAlways true on success.
errorsarray<any>Always empty on success.
messagesarray<any>Always empty on success.
resultobject
result_infoobjectPresent on list responses.
result_info.pageintegerPage number.
result_info.per_pageintegerPage size.
result_info.countintegerItems on this page.
Export

On this page