application/json

Body Required

  • name string Required

    Maximum length is 128.

  • file_url string Required

    Maximum length is 2048.

  • accent_color string

    Maximum length is 32. Default value is rgba(58, 58, 58, 0.9).

  • text_color string

    Maximum length is 32. Default value is #d6d6d6.

  • active boolean

    Default value is true.

Responses

  • 201 application/json

    Successful Response

    Hide response attributes Show response attributes object
    • theme_id integer Required
    • name string Required
    • file_url string Required
    • accent_color string Required
    • text_color string Required
    • active boolean Required
    • authors array[object] | array Required

      Any of:
      Hide attributes Show attributes object
      • author_id integer Required
      • user_id integer Required
      • username string Required
      • created_at integer Required
    • created_at integer Required
  • 503 application/json

    Database connection error

    Hide response attribute Show response attribute object
    • detail string

      Default value is Can't connect to MySQL server on '[SERVER]'.

  • 422 application/json

    Validation Error

    Hide response attribute Show response attribute object
    • detail array[object]
      Hide detail attributes Show detail attributes object
      • loc array[string | integer] Required
      • msg string Required
      • type string Required
POST /api/themes
curl \
 -X POST https://lztup.toil.cc/api/themes \
 -H "Content-Type: application/json" \
 -d '{"name":"string","file_url":"string","accent_color":"rgba(58, 58, 58, 0.9)","text_color":"#d6d6d6","active":true}'
Request example
{
  "name": "string",
  "file_url": "string",
  "accent_color": "rgba(58, 58, 58, 0.9)",
  "text_color": "#d6d6d6",
  "active": true
}
Request examples
{
  "name": "string",
  "file_url": "string",
  "accent_color": "rgba(58, 58, 58, 0.9)",
  "text_color": "#d6d6d6",
  "active": true
}
Response examples (201)
{
  "theme_id": 42,
  "name": "string",
  "file_url": "string",
  "accent_color": "string",
  "text_color": "string",
  "active": true,
  "authors": [
    {
      "author_id": 42,
      "user_id": 42,
      "username": "string",
      "created_at": 42
    }
  ],
  "created_at": 42
}
Response examples (503)
{
  "detail": "Can't connect to MySQL server on '[SERVER]'"
}
Response examples (422)
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}