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

# Get base erd

> Get the erd of a base



## OpenAPI

````yaml /swagger.json get /base/{baseId}/erd
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
paths:
  /base/{baseId}/erd:
    get:
      tags:
        - base
      description: Get the erd of a base
      parameters:
        - schema:
            type: string
          required: true
          name: baseId
          in: path
      responses:
        '200':
          description: Returns the erd of a base.
          content:
            application/json:
              schema:
                type: object
                properties:
                  baseId:
                    type: string
                  nodes:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        icon:
                          type: string
                        crossBaseId:
                          type: string
                        crossBaseName:
                          type: string
                        fields:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                description: The id of the field.
                              name:
                                type: string
                                description: >-
                                  The name of the field. can not be duplicated
                                  in the table.
                                example: Tags
                              type:
                                type: string
                                enum:
                                  - singleLineText
                                  - longText
                                  - user
                                  - attachment
                                  - checkbox
                                  - multipleSelect
                                  - singleSelect
                                  - date
                                  - number
                                  - rating
                                  - formula
                                  - rollup
                                  - conditionalRollup
                                  - link
                                  - createdTime
                                  - lastModifiedTime
                                  - createdBy
                                  - lastModifiedBy
                                  - autoNumber
                                  - button
                                description: The field types supported by teable.
                                example: singleSelect
                              isLookup:
                                type: boolean
                                description: >-
                                  Whether this field is lookup field. witch
                                  means cellValue and [fieldType] is looked up
                                  from the linked table.
                              isConditionalLookup:
                                type: boolean
                                description: >-
                                  Whether this lookup field applies a
                                  conditional filter when resolving linked
                                  records.
                              isPrimary:
                                type: boolean
                                description: Whether this field is primary field.
                            required:
                              - id
                              - name
                              - type
                      required:
                        - id
                        - name
                        - fields
                      additionalProperties:
                        nullable: true
                  edges:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            tableId:
                              type: string
                            tableName:
                              type: string
                            fieldId:
                              type: string
                            fieldName:
                              type: string
                          required:
                            - tableId
                            - tableName
                            - fieldId
                            - fieldName
                        target:
                          type: object
                          properties:
                            tableId:
                              type: string
                            tableName:
                              type: string
                            fieldId:
                              type: string
                            fieldName:
                              type: string
                          required:
                            - tableId
                            - tableName
                            - fieldId
                            - fieldName
                        relationship:
                          type: string
                          enum:
                            - oneOne
                            - manyMany
                            - oneMany
                            - manyOne
                        isOneWay:
                          type: boolean
                        type:
                          anyOf:
                            - type: string
                              enum:
                                - singleLineText
                                - longText
                                - user
                                - attachment
                                - checkbox
                                - multipleSelect
                                - singleSelect
                                - date
                                - number
                                - rating
                                - formula
                                - rollup
                                - conditionalRollup
                                - link
                                - createdTime
                                - lastModifiedTime
                                - createdBy
                                - lastModifiedBy
                                - autoNumber
                                - button
                            - type: string
                              enum:
                                - lookup
                      required:
                        - source
                        - target
                        - type
                required:
                  - baseId
                  - nodes
                  - edges
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request GET \
              --url https://app.teable.ai/api/base/%7BbaseId%7D/erd \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: JavaScript
          source: >-
            const url = 'https://app.teable.ai/api/base/%7BbaseId%7D/erd';

            const options = {method: 'GET', headers: {Authorization: 'Bearer
            REPLACE_BEARER_TOKEN'}};


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: |-
            const http = require('https');

            const options = {
              method: 'GET',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/base/%7BbaseId%7D/erd',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN'
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("app.teable.ai")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/api/base/%7BbaseId%7D/erd", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````