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

# Post plugin token

> Get a token



## OpenAPI

````yaml /swagger.json post /plugin/{pluginId}/token
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:
  /plugin/{pluginId}/token:
    post:
      tags:
        - plugin
      description: Get a token
      parameters:
        - schema:
            type: string
          required: true
          name: pluginId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                baseId:
                  type: string
                secret:
                  type: string
                scopes:
                  type: array
                  items:
                    type: string
                    enum:
                      - base|read
                      - base|update
                      - base|invite_email
                      - base|invite_link
                      - base|table_import
                      - base|table_export
                      - base|authority_matrix_config
                      - base|db_connection
                      - base|query_data
                      - table|create
                      - table|delete
                      - table|read
                      - table|update
                      - table|import
                      - table|export
                      - table|trash_read
                      - table|trash_update
                      - table|trash_reset
                      - table|archive_read
                      - table|archive_manage
                      - view|create
                      - view|delete
                      - view|read
                      - view|update
                      - view|share
                      - field|create
                      - field|delete
                      - field|read
                      - field|update
                      - record|create
                      - record|delete
                      - record|read
                      - record|update
                      - record|comment
                      - record|copy
                      - record|archive
                      - table_record_history|read
                      - automation|create
                      - automation|delete
                      - automation|read
                      - automation|update
                      - app|create
                      - app|delete
                      - app|read
                      - app|update
                  minItems: 1
                authCode:
                  type: string
              required:
                - baseId
                - secret
                - scopes
                - authCode
      responses:
        '200':
          description: Returns token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                  refreshToken:
                    type: string
                  scopes:
                    type: array
                    items:
                      type: string
                      enum:
                        - base|read
                        - base|update
                        - base|invite_email
                        - base|invite_link
                        - base|table_import
                        - base|table_export
                        - base|authority_matrix_config
                        - base|db_connection
                        - base|query_data
                        - table|create
                        - table|delete
                        - table|read
                        - table|update
                        - table|import
                        - table|export
                        - table|trash_read
                        - table|trash_update
                        - table|trash_reset
                        - table|archive_read
                        - table|archive_manage
                        - view|create
                        - view|delete
                        - view|read
                        - view|update
                        - view|share
                        - field|create
                        - field|delete
                        - field|read
                        - field|update
                        - record|create
                        - record|delete
                        - record|read
                        - record|update
                        - record|comment
                        - record|copy
                        - record|archive
                        - table_record_history|read
                        - automation|create
                        - automation|delete
                        - automation|read
                        - automation|update
                        - app|create
                        - app|delete
                        - app|read
                        - app|update
                    minItems: 1
                  expiresIn:
                    type: number
                  refreshExpiresIn:
                    type: number
                required:
                  - accessToken
                  - refreshToken
                  - scopes
                  - expiresIn
                  - refreshExpiresIn
      security: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request POST \
              --url https://app.teable.ai/api/plugin/%7BpluginId%7D/token \
              --header 'content-type: application/json' \
              --data '{"baseId":"string","secret":"string","scopes":["base|read"],"authCode":"string"}'
        - lang: JavaScript
          source: |-
            const url = 'https://app.teable.ai/api/plugin/%7BpluginId%7D/token';
            const options = {
              method: 'POST',
              headers: {'content-type': 'application/json'},
              body: '{"baseId":"string","secret":"string","scopes":["base|read"],"authCode":"string"}'
            };

            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/plugin/%7BpluginId%7D/token',
              headers: {
                '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({baseId: 'string', secret: 'string',
            scopes: ['base|read'], authCode: 'string'}));

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


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


            payload =
            "{\"baseId\":\"string\",\"secret\":\"string\",\"scopes\":[\"base|read\"],\"authCode\":\"string\"}"


            headers = { 'content-type': "application/json" }


            conn.request("POST", "/api/plugin/%7BpluginId%7D/token", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))

````