> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.neetoform.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a theme

> Create a workspace theme as a copy of a base theme, then apply the given name and properties. Only the properties listed in the request body can be set. To set a background image, upload it first and pass its `signed_id` as `background_image`. See [Upload a theme background image](/api/themes/background-image).

> [!NOTE]
>
> Replace `{your-subdomain}` with your workspace’s subdomain. \
> Learn how to find your subdomain in [Workspace subdomain](https://apidocs.neetoform.com/api/workspace-subdomain.md).


## OpenAPI

````yaml bundled/themes.yaml POST /themes
openapi: 3.0.3
info:
  title: NeetoForm Themes APIs
  version: 2.0.0
servers:
  - description: NeetoForm APIs
    url: https://{your-subdomain}.neetoform.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
tags:
  - name: Themes
    description: APIs to manage themes and apply them to forms.
paths:
  /themes:
    post:
      tags:
        - Themes
      summary: Create a theme
      description: >-
        Create a workspace theme as a copy of a base theme, then apply the given
        name and properties. Only the properties listed in the request body can
        be set. To set a background image, upload it first and pass its
        `signed_id` as `background_image`. See [Upload a theme background
        image](/api/themes/background-image).
      parameters:
        - $ref: '#/components/parameters/api_key_header'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                theme:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Name of the new theme.
                      example: Brand
                    base_theme_id:
                      type: string
                      description: >-
                        ID of the theme to copy. It can be a system theme or a
                        workspace theme. The default theme is used when omitted.
                      example: 3b0d5c1e-2f7a-4c4e-9d1b-6a8f2e7c9b10
                    properties:
                      $ref: '#/components/schemas/theme_properties_param'
                    background_image:
                      $ref: '#/components/schemas/theme_background_image_param'
                  required:
                    - name
              required:
                - theme
      responses:
        '201':
          description: Created - Theme created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/theme_response'
        '400':
          description: Bad Request - The `theme` parameter is missing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: 'param is missing or the value is empty: theme'
        '404':
          description: Not Found - The base theme does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: NeetoThemesEngine::Theme does not exist.
        '422':
          description: >-
            Unprocessable Entity - A property cannot be set through the API, a
            property value is invalid, `custom_css` is sent from a workspace
            that is not on the Pro plan, or `background_image` is not an
            uploaded image of this workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              examples:
                non_editable_property:
                  summary: A property that cannot be set
                  value:
                    error: >-
                      These theme properties cannot be set here: fonts. Editable
                      properties: eui_font_family, question_color, answer_color,
                      answer_text_color, background_color, button_text_color,
                      button_background_color, button_border_radius,
                      welcome_text_alignment, questions_text_alignment,
                      thank_you_text_alignment, is_content_background_enabled,
                      content_background_color, background_image_position,
                      background, is_dominant_background_color_enabled,
                      dominant_color, custom_css.
                custom_css_requires_pro:
                  summary: Custom CSS on a workspace that is not on the Pro plan
                  value:
                    error: >-
                      Custom CSS needs the NeetoForm Pro plan, which this
                      workspace is not on. Leave custom_css out, or upgrade the
                      workspace to Pro and try again.
                image_not_in_workspace:
                  summary: A background image that is not an upload of this workspace
                  value:
                    error: >-
                      background_image must be the signed_id of an image
                      uploaded to this workspace.
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
        default: your-api-key
  schemas:
    theme_properties_param:
      type: object
      description: >-
        Theme properties to set, as key and value pairs. Only the keys listed
        here can be set. Any other key, or a color that is not a hex value,
        returns a 422 error.
      properties:
        eui_font_family:
          type: string
          description: CSS font-family stack used for all text.
          example: Inter, sans-serif
        question_color:
          type: string
          description: >-
            Color of question titles and descriptions, headings, welcome and
            thank-you text, and dividers, as a hex value.
          pattern: ^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$
          example: '#123456'
        background_color:
          type: string
          description: Page background color as a hex value.
          pattern: ^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$
          example: '#ffffff'
        button_text_color:
          type: string
          description: Text color on filled buttons, as a hex value.
          pattern: ^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$
          example: '#ffffff'
        button_background_color:
          type: string
          description: >-
            Fill color of buttons, and the text and border color of outlined
            buttons, as a hex value.
          pattern: ^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$
          example: '#1a2b3c'
        answer_color:
          type: string
          description: >-
            Color of every answer field, as a hex value. It styles the borders,
            typed text, placeholders and helper text of inputs and dropdowns,
            option borders and text, the fill of selected options, rating icons,
            scales, date pickers, and file upload and signature boxes. It must
            read well on `background_color`.
          pattern: ^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$
          example: '#3e5641'
        answer_text_color:
          type: string
          description: >-
            Color of the text and check marks drawn on an answer filled with
            `answer_color`, such as a selected option, scale value, dropdown
            item or date, as a hex value.
          pattern: ^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$
          example: '#ffffff'
        button_border_radius:
          type: string
          description: Button corner radius in pixels.
          example: '10'
        welcome_text_alignment:
          type: string
          enum:
            - left
            - center
            - right
        questions_text_alignment:
          type: string
          enum:
            - left
            - center
            - right
        thank_you_text_alignment:
          type: string
          enum:
            - left
            - center
            - right
        is_content_background_enabled:
          type: boolean
          description: >-
            Whether the questions sit on a card coloured with
            `content_background_color`.
          example: true
        content_background_color:
          type: string
          description: >-
            Color of the card behind the questions as a hex value. An alpha
            channel is allowed, such as `#ffffffcc`.
          pattern: ^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$
          example: '#ffffffcc'
        background_image_position:
          type: string
          description: Part of the background image kept in view.
          enum:
            - center
            - top left
            - top center
            - top right
            - center left
            - center right
            - bottom left
            - bottom right
            - bottom center
          example: top center
        background:
          type: integer
          minimum: -100
          maximum: 100
          description: >-
            Overlay on the background image. A value below 0 darkens the image
            with black, a value above 0 lightens it with white, and 0 leaves it
            unchanged.
          example: -30
        is_dominant_background_color_enabled:
          type: boolean
          description: >-
            Whether `background_color` follows `dominant_color`. When `true`,
            `dominant_color` is required in the request or already stored on the
            theme.
          example: true
        dominant_color:
          type: string
          description: >-
            Main color of the background image as a hex value. An alpha channel
            is allowed, such as `#336699cc`. It becomes `background_color` while
            `is_dominant_background_color_enabled` is `true`.
          pattern: ^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$
          example: '#3e5641'
        custom_css:
          type: string
          description: >
            CSS for forms that use the theme. It is added as a style tag inside
            the form's `.neeto-form-eui` wrapper. Rules are not scoped for you,
            so start each selector with `.neeto-form-eui`. Each element line of
            the [form outline](/api/forms/outline) ends with that element's own
            `[id]` selector to target. The value replaces the theme's current
            CSS. An empty string removes it. Only workspaces on the Pro plan can
            set it; other workspaces get a 422 error.
          example: >-
            .neeto-form-eui [id="3f9a6d17-2c84-4e5b-b1a3-7e0d8c4a9526"] {
            margin-bottom: 8px; }
    theme_background_image_param:
      type: string
      nullable: true
      description: >-
        `signed_id` of an uploaded image to show behind the form. Get it from
        the [Upload an image from a URL](/api/images/upload-from-url) or
        [Reserve an image upload](/api/images/reserve-upload) API. Send an empty
        string or `null` to remove the current image. The image must be a PNG,
        JPEG, GIF or SVG of 1 MB or smaller, uploaded in this workspace.
      example: eyJfcmFpbHMiOnsiZGF0YSI6MTIzfX0--abc123
    theme_response:
      type: object
      properties:
        theme:
          $ref: '#/components/schemas/theme'
    error_response:
      type: object
      properties:
        error:
          type: string
    theme:
      allOf:
        - $ref: '#/components/schemas/theme_summary'
        - type: object
          properties:
            properties:
              type: array
              items:
                $ref: '#/components/schemas/theme_property'
            has_background_image:
              type: boolean
              example: false
            background_image_url:
              type: string
              nullable: true
              description: >-
                CDN URL of the background image. `null` when the theme has no
                background image.
              example: https://cdn.neetoform.com/themes/banner.png
    theme_summary:
      type: object
      properties:
        id:
          type: string
          example: 3b0d5c1e-2f7a-4c4e-9d1b-6a8f2e7c9b10
        name:
          type: string
          example: Brand
        is_system_theme:
          type: boolean
          description: >-
            `true` for themes provided by NeetoForm. System themes cannot be
            changed or deleted.
          example: false
    theme_property:
      type: object
      properties:
        key:
          type: string
          example: background_color
        kind:
          type: string
          example: color
        value:
          type: string
          nullable: true
          example: '#ffffff'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.