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

# Import Google spreadsheet with progress

> import a Google spreadsheet with SSE progress stream



## OpenAPI

````yaml /swagger.json post /base/import-google-sheet/stream
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: []
tags:
  - name: base
    x-group: project
  - name: base node
    x-group: project node
  - name: base-share
    x-group: project-share
paths:
  /base/import-google-sheet/stream:
    post:
      tags:
        - base
      summary: import a Google spreadsheet with SSE progress events
      description: import a Google spreadsheet with SSE progress stream
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                spaceId:
                  type: string
                  description: >-
                    Target space for the new project. Required only when baseId
                    is omitted; when importing into an existing project the
                    project's own space is used and spaceId is ignored.
                baseId:
                  type: string
                  description: >-
                    Import into this existing project (add its tables) instead
                    of creating a new one. When omitted, a new project named
                    baseName is created in spaceId.
                integrationId:
                  type: string
                  description: >-
                    Id of a connected Google Sheets user integration; its access
                    token is resolved (and refreshed) server-side and never
                    leaves the server for API calls.
                accessToken:
                  type: string
                  minLength: 1
                  description: >-
                    Raw Google OAuth access token with the drive.file scope
                    (never persisted by the server). Ignored when integrationId
                    is provided.
                spreadsheetId:
                  type: string
                  minLength: 1
                baseName:
                  type: string
                  minLength: 1
                  description: >-
                    Name for the created project (normally the spreadsheet
                    title). Required unless baseId is set.
                sheetIds:
                  type: array
                  items:
                    type: number
                  minItems: 1
                  description: >-
                    Numeric ids of the tabs to import (from analyze). When
                    omitted all tabs are imported; an explicitly empty array is
                    rejected (it would silently mean "all").
                importRecords:
                  type: boolean
                  description: >-
                    Import record data (default true). When false only the
                    structure is created.
              required:
                - spreadsheetId
      responses:
        '200':
          description: SSE stream with progress events and final result
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request POST \
              --url https://app.teable.ai/api/base/import-google-sheet/stream \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"spaceId":"string","baseId":"string","integrationId":"string","accessToken":"string","spreadsheetId":"string","baseName":"string","sheetIds":[0],"importRecords":true}'
        - lang: JavaScript
          source: >-
            const url =
            'https://app.teable.ai/api/base/import-google-sheet/stream';

            const options = {
              method: 'POST',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              },
              body: '{"spaceId":"string","baseId":"string","integrationId":"string","accessToken":"string","spreadsheetId":"string","baseName":"string","sheetIds":[0],"importRecords":true}'
            };


            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: 'POST',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/base/import-google-sheet/stream',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              }
            };

            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.write(JSON.stringify({
              spaceId: 'string',
              baseId: 'string',
              integrationId: 'string',
              accessToken: 'string',
              spreadsheetId: 'string',
              baseName: 'string',
              sheetIds: [0],
              importRecords: true
            }));
            req.end();
        - lang: Python
          source: >-
            import http.client


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


            payload =
            "{\"spaceId\":\"string\",\"baseId\":\"string\",\"integrationId\":\"string\",\"accessToken\":\"string\",\"spreadsheetId\":\"string\",\"baseName\":\"string\",\"sheetIds\":[0],\"importRecords\":true}"


            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
            }


            conn.request("POST", "/api/base/import-google-sheet/stream",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


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

````