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

# Update an organization



## OpenAPI

````yaml /api-reference/openapi.json patch /v2/orgs/{id}
openapi: 3.1.0
info:
  title: Base39 API
  description: Base39 API
  version: 1.0.0
  contact:
    name: Base39 Team
    url: https://base39.com.br
    email: suporte@base39.com.br
  termsOfService: https://base39.com.br/termos
  license:
    name: Proprietary
    url: https://base39.com.br/termos
servers:
  - url: http://localhost:3000
    description: Local
  - url: https://api.dev.base39.cloud
    description: Development
  - url: https://api.base39.com.br
    description: Production
security:
  - OAuth2: []
tags:
  - name: pages
    description: Profiles and reports pages
  - name: pipelines
    description: Pipeline boards (kanban) of pages
  - name: blocks
    description: Blocks operations
  - name: search
    description: Search across content
  - name: targets
    description: Lookup targets via datasets
  - name: CognitoTriggers
    description: Cognito triggers
paths:
  /v2/orgs/{id}:
    patch:
      tags:
        - orgs
      summary: Update an organization
      operationId: org_update
      parameters:
        - name: id
          required: true
          in: path
          description: Organization ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrgInput'
      responses:
        '200':
          description: Organization updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgOutput'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Requires admin or owner role
        '404':
          description: Organization not found
