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

# Patch base app login config

> Update app login config. Backend decides whether the sandbox dev server needs a restart based on the diff.

Required token scopes: `app|update`



## OpenAPI

````yaml /swagger.json patch /base/{baseId}/app/{appId}/login-config
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/{baseId}/app/{appId}/login-config:
    patch:
      tags:
        - app
      description: >-
        Update app login config. Backend decides whether the sandbox dev server
        needs a restart based on the diff.


        Required token scopes: `app|update`
      parameters:
        - schema:
            type: string
          required: true
          name: baseId
          in: path
        - schema:
            type: string
          required: true
          name: appId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                loginConfig:
                  type: object
                  nullable: true
                  properties:
                    enabled:
                      type: boolean
                    userTableId:
                      type: string
                    emailFieldId:
                      type: string
                    providers:
                      type: array
                      items:
                        oneOf:
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - email-otp
                            required:
                              - type
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - google
                            required:
                              - type
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - teable
                            required:
                              - type
                      default: []
                    access:
                      type: object
                      properties:
                        mode:
                          type: string
                          enum:
                            - open
                            - domain
                            - existing-only
                          default: open
                        domains:
                          type: array
                          items:
                            type: string
                  required:
                    - enabled
                    - userTableId
                    - emailFieldId
              required:
                - loginConfig
      responses:
        '200':
          description: App login config updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  loginConfig:
                    type: object
                    nullable: true
                    properties:
                      enabled:
                        type: boolean
                      userTableId:
                        type: string
                      emailFieldId:
                        type: string
                      providers:
                        type: array
                        items:
                          oneOf:
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - email-otp
                              required:
                                - type
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - google
                              required:
                                - type
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - teable
                              required:
                                - type
                        default: []
                      access:
                        type: object
                        properties:
                          mode:
                            type: string
                            enum:
                              - open
                              - domain
                              - existing-only
                            default: open
                          domains:
                            type: array
                            items:
                              type: string
                    required:
                      - enabled
                      - userTableId
                      - emailFieldId
                  previewReloaded:
                    type: boolean
                  previewUrl:
                    type: string
                required:
                  - id
                  - previewReloaded
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request PATCH \
              --url https://app.teable.ai/api/base/%7BbaseId%7D/app/%7BappId%7D/login-config \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"loginConfig":{"enabled":true,"userTableId":"string","emailFieldId":"string","providers":[],"access":{"mode":"open","domains":["string"]}}}'
        - lang: JavaScript
          source: >-
            const url =
            'https://app.teable.ai/api/base/%7BbaseId%7D/app/%7BappId%7D/login-config';

            const options = {
              method: 'PATCH',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              },
              body: '{"loginConfig":{"enabled":true,"userTableId":"string","emailFieldId":"string","providers":[],"access":{"mode":"open","domains":["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: 'PATCH',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/base/%7BbaseId%7D/app/%7BappId%7D/login-config',
              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({
              loginConfig: {
                enabled: true,
                userTableId: 'string',
                emailFieldId: 'string',
                providers: [],
                access: {mode: 'open', domains: ['string']}
              }
            }));
            req.end();
        - lang: Python
          source: >-
            import http.client


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


            payload =
            "{\"loginConfig\":{\"enabled\":true,\"userTableId\":\"string\",\"emailFieldId\":\"string\",\"providers\":[],\"access\":{\"mode\":\"open\",\"domains\":[\"string\"]}}}"


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


            conn.request("PATCH",
            "/api/base/%7BbaseId%7D/app/%7BappId%7D/login-config", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


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

````