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

# Create an organization

> Creates a new organization. The authenticated user becomes an admin.



## OpenAPI

````yaml https://charts.basedash.com/api/public/openapi post /api/public/organizations
openapi: 3.1.0
info:
  title: Basedash Public API
  version: 0.0.0
  description: >-
    API for programmatic access to Basedash features. Use API keys for
    authentication.
  contact:
    name: Basedash Support
    url: https://basedash.com
    email: support@basedash.com
servers:
  - url: https://charts.basedash.com
    description: Production
security: []
tags:
  - name: Organizations
    description: Manage organizations
  - name: Groups
    description: Manage organization groups and memberships
  - name: Data Sources
    description: Manage database connections and data sources
  - name: MCP servers
    description: Manage MCP server data sources
  - name: Insights
    description: Manage generated insights
  - name: Automations
    description: Manage automations and automation runs
  - name: Skills
    description: Manage organization skills
  - name: Definitions
    description: Manage reusable SQL definitions
paths:
  /api/public/organizations:
    post:
      tags:
        - Organizations
      summary: Create an organization
      description: Creates a new organization. The authenticated user becomes an admin.
      parameters:
        - schema:
            type: string
            enum:
              - jwtSecret
            description: >-
              Include sensitive fields in the response. Use `jwtSecret` to
              include the embed JWT secret.
          required: false
          description: >-
            Include sensitive fields in the response. Use `jwtSecret` to include
            the embed JWT secret.
          name: include
          in: query
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  description: Name of the organization
                customAiContext:
                  type: string
                  description: Custom context for AI features
                skipOnboarding:
                  type: boolean
                  description: Skip onboarding flow
                fullEmbedEnabled:
                  type: boolean
                  description: Enable full embed functionality
                embedAllowedOrigins:
                  type: array
                  items:
                    type: string
                  description: >-
                    Allowed origins for embedding. Supports exact URLs
                    (https://example.com) and wildcard patterns
                    (https://*.example.com)
                slug:
                  type: string
                  description: >-
                    URL-friendly slug. If not provided, a unique slug will be
                    generated.
                isBillable:
                  type: boolean
                  description: >-
                    [Self-hosted] Controls whether the organization is billable.
                    Defaults to true. Relevant for self-hosted deployments where
                    billing gates certain features. When false, the organization
                    will not be counted towards billable usage and will have a
                    limited set of features. When true, the organization will be
                    counted towards billable usage (after a 14-day trial) and
                    will have access to all features.
                insightsEnabled:
                  type: boolean
                  description: >-
                    Enable automated insights generation for this organization.
                    Defaults to true.
                insightsFrequency:
                  type: string
                  enum:
                    - DAILY
                    - WEEKDAYS
                    - WEEKLY
                    - MONTHLY
                    - NEVER
                  description: >-
                    How often automated insights are generated. Defaults to
                    DAILY.
                insightsPreferredDayOfWeek:
                  type: integer
                  minimum: 0
                  maximum: 6
                  description: Preferred day of week for WEEKLY insights. 0 is Sunday.
                insightsPreferredDayOfMonth:
                  type: integer
                  minimum: 1
                  maximum: 31
                  description: Preferred day of month for MONTHLY insights.
                allowOnDemandAiUsage:
                  type: boolean
                  description: >-
                    Allow users in the organization to continue using AI beyond
                    included monthly AI credits. Defaults to true.
                aiUsageOverageLimitCents:
                  type:
                    - integer
                    - 'null'
                  exclusiveMinimum: 0
                  maximum: 2147483647
                  description: >-
                    Maximum AI usage overage for the organization in cents. Null
                    means no limit. Only applies when on-demand AI usage is
                    enabled.
                defaultDashboardAccessAudience:
                  type: string
                  enum:
                    - EVERYONE
                    - CREATOR_ONLY
                    - CREATOR_GROUPS
                  description: Default audience for newly created dashboards
                defaultDashboardAccessLevel:
                  type: string
                  enum:
                    - MANAGE
                    - EDIT
                    - VIEW
                  description: >-
                    Default permission level for the audience. Creator always
                    gets MANAGE regardless.
                defaultChatAccessAudience:
                  type: string
                  enum:
                    - EVERYONE
                    - CREATOR_ONLY
                    - CREATOR_GROUPS
                  description: Default audience for newly created chats
                defaultChatAccessLevel:
                  type: string
                  enum:
                    - MANAGE
                    - EDIT
                    - VIEW
                  description: >-
                    Default permission level for new chats. Creator always gets
                    MANAGE regardless.
                defaultAutomationAccessAudience:
                  type: string
                  enum:
                    - EVERYONE
                    - CREATOR_ONLY
                    - CREATOR_GROUPS
                  description: Default audience for newly created automations
                defaultAutomationAccessLevel:
                  type: string
                  enum:
                    - MANAGE
                    - EDIT
                    - VIEW
                  description: >-
                    Default permission level for new automations. Creator always
                    gets MANAGE regardless.
              required:
                - name
      responses:
        '201':
          description: >-
            Organization created successfully. The `jwtSecret` field is only
            included when explicitly requested via `?include=jwtSecret`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Organization ID
                      name:
                        type: string
                        description: Name of the organization
                      slug:
                        type: string
                        description: URL-friendly slug
                      customAiContext:
                        type:
                          - string
                          - 'null'
                        description: Custom context for AI
                      onboardingStatus:
                        type: string
                        enum:
                          - STARTED
                          - COMPLETED
                        description: Onboarding status
                      fullEmbedEnabled:
                        type: boolean
                        description: Full embed enabled flag
                      embedAllowedOrigins:
                        type: array
                        items:
                          type: string
                        description: Allowed embed origins
                      isBillable:
                        type: boolean
                        description: >-
                          [Self-hosted] Whether the organization is billable.
                          Defaults to true. Relevant for self-hosted deployments
                          where billing gates certain features. When false, the
                          organization will not be counted towards billable
                          usage and will have a limited set of features. When
                          true, the organization will be counted towards
                          billable usage (after a 14-day trial) and will have
                          access to all features.
                      insightsEnabled:
                        type: boolean
                        description: >-
                          Whether automated insights generation is enabled for
                          this organization.
                      insightsFrequency:
                        type: string
                        enum:
                          - DAILY
                          - WEEKDAYS
                          - WEEKLY
                          - MONTHLY
                          - NEVER
                        description: >-
                          How often automated insights are generated. NEVER
                          means automatic generation is disabled.
                      insightsPreferredDayOfWeek:
                        type:
                          - number
                          - 'null'
                        description: >-
                          Preferred day of week for weekly insights. 0 is
                          Sunday.
                      insightsPreferredDayOfMonth:
                        type:
                          - number
                          - 'null'
                        description: Preferred day of month for monthly insights.
                      allowOnDemandAiUsage:
                        type: boolean
                        description: >-
                          Whether the organization can continue using AI beyond
                          included monthly AI credits.
                      aiUsageOverageLimitCents:
                        type:
                          - integer
                          - 'null'
                        exclusiveMinimum: 0
                        maximum: 2147483647
                        description: >-
                          Maximum AI usage overage for the organization in
                          cents. Null means no limit.
                      defaultDashboardAccessAudience:
                        type: string
                        enum:
                          - EVERYONE
                          - CREATOR_ONLY
                          - CREATOR_GROUPS
                        description: Default audience for newly created dashboards
                      defaultDashboardAccessLevel:
                        type: string
                        enum:
                          - MANAGE
                          - EDIT
                          - VIEW
                        description: >-
                          Default permission level for the audience. Creator
                          always gets MANAGE regardless.
                      defaultChatAccessAudience:
                        type: string
                        enum:
                          - EVERYONE
                          - CREATOR_ONLY
                          - CREATOR_GROUPS
                        description: Default audience for newly created chats
                      defaultChatAccessLevel:
                        type: string
                        enum:
                          - MANAGE
                          - EDIT
                          - VIEW
                        description: >-
                          Default permission level for new chats. Creator always
                          gets MANAGE regardless.
                      defaultAutomationAccessAudience:
                        type: string
                        enum:
                          - EVERYONE
                          - CREATOR_ONLY
                          - CREATOR_GROUPS
                        description: Default audience for newly created automations
                      defaultAutomationAccessLevel:
                        type: string
                        enum:
                          - MANAGE
                          - EDIT
                          - VIEW
                        description: >-
                          Default permission level for new automations. Creator
                          always gets MANAGE regardless.
                      trialEndsAt:
                        type:
                          - string
                          - 'null'
                        description: >-
                          [Self-hosted] ISO 8601 date when the trial ends, or
                          null if no trial. Trial starts after the organization
                          is created and becomes billable.
                      jwtSecret:
                        type: string
                        description: JWT secret for embedding
                    required:
                      - id
                      - name
                      - slug
                      - customAiContext
                      - onboardingStatus
                      - fullEmbedEnabled
                      - embedAllowedOrigins
                      - isBillable
                      - insightsEnabled
                      - insightsFrequency
                      - insightsPreferredDayOfWeek
                      - insightsPreferredDayOfMonth
                      - allowOnDemandAiUsage
                      - aiUsageOverageLimitCents
                      - defaultDashboardAccessAudience
                      - defaultDashboardAccessLevel
                      - defaultChatAccessAudience
                      - defaultChatAccessLevel
                      - defaultAutomationAccessAudience
                      - defaultAutomationAccessLevel
                      - trialEndsAt
                required:
                  - data
        '400':
          description: Bad request - Invalid JSON body or validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict - Slug already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded - Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    RateLimitErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RateLimitError'
      required:
        - error
    ApiError:
      type: object
      properties:
        title:
          type: string
          description: Error type identifier
        detail:
          type: string
          description: Human-readable error description
      required:
        - title
        - detail
    RateLimitError:
      allOf:
        - $ref: '#/components/schemas/ApiError'
        - type: object
          properties:
            title:
              type: string
              enum:
                - RateLimitExceeded
            retryAfterMs:
              type: number
              description: Milliseconds until the rate limit window resets
          required:
            - retryAfterMs
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication using Bearer token format: `Bearer
        <basedash_api_key>`

````