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

# Trigger Extraction

> ## 1️⃣ Overview

**Purpose:**  
Triggers an extraction run for a specified extraction configuration and element.

Supports extraction modes for:

- New records only
    
- Selected rows
    
- Filter-based extraction
    
- Full dataset extraction
    

---

## 2️⃣ Endpoint

``` bash
POST /noCo/api/v2/workspaces/{workspaceId}/extraction/{extractionId}/{elementType}/{elementId}/run?extractOnlyNew=true

 ```

---

## 3️⃣ Path Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| workspaceId | UUID | ✅ Yes | Workspace identifier |
| extractionId | string | ✅ Yes | Extraction configuration ID |
| elementType | string | ✅ Yes | COLUMN / FILE / FOLDER |
| elementId | string | ✅ Yes | Element identifier |

---

## 4️⃣ Query Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| extractOnlyNew | boolean | ❌ No | Default false |

Behavior:

- `true` → Only new records are extracted
    
- `false` → Selected records are upserted (update existing + insert new)
    

---

## 5️⃣ Authentication

Requires authentication using:

``` bash
Authorization: Bearer <token>

 ```

---

## 6️⃣ Request Headers

| Header | Required |
| --- | --- |
| Authorization | ✅ Yes |
| Content-Type: application/json | Optional |

---

## 7️⃣ Request Body Schema (Optional)

``` json
{
  "rows": [],
  "whereClause": "string",
  "selectAll": true
}

 ```

---

## 8️⃣ Field Descriptions

### Extraction Execution Controls

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| rows | array | ❌ No | Specific rows to extract |
| whereClause | string | ❌ No | Filter condition |
| selectAll | boolean | ❌ No | Select all rows flag |

---

## 9️⃣ Example Request

### Trigger extraction for selected rows

``` bash
curl -X POST "https://be.datagol.ai/noCo/api/v2/workspaces/{workspaceId}/extraction/{extractionId}/{elementType}/{elementId}/run?extractOnlyNew=true" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
  "selectAll": false,
  "rows": [
    {
      "id": "row1",
      "name": "Sample Data"
    }
  ]
}'

 ```

---

## 🔟 Behavior Summary

```
Triggers an extraction execution job for the specified configuration.
Supports:
• Incremental Extraction — When extractOnlyNew=true, only new records are processed.
• Upsert Extraction — When extractOnlyNew=false, existing records are updated and new records are inserted.
• Selective Extraction — Allows extraction of specific rows using the rows field.
• Filtered Extraction — Supports conditional extraction using whereClause.
• Full Extraction — When selectAll=true, extracts all matching records (rows field should be omitted).

 ```

---

## 📌 Additional Description

When `selectAll` is true, the system extracts all matching records.  
If `selectAll` is false, the client must provide the complete row data in the `rows` field.

The request supports two major extraction strategies:

- **Incremental Extraction:** Controlled by `extractOnlyNew=true`
    
- **Upsert Extraction:** When `extractOnlyNew=false`, existing records are updated and new records are inserted.



## OpenAPI

