> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.datagol.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload File to Folder

> ## 1️⃣ Overview

**Purpose:**  
Uploads one or more files into a specific folder within a workspace.

Supports any file type. The target folder is specified via `parentId`.

---

## 2️⃣ Endpoint

``` bash
POST /noCo/api/v2/workspaces/{workspaceId}/folder/upload

 ```

---

## 3️⃣ Path Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| workspaceId | string | ✅ Yes | The ID of the workspace to upload the file into |

---

## 4️⃣ Authentication

Requires authentication using:

``` bash
Authorization: Bearer <token>

 ```

---

## 5️⃣ Request Headers

| Header | Required |
| --- | --- |
| Authorization | ✅ Yes |

---

## 6️⃣ Request Body (multipart/form-data)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| files | file | ✅ Yes | The file(s) to upload |
| parentId | string | ❌ No | ID of the target folder. If omitted, the file is uploaded to the workspace root |

---

## 7️⃣ Example Request

``` bash
curl --location 'https://be.datagol.ai/noCo/api/v2/workspaces/{workspaceId}/folder/upload' \
--header 'Authorization: Bearer <token>' \
--form 'files=@"/path/to/file"' \
--form 'parentId="{folderId}"'

 ```

---

## 8️⃣ Behavior Summary

``` id="behfu1"
Uploads one or more files into the specified folder within a workspace.
Returns an array of uploaded file objects, each containing the file id, name, type, size, and location metadata.
If parentId is omitted, the file is placed at the workspace root level.

 ```



## OpenAPI

````yaml /openapi/openapi.yaml post /noCo/api/v2/workspaces/{workspaceId}/folder/upload
openapi: 3.0.0
info:
  title: DataGOL APIs
  version: 1.0.0
  description: ''
servers:
  - url: https://be.datagol.ai
  - url: https://be.datagol.ai
  - url: https://kg.datagol.ai
  - url: https://ai.datagol.ai
security: []
tags:
  - name: Links & Joins
    description: >
      ## 🔗 Links & Joins


      LINK and LOOKUP are special workbook column types that enable relational
      data modeling across tables.


      | Column Type | Purpose |

      |---|---|

      | `LINK` | Defines a relationship between two tables |

      | `LOOKUP` | Projects columns from an associated table via a link |


      Both are configured through `ColumnDTO.colOptions`. A table can have
      multiple link columns, and each link can have multiple lookup columns.


      ---


      ## 📐 UI Data Types


      - **LINK** — Special column used to represent inter-table relations

      - **LOOKUP** — Special column used to project associated table fields via
      a link


      ---


      ## 🔗 LINK Semantics


      A LINK column stores metadata for:

      - `tableId` — Current table

      - `associatedTableId` — Associated (linked) table

      - `relationType` — Type of relationship

      - `linkColumnId` — Link column identifier


      **Supported relation patterns:**


      | Pattern | Description |

      |---|---|

      | `ONE_TO_ONE` | Each record in the source maps to one record in the
      destination |

      | `ONE_TO_MANY` | One source record maps to many destination records |

      | `MANY_TO_MANY` | Many source records map to many destination records |


      ---


      ## 🔍 LOOKUP Semantics


      - A LOOKUP column is tightly coupled with a specific LINK column

      - References a link using `linkColumnId`

      - Represents a selected column from the associated table

      - Multiple lookup columns can be defined for the same link


      ---


      ## 🗂️ Metadata in `ColumnDTO.colOptions`


      Use `colOptions` to persist link/lookup metadata.


      | Field | Description |

      |---|---|

      | `columnId` | Current column ID |

      | `tableId` | Current table ID |

      | `associatedTableId` | Associated table ID |

      | `linkColumnId` | Link column ID — used by LOOKUP; references the LINK
      column's `columnId` |

      | `relationType` | Relation semantics for LINK |


      ---


      ## 🔄 Manual Linking Record Flow


      To create manual record-level links:


      1. Fetch associated table schema/data

      2. User selects associated record(s) to link

      3. Send linking payload with:
          - `sourceRecordId` — PK of the current table row
          - `destinationRecordId` — PK of the associated table row
          - `linkColumnId` — LINK column identifier
      4. Backend resolves link metadata from `linkColumnId` (relation type,
      associated table, direction/constraints)

      5. Backend applies relation rules and stores the link relation


      ---


      ## 📋 Record Linking Contract


      | Field | Description |

      |---|---|

      | `sourceRecordId` | PK of the current table row |

      | `destinationRecordId` | PK of the associated table row |

      | `linkColumnId` | LINK column identifier |

      | `tableId` | Current table ID |


      > Backend derives all remaining relation metadata from the link
      configuration.


      ---


      ## ⚠️ Important Notes


      > - LINK and LOOKUP are **column-level constructs** first; record linking
      is a data-level operation built on top

      > - LOOKUP behavior depends on LINK existence and metadata integrity

      > - With multiple links to the same associated table, each LOOKUP must
      bind to the correct `linkColumnId`

      > - Always treat the associated row ID as the associated table PK for
      linking UI selection
