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

# Create components

> Creates one or more library components in your workspace. The operation is all-or-nothing: if any component is invalid, none are created. Each component can optionally specify a developer ID and folder, as well as plural forms, variant text, and variable placeholders.



## OpenAPI

````yaml openapi.json post /components
openapi: 3.0.0
info:
  version: 1.0.0
  title: Ditto API
  description: Programmatically read and write data in your Ditto workspace.
servers:
  - url: https://api.dittowords.com/v2
security: []
paths:
  /components:
    post:
      tags:
        - Components
      summary: Create components
      description: >-
        Creates one or more library components in your workspace. The operation
        is all-or-nothing: if any component is invalid, none are created. Each
        component can optionally specify a developer ID and folder, as well as
        plural forms, variant text, and variable placeholders.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                components:
                  type: array
                  items:
                    type: object
                    properties:
                      developerId:
                        type: string
                        description: >-
                          Optional preconfigured developer ID for the component.
                          Must be unique within the workspace. If omitted,
                          system will generate one automatically.
                      text:
                        type: string
                        description: The component's text value
                      notes:
                        type: string
                        nullable: true
                        description: >-
                          Optional notes for the component. Use null or omit to
                          leave notes empty.
                      tags:
                        type: array
                        items:
                          type: string
                        description: >-
                          Optional list of tags to assign to the component. Omit
                          or pass an empty array for no tags.
                      status:
                        type: string
                        minLength: 1
                        description: >-
                          Optional status for the component (for example:
                          'NONE', 'WIP', 'REVIEW', 'FINAL'). Cannot be empty
                          string. If omitted, defaults to 'NONE'.
                      assignee:
                        type: string
                        format: email
                        description: >-
                          Optional email of the workspace user to assign to this
                          component.
                      characterLimit:
                        type: number
                        nullable: true
                        minimum: 1
                        description: >-
                          Optional character limit for the component text. Use
                          null or omit to indicate no limit.
                      integrated:
                        type: boolean
                        description: >-
                          Mark the component as integrated into development. If
                          omitted, defaults to false.
                      variables:
                        type: array
                        items:
                          type: string
                        description: >-
                          Developer IDs of variables (the `id` field from GET
                          /v2/variables) used in this component's text, plurals,
                          or variants. Text fields support `{{variable_name}}`
                          placeholders that will be resolved using the variables
                          listed here. Placeholders whose names are not in this
                          list are kept as literal text.
                      plurals:
                        type: array
                        items:
                          type: object
                          properties:
                            form:
                              type: string
                              enum:
                                - one
                                - two
                                - few
                                - many
                                - zero
                                - other
                              description: The plural form
                            text:
                              type: string
                              description: The text for this plural form
                          required:
                            - form
                            - text
                        description: >-
                          Optional plural forms for the component. The first
                          plural form's text must match the component's display
                          text. Each form may only appear once.
                      variants:
                        type: array
                        items:
                          type: object
                          properties:
                            variantId:
                              type: string
                              description: Developer ID of the variant
                            text:
                              type: string
                              description: The text for this variant
                            status:
                              type: string
                              minLength: 1
                              description: >-
                                Optional status for the component variant (for
                                example: 'NONE', 'WIP', 'REVIEW', 'FINAL').
                                Cannot be empty string. If omitted, defaults to
                                'NONE'.
                            assignee:
                              type: string
                              format: email
                              description: >-
                                Optional email of the user to assign to this
                                component variant.
                            characterLimit:
                              type: number
                              nullable: true
                              minimum: 1
                              description: >-
                                Optional character limit for the component
                                variant text. Use null or omit to indicate no
                                limit.
                            notes:
                              type: string
                              nullable: true
                              description: >-
                                Optional notes for the component variant. Use
                                null or omit to leave notes empty.
                            plurals:
                              type: array
                              items:
                                type: object
                                properties:
                                  form:
                                    type: string
                                    enum:
                                      - one
                                      - two
                                      - few
                                      - many
                                      - zero
                                      - other
                                    description: The plural form
                                  text:
                                    type: string
                                    description: The text for this plural form
                                required:
                                  - form
                                  - text
                              description: Optional plural forms for this variant
                          required:
                            - variantId
                            - text
                        description: >-
                          Optional variant text values to set on the component
                          at creation time. Each variantId must correspond to an
                          existing variant in the workspace.
                      name:
                        type: string
                        description: The name of the component
                      folderId:
                        type: string
                        description: >-
                          The developer ID of the folder to add the component
                          to. If omitted, the component will be added to the
                          root folder.
                    required:
                      - text
                      - name
                  description: Array of components to create
              required:
                - components
              example:
                components:
                  - text: Hello world
                    name: Component One
                  - developerId: custom-id
                    text: Custom ID example
                    name: Custom Component
                    notes: For the homepage CTA
                    characterLimit: 80
                  - text: In folder
                    name: Folder Component
                    folderId: my-folder-id
                  - text: '{{count}} items in your cart'
                    name: Cart Count
                    variables:
                      - count
                    plurals:
                      - form: one
                        text: '{{count}} item in your cart'
                      - form: other
                        text: '{{count}} items in your cart'
                  - text: Hello world
                    name: Localized Component
                    variants:
                      - variantId: french
                        text: Bonjour le monde
      responses:
        '200':
          description: Returns the developer IDs of the created components
          content:
            application/json:
              schema:
                type: object
                properties:
                  developerIds:
                    type: array
                    items:
                      type: string
                    description: Array of developer IDs for the created components
                required:
                  - developerIds
                example:
                  developerIds:
                    - component-one
                    - custom-id
                    - folder-component
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````