````yaml /openapi/openapi.yaml post /noCo/api/v2/workspaces/{workspace_id}/extraction/{extraction_id}/{element_type}/{element_id}/run
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/{workspace_id}/extraction/{extraction_id}/{element_type}/{element_id}/run:
    parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
        example: '{{workspace_id}}'
      - name: extraction_id
        in: path
        required: true
        schema:
          type: string
        example: '{{extraction_id}}'
      - name: element_type
        in: path
        required: true
        schema:
          type: string
        example: '{{element_type}}'
      - name: element_id
        in: path
        required: true
        schema:
          type: string
        example: '{{element_id}}'
    post:
      tags:
        - AI Extraction
      summary: Trigger Extraction
      description: >-
        ## 1️⃣ Overview


        **Purpose:**  

        Triggers an extraction run for a specified extraction configuration and
        element.


        Supports extraction modes for:


        - New records only
            
        - Selected rows
            
        - Filter-based extraction
            
        - Full dataset extraction
            

        ---


        ## 2️⃣ Endpoint


        ``` bash

        POST
        /noCo/api/v2/workspaces/{workspaceId}/extraction/{extractionId}/{elementType}/{elementId}/run?extractOnlyNew=true

         ```

        ---


        ## 3️⃣ Path Parameters


        | Parameter | Type | Required | Description |

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

        | workspaceId | UUID | ✅ Yes | Workspace identifier |

        | extractionId | string | ✅ Yes | Extraction configuration ID |

        | elementType | string | ✅ Yes | COLUMN / FILE / FOLDER |

        | elementId | string | ✅ Yes | Element identifier |


        ---


        ## 4️⃣ Query Parameters


        | Parameter | Type | Required | Description |

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

        | extractOnlyNew | boolean | ❌ No | Default false |


        Behavior:


        - `true` → Only new records are extracted
            
        - `false` → Selected records are upserted (update existing + insert new)
            

        ---


        ## 5️⃣ Authentication


        Requires authentication using:


        ``` bash

        Authorization: Bearer <token>

         ```

        ---


        ## 6️⃣ Request Headers


        | Header | Required |

        | --- | --- |

        | Authorization | ✅ Yes |

        | Content-Type: application/json | Optional |


        ---


        ## 7️⃣ Request Body Schema (Optional)


        ``` json

        {
          "rows": [],
          "whereClause": "string",
          "selectAll": true
        }

         ```

        ---


        ## 8️⃣ Field Descriptions


        ### Extraction Execution Controls


        | Field | Type | Required | Description |

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

        | rows | array | ❌ No | Specific rows to extract |

        | whereClause | string | ❌ No | Filter condition |

        | selectAll | boolean | ❌ No | Select all rows flag |


        ---


        ## 9️⃣ Example Request


        ### Trigger extraction for selected rows


        ``` bash

        curl -X POST
        "https://be.datagol.ai/noCo/api/v2/workspaces/{workspaceId}/extraction/{extractionId}/{elementType}/{elementId}/run?extractOnlyNew=true"
        \

        -H "Authorization: Bearer <token>" \

        -H "Content-Type: application/json" \

        -d '{
          "selectAll": false,
          "rows": [
            {
              "id": "row1",
              "name": "Sample Data"
            }
          ]
        }'

         ```

        ---


        ## 🔟 Behavior Summary


        ```

        Triggers an extraction execution job for the specified configuration.

        Supports:

        • Incremental Extraction — When extractOnlyNew=true, only new records
        are processed.

        • Upsert Extraction — When extractOnlyNew=false, existing records are
        updated and new records are inserted.

        • Selective Extraction — Allows extraction of specific rows using the
        rows field.

        • Filtered Extraction — Supports conditional extraction using
        whereClause.

        • Full Extraction — When selectAll=true, extracts all matching records
        (rows field should be omitted).

         ```

        ---


        ## 📌 Additional Description


        When `selectAll` is true, the system extracts all matching records.  

        If `selectAll` is false, the client must provide the complete row data
        in the `rows` field.


        The request supports two major extraction strategies:


        - **Incremental Extraction:** Controlled by `extractOnlyNew=true`
            
        - **Upsert Extraction:** When `extractOnlyNew=false`, existing records
        are updated and new records are inserted.
      parameters:
        - name: extractOnlyNew
          in: query
          schema:
            type: boolean
          example: 'true'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                rows:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                      cellValues:
                        type: object
                        properties:
                          workspace_id:
                            type: string
                          noco_e0e0ea6e:
                            type: integer
                          web_url:
                            type: string
                            format: uri
                          meeting_id:
                            type: string
                          call_recording_id:
                            type: string
                          id:
                            type: string
                          raw_transcript:
                            type: string
                      cellValuesByColumnId:
                        type: object
                whereClause:
                  type: string
                selectAll:
                  type: boolean
            example:
              rows:
                - id: 0
                  cellValues:
                    workspace_id: 35bb2bfb-5b7b-451c-9be4-6de7b5ed307e
                    noco_e0e0ea6e: 0
                    web_url: https://app.datagol.ai/
                    meeting_id: 24124
                    call_recording_id: 21512512
                    id: >-
                      {"meeting_id":"325325","workspace_id":"214215","call_recording_id":"21515124"}
                    raw_transcript: >-
                      Iris: Hello. Alex: Hi. Iris: We’re exploring software you
                      can summon
                  cellValuesByColumnId: {}
              whereClause: 1 = 1
              selectAll: false
      responses:
        '200':
          description: Trigger Extraction
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        This API uses OAuth 2.0 with the authorization code grant flow.

````