Pens
Create a Pen
Starter files when files is omitted; .codepen/pen.config.json is added when the caller does not supply one. The title defaults to "Untitled" and access to the key owner's default privacy. Anything but Public needs a PRO plan.
The answer is the Pen with the first version's build; wait in the body or the query bounds how long the request waits for it.
post/v2/pens
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.
Request body
Example request
{
"files": [
{
"path": "index.html"
}
]
}Response
The new Pen, with build.
Example response
{
"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"
}
]
}
}Changes
No recorded changes to this operation across all 1 revision of this API.