CSS
CSS endpoints retrieve or replace a project's custom Play Mode stylesheet.
Use the Play Mode styling reference for DOM structure, selectors, layout defaults, and working CSS examples. The Style Editor and MCP CSS tools use the same project stylesheet.
Endpoints
Get custom CSS # GET/api/v1/{hash}/css
/api/v1/{hash}/cssRequest
GET /api/v1/{hash}/csscurl --request GET \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Accept: application/json" \
"https://arcweave.com/api/v1/PROJECT_HASH/css"Response
Returns 200 OK.
This endpoint returns only the custom CSS saved for the project. It does not include Arcweave's built-in Play Mode stylesheet. If no custom CSS has been set, css is an empty string:
{
"css": ""
}Update custom CSS # PATCH/api/v1/{hash}/css
/api/v1/{hash}/cssRequest
PATCH /api/v1/{hash}/csscurl --request PATCH \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data @payload.json \
"https://arcweave.com/api/v1/PROJECT_HASH/css"This endpoint replaces the project's complete custom CSS string. It does not parse the stylesheet or add, modify, or remove individual CSS rules.
To change a single rule, first retrieve the current stylesheet with GET /api/v1/{hash}/css, modify it in your integration, and send the full updated stylesheet in the PATCH request.
{
"css": ".prototype__text .editor .editor-content { color: #e2e8f0; }"
}Request fields:
| Property | Required | Type | Description |
|---|---|---|---|
css | Yes | String | Complete replacement stylesheet. Use an empty string to clear it. |
css must be present and must be a string. An empty string is valid and clears the custom CSS. Unknown root fields are rejected.
This validates the payload shape, not CSS syntax or selectors. Surrounding whitespace may be trimmed. The text-color example above is a complete stylesheet for a project with no other custom rules; preserve existing rules when updating an already styled project.
Response
Returns 200 OK with the complete saved custom stylesheet:
{
"css": ".prototype__text .editor .editor-content { color: #e2e8f0; }"
}Read, update, and verify
GET /api/v1/{hash}/cssand keep the originalcssstring for rollback.- Modify that string, then re-read the saved CSS just before updating. If it changed, reapply your edits to the latest value.
PATCH /api/v1/{hash}/csswith the complete updated value. The update replaces all custom rules. GET /api/v1/{hash}/cssagain to confirm the stored value.- Reload an already-open Play Mode tab, or click Play in the editor to open a new tab with fresh settings. Restarting the story or returning through same-tab navigation does not fetch fresh settings. These writes do not broadcast live CSS changes.
- Follow Save and verify styles to check layout and navigation. Read-back verifies persistence; it does not prove the CSS renders correctly.
Saves have no conflict detection: the latest save replaces the stylesheet. Coordinate simultaneous API and manual edits. Retain unsaved local edits before reloading an old Style Editor tab, then reapply them to the fresh CSS before saving there.
CSS writes do not create project command-history entries. To restore the previous styling, send the retained original string in another PATCH, then reload. Sending {"css":""} restores built-in styling by clearing all custom CSS.
Common errors
| Status | Meaning |
|---|---|
400 | Invalid payload shape or field type, not a CSS syntax check. |
403 | Project access or permission denied. |
404 | Project not found. |