Files
Write one file
Writes text content as JSON, or a multipart file part, at path as one saved version.
put/v2/pens/{id}/files/{path}
Request
- Base URLhttps://api.codepen.io
- Auth
- HTTP bearer
- or API key in header X-API-Key
Query parameters
waitinteger
Seconds to wait for the build (default 45, at most 75; 0 answers as soon as the files are saved). A wait in the JSON body takes precedence.
dry_runboolean
Build the proposed files without saving them: the head does not move and the answer's version has saved: false. A dry_run in the JSON body takes precedence.
Request body
Response
The Pen, the newest version the write produced with its files, and that version's build.
Example response
{
"build": {
"files": [
{
"name": "app.js",
"path": "/src/app.js"
}
]
},
"pen": {
"build": {
"files": [
{
"name": "app.js",
"path": "/src/app.js"
}
]
},
"saved_version": {
"build": {
"files": [
{
"name": "app.js",
"path": "/src/app.js"
}
]
},
"files": [
{
"name": "app.js",
"path": "/src/app.js"
}
]
}
},
"version": {
"build": {
"files": [
{
"name": "app.js",
"path": "/src/app.js"
}
]
},
"files": [
{
"name": "app.js",
"path": "/src/app.js"
}
]
}
}Changes
No recorded changes to this operation across all 1 revision of this API.