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

# Re-index Workspace Files

> ## 1️⃣ Overview

**Purpose:**  
Triggers a search index job for all files in the specified workspace.

Supports two modes controlled by the `full_reindex` flag:

- **Full Re-index** — indexes all documents present in the workspace from scratch.
- **Incremental Index** — processes only new or changed documents since the last index run.

---

## 2️⃣ Endpoint

``` bash
POST /ai/api/v2/enterprise-search/connector/dg-s3-workspace/re-index?workspace_id={workspace_id}&full_reindex={true|false}

 ```

---

## 3️⃣ Query Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| workspace_id | string | ✅ Yes | The ID of the workspace whose files are to be indexed |
| full_reindex | boolean | ❌ No | `true` for full re-index of all documents; `false` for incremental index of new or changed documents only (default: false) |

---

## 4️⃣ Authentication

Requires authentication using:

``` bash
Authorization: Bearer <token>

 ```

---

## 5️⃣ Request Headers

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

---

## 6️⃣ Example Request

### Full Re-index

``` bash
curl --location 'https://ai.datagol.ai/ai/api/v2/enterprise-search/connector/dg-s3-workspace/re-index?workspace_id={workspaceId}&full_reindex=true' \
--header 'Authorization: Bearer <token>' \
--data-raw '{}'

 ```

### Incremental Index

``` bash
curl --location 'https://ai.datagol.ai/ai/api/v2/enterprise-search/connector/dg-s3-workspace/re-index?workspace_id={workspaceId}&full_reindex=false' \
--header 'Authorization: Bearer <token>' \
--data-raw '{}'

 ```

---

## 7️⃣ Behavior Summary

``` id="behes1"
Triggers a search indexing job for the specified workspace.
full_reindex=true: Re-indexes all documents in the workspace from scratch.
full_reindex=false: Performs an incremental index, processing only new or changed documents since the last run.

 ```



## OpenAPI

````yaml /openapi/openapi.yaml post /ai/api/v2/enterprise-search/connector/dg-s3-workspace/re-index
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:
  /ai/api/v2/enterprise-search/connector/dg-s3-workspace/re-index:
    post:
      tags:
        - Enterprise Search
      summary: Re-index Workspace Files
      description: >-
        ## 1️⃣ Overview


        **Purpose:**  

        Triggers a search index job for all files in the specified workspace.


        Supports two modes controlled by the `full_reindex` flag:


        - **Full Re-index** — indexes all documents present in the workspace
        from scratch.

        - **Incremental Index** — processes only new or changed documents since
        the last index run.


        ---


        ## 2️⃣ Endpoint


        ``` bash

        POST
        /ai/api/v2/enterprise-search/connector/dg-s3-workspace/re-index?workspace_id={workspace_id}&full_reindex={true|false}

         ```

        ---


        ## 3️⃣ Query Parameters


        | Parameter | Type | Required | Description |

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

        | workspace_id | string | ✅ Yes | The ID of the workspace whose files
        are to be indexed |

        | full_reindex | boolean | ❌ No | `true` for full re-index of all
        documents; `false` for incremental index of new or changed documents
        only (default: false) |


        ---


        ## 4️⃣ Authentication


        Requires authentication using:


        ``` bash

        Authorization: Bearer <token>

         ```

        ---


        ## 5️⃣ Request Headers


        | Header | Required |

        | --- | --- |

        | Authorization | ✅ Yes |


        ---


        ## 6️⃣ Example Request


        ### Full Re-index


        ``` bash

        curl --location
        'https://ai.datagol.ai/ai/api/v2/enterprise-search/connector/dg-s3-workspace/re-index?workspace_id={workspaceId}&full_reindex=true'
        \

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

        --data-raw '{}'

         ```

        ### Incremental Index


        ``` bash

        curl --location
        'https://ai.datagol.ai/ai/api/v2/enterprise-search/connector/dg-s3-workspace/re-index?workspace_id={workspaceId}&full_reindex=false'
        \

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

        --data-raw '{}'

         ```

        ---


        ## 7️⃣ Behavior Summary


        ``` id="behes1"

        Triggers a search indexing job for the specified workspace.

        full_reindex=true: Re-indexes all documents in the workspace from
        scratch.

        full_reindex=false: Performs an incremental index, processing only new
        or changed documents since the last run.

         ```
      parameters:
        - name: workspace_id
          in: query
          required: true
          schema:
            type: string
          description: The ID of the workspace whose files are to be indexed
          example: '{{workspaceId}}'
        - name: full_reindex
          in: query
          required: false
          schema:
            type: boolean
          description: >
            Controls the indexing mode. `true` \u2014 performs a full re-index
            of all documents in the workspace. `false` \u2014 performs an
            incremental index, processing only new or changed documents since
            the last index run.
          example: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
            example: {}
      responses:
        '200':
          description: Re-index Workspace Files
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        This API uses OAuth 2.0 with the authorization code grant flow.

````