Upload asset
POST/pages/assets/upload
Upload one or more files to the Pages asset store. Each file is identified by its content hash and is uploaded using the same JSON shape as the Cloudflare KV bulk write API. Used as part of the Pages Direct Upload workflow.
Authenticate with the JWT obtained from the upload-token endpoint: GET /accounts/{account_id}/pages/projects/{project_name}/upload-token
Upload asset
curl https://api.cloudflare.com/client/v4/pages/assets/upload \
-H 'Content-Type: application/json' \
-d '[
{
"base64": true,
"key": "b026324c6904b2a9cb4b88d6d61c81d1",
"metadata": {
"contentType": "text/plain"
},
"value": "SGVsbG8sIFdvcmxkIQ=="
}
]'{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true
}