meta { name: Update Theme Policy type: http seq: 4 } put { url: {{appview_url}}/api/admin/theme-policy } body:json { { "availableThemes": [ { "uri": "at://did:plc:example/space.atbb.forum.theme/3lbllight1" }, { "uri": "at://did:plc:example/space.atbb.forum.theme/3lbldark11" } ], "defaultLightThemeUri": "at://did:plc:example/space.atbb.forum.theme/3lbllight1", "defaultDarkThemeUri": "at://did:plc:example/space.atbb.forum.theme/3lbldark11", "allowUserChoice": true } } assert { res.status: eq 200 res.body.uri: isDefined res.body.cid: isDefined } docs { Create or update the themePolicy singleton on the Forum DID's PDS. Uses upsert semantics: works whether or not a policy record exists yet. **Requires:** space.atbb.permission.manageThemes Body: - availableThemes (required): Non-empty array of { uri, cid? } theme references. cid is optional — if omitted, this is a live ref that always resolves to the current version of the theme record. Canonical atbb.space presets use live refs by default. Both defaultLightThemeUri and defaultDarkThemeUri must be present in this list. - defaultLightThemeUri (required): AT-URI of the default light-mode theme. Must be in availableThemes. - defaultDarkThemeUri (required): AT-URI of the default dark-mode theme. Must be in availableThemes. - allowUserChoice (optional, default true): Whether users can pick their own theme. Returns (200): { "uri": "at://did:plc:.../space.atbb.forum.themePolicy/self", "cid": "bafyrei..." } Error codes: - 400: Missing/empty availableThemes, missing defaultLightThemeUri/defaultDarkThemeUri, default URI not in availableThemes list, malformed JSON - 401: Not authenticated - 403: Missing manageThemes permission - 500: ForumAgent not configured (server configuration issue) - 503: ForumAgent not authenticated or PDS network error }