> ## 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.

# Import components via a file

> For more information about importing components via a file please see: https://dittov3.notion.site/Importing-JSON-iOS-Android-Files-256cc8865c7a80fe94cdf135631bf8c6. The request body must be of type multipart/form-data.



## OpenAPI

````yaml openapi-legacy.json post /components/file
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/v1
security: []
paths:
  /components/file:
    post:
      tags:
        - Components
      summary: Import components via a file
      description: >-
        For more information about importing components via a file please see:
        https://dittov3.notion.site/Importing-JSON-iOS-Android-Files-256cc8865c7a80fe94cdf135631bf8c6.
        The request body must be of type multipart/form-data.
      parameters:
        - schema:
            type: string
            description: >-
              The API ID of the folder you want to import components into. If
              not specified, components will be imported into the root of your
              component library.
          required: false
          description: >-
            The API ID of the folder you want to import components into. If not
            specified, components will be imported into the root of your
            component library.
          name: folderId
          in: query
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                import:
                  type: string
                  description: >-
                    The absolute path to the file you want to import. Postman
                    and other tools support directly uploading files, but if
                    you're using cURL you'll need to use the `@` prefix, e.g.
                    `curl -F import=@/path/to/file.json`
      responses:
        '200':
          description: Returns how many components were inserted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  componentsInserted:
                    type: number
                  firstImportedId:
                    anyOf:
                      - type: string
                      - nullable: true
                required:
                  - componentsInserted
                  - firstImportedId
                example:
                  componentsInserted: 3
                  firstImportedId: 507f1f77bcf86cd799439011
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````