# place.hud.createTheme

> Write a place.hud.theme record in the person's own repository, for anyone to choose. It is not chosen: setTheme does that. Requires auth: the workspace's web session (its cookie, with X-HUD: 1 and the server's own Origin on a procedure) or a HUD access token as Bearer.

- Kind: procedure
- Authority: hud.place
- Lexicon: 1
- Published by [lexicons.hud.place](https://lexicon.garden/identity/did:plc:3tzbz4pml36u4mkresb6pdhv), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.createTheme)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.createTheme/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.createTheme/analytics)

## Procedure (`place.hud.createTheme`)

Type: procedure · POST

### Input (application/json)

- `colorScheme` (string, required)
  - Constraints: maxLength: 16, knownValues: light | dark
- `name` (string, required): What the theme is called.
  - Constraints: maxLength: 640, maxGraphemes: 64
- `palette` (ref, required)
  - Reference: `place.hud.defs#palette`

### Output (application/json)

- `theme` (ref, required): The theme made, by its uri.
  - Reference: `place.hud.defs#theme`

### Errors

- `InvalidRequest`: A name that is blank; a palette whose texts do not all read at 4.5:1 (checkTheme names which); or the person's PDS refused the write.
- `AuthRequired`: No live web session or HUD access token: sign in.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Write a place.hud.theme record in the person's own repository, for anyone to choose. It is not chosen: setTheme does that. Requires auth: the workspace's web session (its cookie, with X-HUD: 1 and the server's own Origin on a procedure) or a HUD access token as Bearer.",
      "errors": [
        {
          "description": "A name that is blank; a palette whose texts do not all read at 4.5:1 (checkTheme names which); or the person's PDS refused the write.",
          "name": "InvalidRequest"
        },
        {
          "description": "No live web session or HUD access token: sign in.",
          "name": "AuthRequired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "colorScheme": {
              "knownValues": [
                "light",
                "dark"
              ],
              "maxLength": 16,
              "type": "string"
            },
            "name": {
              "description": "What the theme is called.",
              "maxGraphemes": 64,
              "maxLength": 640,
              "type": "string"
            },
            "palette": {
              "ref": "place.hud.defs#palette",
              "type": "ref"
            }
          },
          "required": [
            "name",
            "colorScheme",
            "palette"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "theme": {
              "description": "The theme made, by its uri.",
              "ref": "place.hud.defs#theme",
              "type": "ref"
            }
          },
          "required": [
            "theme"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Make a theme for the workspace.",
  "id": "place.hud.createTheme",
  "lexicon": 1
}
```
