> ## Documentation Index
> Fetch the complete documentation index at: https://lightdash-mintlify-9d6f9427.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update organization settings

> Updates the current organization's settings. Only the provided fields
are changed.



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json patch /api/v1/org/settings
openapi: 3.0.0
info:
  title: Lightdash API
  version: 0.3249.0
  description: >
    Open API documentation for all public Lightdash API endpoints. #
    Authentication Before you get started, you might need to create a Personal
    Access Token to authenticate via the API. You can create a token by
    following this guide: https://docs.lightdash.com/references/personal_tokens
  license:
    name: MIT
  contact:
    name: Lightdash Support
    email: support@lightdash.com
    url: https://docs.lightdash.com/help-and-contact/contact/contact_info/
servers:
  - url: /
security: []
tags:
  - name: My Account
    description: These routes allow users to manage their own user account.
  - name: Organizations
    description: >-
      Each user is a member of a single organization. These routes allow users
      to manage their organization. Most actions are only available to admin
      users.
  - name: Projects
    description: >-
      Projects belong to a single organization. These routes allow users to
      manage their projects, browse content, and execute queries. Users inside
      an organization might have access to a project from an organization-level
      role or they might be granted access to a project directly.
  - name: Spaces
    description: >-
      Spaces allow you to organize charts and dashboards within a project. They
      also allow granular access to content by allowing you to create private
      spaces, which are only accessible to the creator and admins.
  - name: Roles & Permissions
    description: >-
      These routes allow users to manage roles and permissions for their
      organization.
    externalDocs:
      url: https://docs.lightdash.com/references/roles
  - name: Query
    description: >-
      These routes allow users to execute and manage queries against their data
      warehouse. This includes metric queries, SQL queries, and retrieving query
      results.
