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

# Get All Link Tables of Current Table

> ## 1️⃣ Overview

**Purpose:**
Retrieves all tables that are linked to a specified table within a workspace. Useful for discovering all relationships (link columns) associated with a table.

---

## 2️⃣ Endpoint

```
GET /noCo/api/v2/workspaces/{workspaceId}/tables/{tableId}/linkTables
```

---

## 3️⃣ Path Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| workspaceId | UUID | ✅ Yes | Workspace identifier |
| tableId | UUID | ✅ Yes | Table identifier to query linked tables for |

---

## 4️⃣ Authentication

Requires **Bearer JWT Token**

```
Authorization: Bearer <token>
```

---

## 5️⃣ Request Headers

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

---

## 6️⃣ Example Request

```bash
curl -X GET https://be.datagol.ai/noCo/api/v2/workspaces/{workspaceId}/tables/{tableId}/linkTables \
-H "Authorization: Bearer <token>"
```

---

## 7️⃣ Behavior Summary

```
Returns all tables linked to the specified table.
Includes metadata about link columns and relation types.
```



## OpenAPI

````yaml /openapi/openapi.yaml get /noCo/api/v2/workspaces/{workspaceId}/tables/{tableId}/linkTables
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}/tables/{tableId}/linkTables:
    get:
      tags:
        - Links & Joins
      summary: Get All Link Tables of Current Table
      description: >-
        ## 1️⃣ Overview


        **Purpose:**

        Retrieves all tables that are linked to a specified table within a
        workspace. Useful for discovering all relationships (link columns)
        associated with a table.


        ---


        ## 2️⃣ Endpoint


        ```

        GET /noCo/api/v2/workspaces/{workspaceId}/tables/{tableId}/linkTables

        ```


        ---


        ## 3️⃣ Path Parameters


        | Parameter | Type | Required | Description |

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

        | workspaceId | UUID | ✅ Yes | Workspace identifier |

        | tableId | UUID | ✅ Yes | Table identifier to query linked tables for |


        ---


        ## 4️⃣ Authentication


        Requires **Bearer JWT Token**


        ```

        Authorization: Bearer <token>

        ```


        ---


        ## 5️⃣ Request Headers


        | Header | Required |

        | --- | --- |

        | Authorization | ✅ Yes |

        | Content-Type: application/json | ✅ Yes |


        ---


        ## 6️⃣ Example Request


        ```bash

        curl -X GET
        https://be.datagol.ai/noCo/api/v2/workspaces/{workspaceId}/tables/{tableId}/linkTables
        \

        -H "Authorization: Bearer <token>"

        ```


        ---


        ## 7️⃣ Behavior Summary


        ```

        Returns all tables linked to the specified table.

        Includes metadata about link columns and relation types.

        ```
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Workspace identifier
        - name: tableId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Table identifier to query linked tables for
      responses:
        '200':
          description: Linked tables retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                      description: Unique identifier of the linked table
                    workspaceId:
                      type: string
                      format: uuid
                      description: Workspace this table belongs to
                    tableName:
                      type: string
                      description: Internal system name of the table
                    title:
                      type: string
                      description: Display name of the table shown in the UI
                    description:
                      type: string
                      description: Optional description of the table
                    columns:
                      type: array
                      description: >-
                        List of all columns in the table including
                        system-generated and user-defined columns
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            description: Unique identifier of the column
                          name:
                            type: string
                            description: Internal column name
                          uiDataType:
                            type: string
                            description: >-
                              UI data type — e.g. SINGLE_LINE_TEXT, NUMBER,
                              DATE, USER, LINK, ID
                          backendDataType:
                            type: string
                            description: Underlying database data type
                          colOptions:
                            type: object
                            description: >-
                              Link configuration if the column is of type LINK,
                              otherwise empty
                            properties:
                              id:
                                type: string
                                format: uuid
                              relationType:
                                type: string
                                description: >-
                                  Relation type — HAS_MANY, ONE_TO_ONE, or
                                  MANY_TO_MANY
                              columnId:
                                type: string
                                format: uuid
                                description: >-
                                  ID of the link column in the source (parent)
                                  table
                              associatedColumnId:
                                type: string
                                format: uuid
                                description: >-
                                  ID of the auto-created reciprocal column in
                                  the child table
                              tableId:
                                type: string
                                format: uuid
                                description: Source table ID
                              associateTableId:
                                type: string
                                format: uuid
                                description: Destination (child) table ID
                              childColumnId:
                                type: string
                                format: uuid
                                description: >-
                                  ID of the primary key column in the child
                                  (destination) table, used to establish the
                                  foreign key relationship
                              parentColumnId:
                                type: string
                                format: uuid
                                description: >-
                                  ID of the primary key column in the parent
                                  (source) table, used to establish the foreign
                                  key relationship
                              whereClause:
                                type: string
                                description: >-
                                  Raw SQL-style join condition, present only for
                                  auto-join links
                              isItSource:
                                type: boolean
                                description: >-
                                  True if this column is the source side of the
                                  relationship
                          uiMetadata:
                            type: object
                            description: UI display metadata for the column
                            properties:
                              title:
                                type: string
                                description: Display name shown in the UI
                    views:
                      type: array
                      description: List of views defined on this table
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          name:
                            type: string
                            description: Display name of the view
                          type:
                            type: string
                            description: View type — e.g. GRID
                          isMaster:
                            type: boolean
                            description: True if this is the default master view
                          position:
                            type: integer
                            description: Display position of the view
              example:
                - id: 6d85b345-b626-4b87-b664-66237d7333e8
                  workspaceId: 16231f3f-8208-4c51-a460-87d17244344f
                  tableName: table_c8be6d9c
                  title: employee
                  description: ''
                  tableType: DYNAMIC
                  columns:
                    - id: 75272cd2-63c4-4d4c-b2eb-20a864834a2a
                      name: noco_87fee1b5
                      uiDataType: ID
                      backendDataType: BIGSERIAL
                    - id: f0f38619-4396-420f-aa20-5bf13bfac51c
                      name: course_name
                      uiDataType: SINGLE_LINE_TEXT
                      backendDataType: TEXT
                      required: false
                      description: ''
                      uiMetadata:
                        title: course name
                    - id: b83a3605-2996-4898-8f31-076d34e49424
                      name: course_1234
                      uiDataType: LINK
                      backendDataType: BIG SERIAL
                      colOptions:
                        id: f668c79a-11ca-4640-bcf9-ae214712f0a7
                        relationType: MANY_TO_MANY
                        columnId: b83a3605-2996-4898-8f31-076d34e49424
                        associatedColumnId: a19221ad-ef55-4de7-b9b3-2e6a05e3bd93
                        tableId: 6d85b345-b626-4b87-b664-66237d7333e8
                        associateTableId: 9c8a448d-7884-4158-bfca-202bc95b0515
                        childColumnId: 75272cd2-63c4-4d4c-b2eb-20a864834a2a
                        parentColumnId: f830fd3f-8624-4ae5-959f-36f1756d828a
                        isItSource: false
                      uiMetadata:
                        title: course
                  views:
                    - id: e5a120e8-fa3b-47cb-9773-7541aa4ec270
                      name: Grid View (Master)
                      type: GRID
                      isMaster: true
                      position: 0
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        This API uses OAuth 2.0 with the authorization code grant flow.

````