CodePen API
API by Codepen · rest
The v2 REST API on api.codepen.io: JSON over HTTP with snake_case keys. CodePen also has a GraphQL API with the same operations at POST /v2/graphql. Both run the same logic and take the same keys, so use whichever suits your client. See the [GraphQL API docs](https://blog.codepen.io/docs/api/api-v2/graphql-api-v2/). Every request carries an API key, as Authorization: Bearer cp_user_... or X-API-Key: cp_user_.... A key belongs to a User (cp_user_) or a Team (cp_team_), and everything it lists, reads, creates or changes belongs to that key owner. Another User's or Team's Pen or Collection is not found, even when it is public. Conventions: - Enum values are accepted in any case in requests; responses use the PascalCase spelling shown here. - Timestamps are RFC 3339 in UTC. Ids are the ids in CodePen URLs. - Write endpoints take a JSON body, or multipart/form-data when they upload files. Unknown keys are ignored. A JSON body is capped at 16 MB, a multipart…
Endpoint: https://api.codepen.io/
Verification: observed. Source: crawl.
Capabilities (45)
- List Assets
- Add an Asset
- Get an Asset
- Rename or replace an Asset
- Delete an Asset
- Get a build
- List Collections
- Create a Collection
- Get a Collection
- Update a Collection
- Move a Collection to the trash
- List a Collection's Pens
- Add a Pen to a Collection
- Remove a Pen from a Collection
- Take a Collection out of the trash
- List Pens
- Create a Pen
- Get a Pen
- Update a Pen
- Move a Pen to the trash
- List collaborators
- Invite a collaborator
- Change a collaborator's role
- Remove a collaborator
- Deploy a Pen