Fetch script content only
/accounts/{account_identifier}/workers/scripts/{script_name}/content/v2
get
Worker Script
worker-script-get-content
null {
"enum": [
"com.cloudflare.edge.worker.script.read"
]
} [
{
"in": "path",
"name": "account_identifier",
"required": true,
"schema": {
"description": "Identifier",
"example": "023e105f4ecef8ad9ca31a8372d0c353",
"maxLength": 32,
"readOnly": true,
"type": "string"
}
},
{
"in": "path",
"name": "script_name",
"required": true,
"schema": {
"description": "Name of the script, used in URLs and route configuration.",
"example": "this-is_my_script-01",
"pattern": "^[a-z0-9_][a-z0-9-_]*$",
"type": "string"
}
}
] null {
"200": {
"content": {
"string": {
"schema": {
"example": "addEventListener('fetch', event => { event.respondWith(fetch(event.request)) })"
}
}
},
"description": "Fetch script content"
},
"4XX": {
"content": {
"application/json": {
"schema": {
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"enum": [
true
],
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
}
}
},
"description": "Fetch script content failure"
}
} [
{
"api_token": []
},
{
"api_email": [],
"api_key": []
}
]