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

# Update Organization

> Update specific fields of an existing organization without changing everything.

The `organizationId` in the URL path should be your `externalOrganizationId`. Only the fields you include in your request will be updated—everything else stays the same. Perfect for targeted updates like renaming a company or updating properties.

Prefer a simpler approach? Use `POST /organizations` instead—it automatically creates or updates the organization, so you don't need to know if it exists yet.



## OpenAPI

````yaml https://www.greenflash.ai/api/openapi put /organizations/{organizationId}
openapi: 3.1.0
info:
  title: Greenflash API Reference
  version: 1.0.0
  description: >-
    Greenflash endpoints for capturing interactions, managing prompts, and
    identifying users.
servers:
  - url: https://www.greenflash.ai/api/v1
    description: Greenflash API v1
security: []
tags:
  - name: Interactions
    description: Capture interactions between users and AI
  - name: Business Events
    description: Capture business events
  - name: Analytics
    description: Understand chat and agentic interactions analyses
  - name: Inbox
    description: Review flagged conversations
  - name: Segments
    description: Manage user segments
  - name: Prompts
    description: Manage prompts
  - name: Chat
    description: Stream chat and agentic conversations
  - name: Models
    description: Manage AI models
  - name: Products
    description: Manage products
  - name: Users
    description: Manage users
  - name: Organizations
    description: Manage organizations
paths:
  /organizations/{organizationId}:
    put:
      tags:
        - Users
        - Organizations
      summary: Update Organization
      description: >-
        Update specific fields of an existing organization without changing
        everything.


        The `organizationId` in the URL path should be your
        `externalOrganizationId`. Only the fields you include in your request
        will be updated—everything else stays the same. Perfect for targeted
        updates like renaming a company or updating properties.


        Prefer a simpler approach? Use `POST /organizations` instead—it
        automatically creates or updates the organization, so you don't need to
        know if it exists yet.
      parameters:
        - schema:
            type: string
            description: >-
              Your external organization ID (the externalOrganizationId used
              when creating the organization)
          required: true
          description: >-
            Your external organization ID (the externalOrganizationId used when
            creating the organization)
          name: organizationId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrganizationRequest'
            example:
              name: Updated Organization Name
              properties:
                industry: fintech
                size: enterprise
      responses:
        '200':
          description: Organization updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateOrganizationResponse'
              example:
                success: true
                organization:
                  id: org-001
                  externalId: org-456
                  name: Updated Organization Name
                  properties:
                    industry: fintech
                    size: enterprise
                  createdAt: '2025-07-01T12:00:00Z'
                  updatedAt: '2025-09-27T14:30:00Z'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for organization update operations.
              example:
                success: false
                error: >-
                  Organization not found. Use POST /organizations to create a
                  new organization.
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for organization update operations.
              example:
                success: false
                error: Internal server error
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Greenflash from 'greenflash';


            const client = new Greenflash({
              apiKey: process.env['GREENFLASH_API_KEY'], // This is the default and can be omitted
            });


            const updateOrganizationResponse = await
            client.organizations.update('organizationId', {
              name: 'Updated Organization Name',
              properties: { industry: 'fintech', size: 'enterprise' },
            });


            console.log(updateOrganizationResponse.organization);
        - lang: Python
          source: |-
            import os
            from greenflash import Greenflash

            client = Greenflash(
                api_key=os.environ.get("GREENFLASH_API_KEY"),  # This is the default and can be omitted
            )
            update_organization_response = client.organizations.update(
                organization_id="organizationId",
                name="Updated Organization Name",
                properties={
                    "industry": "fintech",
                    "size": "enterprise",
                },
            )
            print(update_organization_response.organization)
components:
  schemas:
    UpdateOrganizationRequest:
      type: object
      properties:
        name:
          type: string
          description: The organization's name.
        properties:
          type: object
          additionalProperties: {}
          description: Custom organization properties.
      description: Request payload for updating an organization.
    UpdateOrganizationResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the API call was successful.
        organization:
          $ref: '#/components/schemas/TenantOrganization'
      required:
        - success
        - organization
      description: Success response for organization update.
    TenantOrganization:
      type: object
      properties:
        id:
          type: string
          description: The Greenflash organization ID.
        externalId:
          type: string
          description: Your external organization ID.
        name:
          type: string
          description: The organization name.
        properties:
          type: object
          additionalProperties: {}
          description: Custom organization properties.
        createdAt:
          type: string
          format: date-time
          description: When the organization was first created.
        updatedAt:
          type: string
          format: date-time
          description: When the organization was last updated.
      required:
        - id
        - properties
      description: The organization that was created or updated.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````