Assets

Add an Asset

A multipart file part (and filename, default the part's own filename), or JSON filename and text content. Assets need a PRO plan; new content counts against the plan's per-file size and total storage.

post/v2/assets

Request

  • Base URL
    https://api.codepen.io
  • Auth
    • HTTP bearer
    • or API key in header X-API-Key

Request body

contentstring

Text Assets only; send binary files as a multipart file part.

filenamestring

At most 191 bytes, unique among the owner's Assets, without / or \.

Response

The new Asset.

created_atstring date-time required
filenamestring required
idstring required
is_binaryboolean required

Text Assets are those with a text extension: SVG, HTML/HAML/Pug/Slim/Markdown, CSS/Sass/SCSS/Less/Stylus, JS/JSX/TS/TSX/CoffeeScript/JSON/source maps, Vue, GLSL and plain text. Everything else is binary.

updated_atstring date-time required
urlstring uri required

Changes

No recorded changes to this operation across all 1 revision of this API.