paths:
  /noCo/api/v2/workspaces/{workspaceId}/folder/upload:
    parameters:
      - name: workspaceId
        in: path
        required: true
        schema:
          type: string
        example: '{{workspaceId}}'
    post:
      tags:
        - Enterprise Search
      summary: Upload File to Folder
      description: >-
        ## 1️⃣ Overview


        **Purpose:**  

        Uploads one or more files into a specific folder within a workspace.


        Supports any file type. The target folder is specified via `parentId`.


        ---


        ## 2️⃣ Endpoint


        ``` bash

        POST /noCo/api/v2/workspaces/{workspaceId}/folder/upload

         ```

        ---


        ## 3️⃣ Path Parameters


        | Parameter | Type | Required | Description |

        | --- | --- | --- | --- |

        | workspaceId | string | ✅ Yes | The ID of the workspace to upload the
        file into |


        ---


        ## 4️⃣ Authentication


        Requires authentication using:


        ``` bash

        Authorization: Bearer <token>

         ```

        ---


        ## 5️⃣ Request Headers


        | Header | Required |

        | --- | --- |

        | Authorization | ✅ Yes |


        ---


        ## 6️⃣ Request Body (multipart/form-data)


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | files | file | ✅ Yes | The file(s) to upload |

        | parentId | string | ❌ No | ID of the target folder. If omitted, the
        file is uploaded to the workspace root |


        ---


        ## 7️⃣ Example Request


        ``` bash

        curl --location
        'https://be.datagol.ai/noCo/api/v2/workspaces/{workspaceId}/folder/upload'
        \

        --header 'Authorization: Bearer <token>' \

        --form 'files=@"/path/to/file"' \

        --form 'parentId="{folderId}"'

         ```

        ---


        ## 8️⃣ Behavior Summary


        ``` id="behfu1"

        Uploads one or more files into the specified folder within a workspace.

        Returns an array of uploaded file objects, each containing the file id,
        name, type, size, and location metadata.

        If parentId is omitted, the file is placed at the workspace root level.

         ```
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - files
              properties:
                files:
                  type: string
                  format: binary
                  description: The file(s) to upload
                parentId:
                  type: string
                  description: >-
                    ID of the folder to upload the file into. If omitted, the
                    file is uploaded to the workspace root
                  example: 7b0b1bda-9836-420e-9a0b-6bf3b6bb6e5a
      responses:
        '200':
          description: Upload File to Folder
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Unique identifier of the uploaded file
                      example: dcc00239-8190-4f7e-a2fc-a87448cd121d
                    name:
                      type: string
                      description: Original filename of the uploaded file
                      example: order_history.csv
                    parentId:
                      type: string
                      description: ID of the folder the file was uploaded into
                      example: 7b0b1bda-9836-420e-9a0b-6bf3b6bb6e5a
                    type:
                      type: string
                      description: File extension / format type
                      example: csv
                    byteSize:
                      type: integer
                      description: Size of the uploaded file in bytes
                      example: 4879
                    isFolder:
                      type: boolean
                      description: Always false for uploaded files
                      example: false
                    workspaceId:
                      type: string
                      description: ID of the workspace the file belongs to
                      example: a00140c3-a621-4bd4-a300-00b9ddb1ed26
                    companyId:
                      type: integer
                      description: ID of the company that owns this file
                      example: 1
                    children:
                      type: array
                      items: {}
                      description: Always empty for files
                      example: []
                    uiMetadata:
                      type: object
                      description: Additional UI-level metadata associated with the file
                      example: {}
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        This API uses OAuth 2.0 with the authorization code grant flow.

````