paths:
  /api/v1/org/settings:
    patch:
      tags:
        - Organizations
      summary: Update organization settings
      description: |-
        Updates the current organization's settings. Only the provided fields
        are changed.
      operationId: UpdateOrganizationSettings
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrganizationSettings'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiOrganizationSettingsResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      security: []
components:
  schemas:
    UpdateOrganizationSettings:
      $ref: '#/components/schemas/Partial_OrganizationSettings_'
    ApiOrganizationSettingsResponse:
      properties:
        results:
          $ref: '#/components/schemas/OrganizationSettings'
        status:
          type: string
          enum:
            - ok
          nullable: false
      required:
        - results
        - status
      type: object
    ApiErrorPayload:
      properties:
        error:
          properties:
            data:
              $ref: '#/components/schemas/AnyType'
              description: Optional data containing details of the error
            message:
              type: string
              description: A friendly message summarising the error
            name:
              type: string
              description: Unique name for the type of error
            statusCode:
              type: number
              format: integer
              description: HTTP status code
          required:
            - name
            - statusCode
          type: object
        status:
          type: string
          enum:
            - error
          nullable: false
      required:
        - error
        - status
      type: object
      description: |-
        The Error object is returned from the api any time there is an error.
        The message contains
    Partial_OrganizationSettings_:
      properties:
        oidcLinkingEnabled:
          type: boolean
          nullable: true
          description: |-
            Auto-link a new OIDC identity to an existing user who already has a
            different OIDC identity with the same email (overrides
            `AUTH_ENABLE_OIDC_LINKING`; `null` inherits it).
        oidcToEmailLinkingEnabled:
          type: boolean
          nullable: true
          description: |-
            Auto-link an OIDC identity to an existing user matched by verified
            primary email, regardless of how they signed up (overrides
            `AUTH_ENABLE_OIDC_TO_EMAIL_LINKING`; `null` inherits it).
        supportImpersonationEnabled:
          type: boolean
          nullable: true
          description: >-
            Per-org consent for the Lightdash support team to impersonate users
            in

            the org while helping with a support request. Unlike the OIDC
            toggles

            this has no instance/env default — it's opt-in only, so `null` (or
            no

            stored row) resolves to `false`.
        scheduledDeliveryExpirationSeconds:
          type: number
          format: double
          nullable: true
          description: >-
            Base lifetime (seconds) of this org's scheduled-delivery download
            links —

            the default every channel inherits. Overrides the instance-wide

            `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS` env; `null` inherits
            it. This

            field is always resolved to an effective number in API responses (it

            falls back to the env default), so the frontend can display it
            directly.

            A value over {@link S3_PRESIGNED_URL_MAX_EXPIRATION_SECONDS}
            transparently

            switches that delivery to the persistent-download-URL system (the
            only

            way a link can outlive AWS's 7-day presigned ceiling).
        scheduledDeliveryExpirationSecondsEmail:
          type: number
          format: double
          nullable: true
          description: >-
            Per-channel override (seconds) of {@link
            scheduledDeliveryExpirationSeconds }

            for email deliveries; `null` inherits the base. Unlike the base,
            this is

            surfaced raw (not resolved) so the UI can distinguish "inherit" from
            an

            explicit value. Overrides
            `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS_EMAIL`.
        scheduledDeliveryExpirationSecondsSlack:
          type: number
          format: double
          nullable: true
          description: >-
            Per-channel override (seconds) for Slack deliveries; `null` inherits
            the

            base. Overrides `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS_SLACK`.
        scheduledDeliveryExpirationSecondsMsTeams:
          type: number
          format: double
          nullable: true
          description: >-
            Per-channel override (seconds) for Microsoft Teams deliveries;
            `null`

            inherits the base. Overrides
            `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS_MSTEAMS`.
        scheduledDeliveryExpirationSecondsGoogleChat:
          type: number
          format: double
          nullable: true
          description: >-
            Per-channel override (seconds) for Google Chat deliveries; `null`
            inherits

            the base. Google Chat has no instance env var, so this is an
            org-only

            override (it still falls back to the base / env base).
        queryLimit:
          type: number
          format: double
          nullable: true
          description: >-
            Max number of rows a query may return for this org. Inherits and is

            capped by the instance-wide `LIGHTDASH_QUERY_MAX_LIMIT` (the
            ceiling);

            `null` inherits it. Always resolved to an effective number in API

            responses so the frontend can display it directly.
        csvCellsLimit:
          type: number
          format: double
          nullable: true
          description: >-
            Max number of cells (rows × columns) a CSV/Excel export may contain
            for

            this org. Inherits `LIGHTDASH_CSV_CELLS_LIMIT` and is capped by

            `LIGHTDASH_CSV_MAX_LIMIT` (the ceiling); `null` inherits the

            default. Always resolved to an effective number in API responses.
        corsAllowedDomains:
          items:
            type: string
          type: array
          nullable: true
          description: >-
            Exact origins, wildcard subdomain origins, and regex patterns this
            org

            contributes to the instance CORS allow-list. Regex entries use
            `/.../`

            syntax.
      type: object
      description: Make all properties in T optional
    OrganizationSettings:
      properties:
        corsAllowedDomains:
          items:
            type: string
          type: array
          nullable: true
          description: >-
            Exact origins, wildcard subdomain origins, and regex patterns this
            org

            contributes to the instance CORS allow-list. Regex entries use
            `/.../`

            syntax.
        csvCellsLimit:
          type: number
          format: double
          nullable: true
          description: >-
            Max number of cells (rows × columns) a CSV/Excel export may contain
            for

            this org. Inherits `LIGHTDASH_CSV_CELLS_LIMIT` and is capped by

            `LIGHTDASH_CSV_MAX_LIMIT` (the ceiling); `null` inherits the

            default. Always resolved to an effective number in API responses.
        queryLimit:
          type: number
          format: double
          nullable: true
          description: >-
            Max number of rows a query may return for this org. Inherits and is

            capped by the instance-wide `LIGHTDASH_QUERY_MAX_LIMIT` (the
            ceiling);

            `null` inherits it. Always resolved to an effective number in API

            responses so the frontend can display it directly.
        scheduledDeliveryExpirationSecondsGoogleChat:
          type: number
          format: double
          nullable: true
          description: >-
            Per-channel override (seconds) for Google Chat deliveries; `null`
            inherits

            the base. Google Chat has no instance env var, so this is an
            org-only

            override (it still falls back to the base / env base).
        scheduledDeliveryExpirationSecondsMsTeams:
          type: number
          format: double
          nullable: true
          description: >-
            Per-channel override (seconds) for Microsoft Teams deliveries;
            `null`

            inherits the base. Overrides
            `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS_MSTEAMS`.
        scheduledDeliveryExpirationSecondsSlack:
          type: number
          format: double
          nullable: true
          description: >-
            Per-channel override (seconds) for Slack deliveries; `null` inherits
            the

            base. Overrides `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS_SLACK`.
        scheduledDeliveryExpirationSecondsEmail:
          type: number
          format: double
          nullable: true
          description: >-
            Per-channel override (seconds) of {@link
            scheduledDeliveryExpirationSeconds }

            for email deliveries; `null` inherits the base. Unlike the base,
            this is

            surfaced raw (not resolved) so the UI can distinguish "inherit" from
            an

            explicit value. Overrides
            `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS_EMAIL`.
        scheduledDeliveryExpirationSeconds:
          type: number
          format: double
          nullable: true
          description: >-
            Base lifetime (seconds) of this org's scheduled-delivery download
            links —

            the default every channel inherits. Overrides the instance-wide

            `PERSISTENT_DOWNLOAD_URL_EXPIRATION_SECONDS` env; `null` inherits
            it. This

            field is always resolved to an effective number in API responses (it

            falls back to the env default), so the frontend can display it
            directly.

            A value over {@link S3_PRESIGNED_URL_MAX_EXPIRATION_SECONDS}
            transparently

            switches that delivery to the persistent-download-URL system (the
            only

            way a link can outlive AWS's 7-day presigned ceiling).
        supportImpersonationEnabled:
          type: boolean
          nullable: true
          description: >-
            Per-org consent for the Lightdash support team to impersonate users
            in

            the org while helping with a support request. Unlike the OIDC
            toggles

            this has no instance/env default — it's opt-in only, so `null` (or
            no

            stored row) resolves to `false`.
        oidcToEmailLinkingEnabled:
          type: boolean
          nullable: true
          description: |-
            Auto-link an OIDC identity to an existing user matched by verified
            primary email, regardless of how they signed up (overrides
            `AUTH_ENABLE_OIDC_TO_EMAIL_LINKING`; `null` inherits it).
        oidcLinkingEnabled:
          type: boolean
          nullable: true
          description: |-
            Auto-link a new OIDC identity to an existing user who already has a
            different OIDC identity with the same email (overrides
            `AUTH_ENABLE_OIDC_LINKING`; `null` inherits it).
      required:
        - corsAllowedDomains
        - csvCellsLimit
        - queryLimit
        - scheduledDeliveryExpirationSecondsGoogleChat
        - scheduledDeliveryExpirationSecondsMsTeams
        - scheduledDeliveryExpirationSecondsSlack
        - scheduledDeliveryExpirationSecondsEmail
        - scheduledDeliveryExpirationSeconds
        - supportImpersonationEnabled
        - oidcToEmailLinkingEnabled
        - oidcLinkingEnabled
      type: object
      description: >-
        Per-organization settings migrated from instance-wide env vars. Surfaced
        in

        the Pro admin panel and stored in the `organization_settings` table.
        Starts

        with the OIDC account-linking toggles; designed to grow as more settings

        move org-level.


        Each value is tri-state: `null` means "not set — inherit the
        instance/env

        default", while an explicit `true`/`false` overrides the env. The
        fallback

        to the env default is resolved in the auth layer, not here.
    AnyType:
      description: |-
        This AnyType is an alias for any
        The goal is to make it easier to identify any type in the codebase
        without having to eslint-disable all the time
        These are only used on legacy `any` types, don't use it for new types.
        This is added on a separate file to avoid circular dependencies.

````