components:
  schemas:
    UpdateOrgInput:
      type: object
      properties:
        name:
          type: string
          description: Organization name
          example: Acme Corporation
        domain:
          type: string
          description: Organization email domain
          nullable: true
          example: acmecorp.com
        icon:
          description: Icon for the organization
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/FileInput'
            - $ref: '#/components/schemas/EmojiInput'
            - $ref: '#/components/schemas/DomainInput'
            - $ref: '#/components/schemas/EmptyIconInput'
        microsoftDomains:
          nullable: true
          example:
            - contoso.com
            - fabrikam.com
          type: array
          items:
            type: string
        theme:
          description: Theme settings
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ThemeInput'
        settings:
          description: Organization settings
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrgSettingsInput'
        legalName:
          type: string
          example: Acme Corporation LTDA
        tradeName:
          type: string
          example: Acme
        document:
          type: string
          example: '12345678000190'
        billingAddress:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/BillingAddressInput'
        invoiceEmails:
          maxItems: 10
          example:
            - financeiro@acme.com
          type: array
          items:
            type: string
        ownerUserId:
          type: string
          description: Organization owner user ID
          example: usr_abc123
    OrgOutput:
      type: object
      properties:
        object:
          type: string
          example: page
          description: Object type
          title: Object
          x-locale-pt-br-title: Objeto
        id:
          type: string
          example: p_abc123
          description: Unique identifier
          title: ID
          x-locale-pt-br-title: ID
        createdAt:
          format: date-time
          type: string
          example: '2024-01-15T10:30:00.000Z'
          description: Creation timestamp
          title: Created at
          x-locale-pt-br-title: Criado em
        updatedAt:
          format: date-time
          type: string
          example: '2024-01-15T14:45:00.000Z'
          description: Last update timestamp
          title: Updated at
          x-locale-pt-br-title: Atualizado em
        createdBy:
          type: object
          example:
            object: user
            id: u_abc123
            apiKeyId: bsk_abc123
          description: Principal who created this object
          properties:
            object:
              type: string
              enum:
                - user
                - service_account
              example: user
            id:
              type: string
              example: u_abc123
            apiKeyId:
              type: string
              example: bsk_abc123
          title: Created by
          x-locale-pt-br-title: Criado por
        updatedBy:
          type: object
          example:
            object: user
            id: u_abc123
            apiKeyId: bsk_abc123
          description: Principal who last updated this object
          properties:
            object:
              type: string
              enum:
                - user
                - service_account
                - webhook
                - stream
              example: user
            id:
              type: string
              example: u_abc123
            apiKeyId:
              type: string
              example: bsk_abc123
          title: Updated by
          x-locale-pt-br-title: Atualizado por
        name:
          type: string
          example: Acme Corp
        slug:
          type: string
          example: acme
        legalName:
          type: string
        tradeName:
          type: string
        status:
          type: string
          enum:
            - draft
            - trialing
            - active
            - incomplete
            - incomplete_expired
            - past_due
            - canceled
            - unpaid
            - paused
        billing:
          type: string
          enum:
            - stripe
            - kong
        domain:
          type: string
          nullable: true
        allow_auto_join:
          type: boolean
        microsoftTenants:
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/OrgMicrosoftTenantOutput'
        stripeCustomerId:
          type: string
          nullable: true
        stripeSubscriptionId:
          type: string
          nullable: true
        kongCustomerId:
          type: string
          nullable: true
        trialEndedAt:
          type: string
          format: date-time
          nullable: true
        icon:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/IconOutput'
        theme:
          type: object
          description: Configurações de tema da organização
          nullable: true
          properties:
            primaryColor:
              type: string
              example: '#2563eb'
            textColor:
              type: string
              example: '#ffffff'
        settings:
          description: Configurações da organização
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrgSettingsOutput'
        params:
          type: object
          description: Organization parameters
          additionalProperties: true
          nullable: true
        owner:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrgUserReference'
        invoiceEmails:
          maxItems: 10
          type: array
          items:
            type: string
        billingAddress:
          type: object
          description: Endereço de faturamento
          nullable: true
          properties:
            line1:
              type: string
              nullable: true
            number:
              type: string
              nullable: true
            line2:
              type: string
              nullable: true
            neighborhood:
              type: string
              nullable: true
            city:
              type: string
              nullable: true
            state:
              type: string
              nullable: true
            postalCode:
              type: string
              nullable: true
            country:
              type: string
              nullable: true
            phoneNumber:
              type: string
              nullable: true
        document:
          type: string
        defaultPaymentMethod:
          type: string
        trialDaysRemaining:
          type: integer
          description: Dias restantes de trial
          example: 12
          nullable: true
      required:
        - object
        - id
        - createdAt
        - updatedAt
        - name
        - slug
        - billing
        - invoiceEmails
    FileInput:
      type: object
      properties:
        file:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/InternalFileInput'
        external:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ExternalFileInput'
        file_upload:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/FileUploadInput'
    EmojiInput:
      type: object
      properties: {}
    DomainInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - domain
          example: domain
        domain:
          type: string
          example: acme.com
      required:
        - type
        - domain
    EmptyIconInput:
      type: object
      properties:
        empty:
          type: boolean
          example: true
      required:
        - empty
    ThemeInput:
      type: object
      properties:
        primaryColor:
          type: string
          example: '#2563eb'
        textColor:
          type: string
          example: '#ffffff'
    OrgSettingsInput:
      type: object
      properties:
        defaultAgent:
          type: string
          example: base39-orbit-chat
        defaultWhatsAppAgent:
          type: string
          example: base39-orbit-whatsapp
        homeShortcuts:
          type: array
          items:
            $ref: '#/components/schemas/HomeShortcutInput'
        authentication:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrgAuthenticationSettingsInput'
        ipRestrictions:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrgIpRestrictionsSettingsInput'
        objectSettings:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrgObjectSettingsInput'
        datasetQueries:
          type: array
          items:
            $ref: '#/components/schemas/OrgDatasetQuerySettingInput'
    BillingAddressInput:
      type: object
      properties: {}
    OrgMicrosoftTenantOutput:
      type: object
      properties:
        domain:
          type: string
          example: contoso.com
        tenantId:
          type: string
          example: 36691401-5cfd-4754-a328-acba3782dee8
      required:
        - domain
        - tenantId
    IconOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - emoji
            - external
            - file_upload
            - domain
            - file
            - lucide
            - dicebear
            - brand
        emoji:
          type: string
          example: page_icon
        external:
          $ref: '#/components/schemas/ExternalFileOutput'
        file_upload:
          $ref: '#/components/schemas/FileUploadOutput'
        domain:
          type: string
          example: acme.com
        file:
          $ref: '#/components/schemas/InternalFileOutput'
        lucide:
          type: string
          example: file-text
        brand:
          type: string
          example: github
          description: Simple Icons brand slug (logo and color resolved automatically)
        dicebear:
          $ref: '#/components/schemas/DicebearIconPayloadOutput'
        background:
          type: string
          enum:
            - blue
            - red
            - pattern-red
            - pattern-blue
            - pattern-red-1
            - pattern-red-2
            - pattern-red-3
            - pattern-blue-1
            - pattern-blue-2
            - pattern-blue-3
        empty:
          type: boolean
          example: true
        updatedBy:
          type: string
          example: dataset:empresas
    OrgSettingsOutput:
      type: object
      properties:
        defaultAgent:
          type: string
          example: base39-orbit-chat
        defaultWhatsAppAgent:
          type: string
          example: base39-orbit-whatsapp
        homeShortcuts:
          type: array
          items:
            $ref: '#/components/schemas/OrgHomeShortcutOutput'
        authentication:
          type: object
          properties:
            emailPasswordEnabled:
              type: boolean
              nullable: true
            googleEnabled:
              type: boolean
              nullable: true
            microsoftEnabled:
              type: boolean
              nullable: true
            passkeyEnabled:
              type: boolean
              nullable: true
            samlEnabled:
              type: boolean
              nullable: true
            require2FA:
              type: boolean
              nullable: true
        ipRestrictions:
          type: object
          properties:
            enabled:
              type: boolean
              nullable: true
            allowedCidrs:
              nullable: true
              type: array
              items:
                type: string
        objectSettings:
          type: object
          properties:
            deal:
              type: object
              properties:
                properties:
                  type: object
                  additionalProperties:
                    type: object
                    properties:
                      visible:
                        type: boolean
                        nullable: true
                      label:
                        type: string
                        nullable: true
                      icon:
                        type: object
                        nullable: true
                        additionalProperties: true
                      settings:
                        type: object
                        nullable: true
                        additionalProperties: true
                relations:
                  type: object
                  additionalProperties:
                    type: object
                    properties:
                      visible:
                        type: boolean
                        nullable: true
                      label:
                        type: string
                        nullable: true
                      icon:
                        type: object
                        nullable: true
                        additionalProperties: true
                      settings:
                        type: object
                        nullable: true
                        additionalProperties: true
        datasetQueries:
          type: array
          items:
            type: object
            properties:
              entityType:
                type: string
                enum:
                  - company
                  - person
                example: company
              slug:
                type: string
                example: serasa_crednet
              mode:
                type: string
                enum:
                  - always
                  - manual
                  - hidden
                example: manual
            required:
              - entityType
              - slug
              - mode
    OrgUserReference:
      type: object
      properties:
        object:
          type: string
          example: user
          description: Reference to a user object
        id:
          type: string
          example: user_123
      required:
        - object
        - id
    InternalFileInput:
      type: object
      properties: {}
    ExternalFileInput:
      type: object
      properties: {}
    FileUploadInput:
      type: object
      properties: {}
    HomeShortcutInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - bundle
            - agent
        id:
          type: string
        visible:
          type: boolean
          example: true
    OrgAuthenticationSettingsInput:
      type: object
      properties:
        emailPasswordEnabled:
          type: boolean
        googleEnabled:
          type: boolean
        microsoftEnabled:
          type: boolean
        passkeyEnabled:
          type: boolean
        samlEnabled:
          type: boolean
        require2FA:
          type: boolean
    OrgIpRestrictionsSettingsInput:
      type: object
      properties:
        enabled:
          type: boolean
        allowedCidrs:
          nullable: true
          type: array
          items:
            type: string
    OrgObjectSettingsInput:
      type: object
      properties:
        deal:
          $ref: '#/components/schemas/OrgObjectKindSettingsInput'
    OrgDatasetQuerySettingInput:
      type: object
      properties:
        entityType:
          type: string
          enum:
            - company
            - person
          example: company
        slug:
          type: string
          example: serasa_crednet
        mode:
          type: string
          enum:
            - always
            - manual
            - hidden
          example: manual
      required:
        - entityType
        - slug
        - mode
    ExternalFileOutput:
      type: object
      properties:
        url:
          type: string
          example: https://example.com/image.jpg
      required:
        - url
    FileUploadOutput:
      type: object
      properties:
        id:
          type: string
          example: fu_abc123
      required:
        - id
    InternalFileOutput:
      type: object
      properties:
        url:
          type: string
          example: https://s3.amazonaws.com/...
        expiryTime:
          type: string
          example: '2024-01-15T10:30:00.000Z'
      required:
        - url
        - expiryTime
    DicebearIconPayloadOutput:
      type: object
      properties:
        style:
          type: string
          enum:
            - notionists-neutral
        seed:
          type: string
          example: 0256de50-f90c-49a8-81f0-3988b2b89d8d
        backgroundColor:
          type: string
          example: b6e3f4,b6e3f4
          description: Hex color(s), comma-separated for gradients
        options:
          $ref: '#/components/schemas/DicebearIconOptionsOutput'
      required:
        - style
        - seed
        - backgroundColor
    OrgHomeShortcutOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - bundle
            - agent
        id:
          type: string
        visible:
          type: boolean
      required:
        - type
        - id
        - visible
    OrgObjectKindSettingsInput:
      type: object
      properties:
        properties:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/OrgObjectFieldSettingsInput'
        relations:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/OrgObjectFieldSettingsInput'
    DicebearIconOptionsOutput:
      type: object
      properties:
        brows:
          type: string
        eyes:
          type: string
        glasses:
          type: string
        lips:
          type: string
        nose:
          type: string
        flip:
          type: boolean
        rotate:
          type: number
        scale:
          type: number
        radius:
          type: number
        size:
          type: number
        backgroundType:
          type: string
          enum:
            - solid
            - gradientLinear
        backgroundRotation:
          type: array
          items:
            type: number
        translateX:
          type: number
        translateY:
          type: number
        clip:
          type: boolean
        randomizeIds:
          type: boolean
    OrgObjectFieldSettingsInput:
      type: object
      properties:
        visible:
          type: boolean
        label:
          type: string
        icon:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/LucideIconInput'
            - $ref: '#/components/schemas/EmptyIconInput'
        settings:
          type: object
          additionalProperties: true
    LucideIconInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - lucide
          example: lucide
        lucide:
          type: string
          example: workflow
      required:
        - type
        - lucide
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://id.local.base39.cloud/oauth2/authorize
          tokenUrl: https://id.local.base39.cloud/oauth2/token
          scopes:
            profile: Read user profile
            email: Read user email
            openid: OpenID authentication
      description: OAuth2 Authorization Code flow

````