curl --request PATCH \
--url https://app.formbricks.com/api/v3/workspaces/{workspaceId}/custom-css \
--header 'Content-Type: application/json' \
--cookie next-auth.session-token= \
--data '
{
"customCss": {
"light": "[data-fb-part=\"button-primary\"] { border-radius: 999px; }",
"dark": "#fbjs[data-appearance=\"dark\"] { --acme-ink: #e6eef5; }"
}
}
'{
"data": {
"workspaceId": "clxx1234567890123456789012",
"customCss": {
"light": "[data-fb-part=\"button-primary\"] { border-radius: 999px; }",
"dark": null
},
"previous": null,
"status": "ok",
"canEdit": true,
"planAllowed": true
},
"warnings": []
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}{
"title": "Unprocessable Content",
"status": 422,
"detail": "Custom CSS failed validation",
"code": "unprocessable_content",
"requestId": "req_01j9zq7w3k2m4n5p6r7s8t9v0w",
"invalid_params": [
{
"name": "customCss.light",
"reason": "Unexpected end of input (line 3, column 1)"
}
],
"details": {
"errors": [
{
"code": "syntax_error",
"scope": "workspace",
"appearance": "light",
"line": 3,
"column": 1,
"reason": "Unexpected end of input"
}
]
}
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}Save or clear workspace custom CSS
Saves or clears the workspace’s shared survey CSS. customCss replaces both fields; null clears all of it. The source is processed by the same processor every save path uses: constructs it removes come back as top-level warnings, and CSS it rejects is a 422 that leaves the saved CSS in effect. The replaced value becomes previous, the one recoverable revision — restore it by sending its source back. Unchanged source writes nothing.
Workspace CSS reaches every survey in the workspace, so writing it is narrower than writing a survey: organization owners and managers for signed-in users (session or OAuth), and a manage grant on this workspace for API keys — a Read & write grant is refused with 403. On Formbricks Cloud, adding or editing needs the Scale plan (403 custom_css_plan_required); clearing never does. Successful changes refresh the cached configuration the SDKs receive (they pick it up on their next configuration fetch). Saves that add or edit CSS count against a custom CSS budget of 60 per minute per user or API key, shared with custom CSS validation and with survey writes that add or edit custom CSS; beyond it they return 429. Re-saving the same CSS and clearing it are never counted.
curl --request PATCH \
--url https://app.formbricks.com/api/v3/workspaces/{workspaceId}/custom-css \
--header 'Content-Type: application/json' \
--cookie next-auth.session-token= \
--data '
{
"customCss": {
"light": "[data-fb-part=\"button-primary\"] { border-radius: 999px; }",
"dark": "#fbjs[data-appearance=\"dark\"] { --acme-ink: #e6eef5; }"
}
}
'{
"data": {
"workspaceId": "clxx1234567890123456789012",
"customCss": {
"light": "[data-fb-part=\"button-primary\"] { border-radius: 999px; }",
"dark": null
},
"previous": null,
"status": "ok",
"canEdit": true,
"planAllowed": true
},
"warnings": []
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}{
"title": "Unprocessable Content",
"status": 422,
"detail": "Custom CSS failed validation",
"code": "unprocessable_content",
"requestId": "req_01j9zq7w3k2m4n5p6r7s8t9v0w",
"invalid_params": [
{
"name": "customCss.light",
"reason": "Unexpected end of input (line 3, column 1)"
}
],
"details": {
"errors": [
{
"code": "syntax_error",
"scope": "workspace",
"appearance": "light",
"line": 3,
"column": 1,
"reason": "Unexpected end of input"
}
]
}
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"requestId": "<string>",
"type": "<string>",
"instance": "<string>",
"code": "ai_features_not_enabled",
"details": {},
"invalid_params": [
{
"name": "<string>",
"reason": "<string>",
"code": "dangling_reference",
"identifier": "<string>",
"referenceType": "block",
"missingId": "<string>",
"firstUsedAt": "<string>",
"conflictsWith": "<string>"
}
]
}Authorizations
NextAuth session JWT cookie. Development: often next-auth.session-token.
Production (HTTPS): often __Secure-next-auth.session-token. Send the cookie your browser receives after sign-in.
Path Parameters
Workspace identifier.
Body
Replaces both fields. null clears all workspace CSS. Adding or editing CSS needs the Scale plan on Formbricks Cloud; clearing either field or all CSS never does.
Show child attributes
Show child attributes
Response
Workspace custom CSS saved (or unchanged)
A workspace's shared survey CSS (ENG-3641): editable source for authorized readers, never compiled output. It applies to every survey in the workspace, beneath each survey's own CSS.
Show child attributes
Show child attributes
Processing warnings for this write: constructs the processor removed. Additive, returned beside data (never inside it, so data can be sent back unchanged); present only when the write processed custom CSS.
50Show child attributes
Show child attributes
Was this page helpful?