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

# Organizations

**Organizations** represent each business/client/company/entity that you analyze with MindBridge. Organizations house all of your client's engagements (audit/analysis), account mappings, and any other data imported into MindBridge for that client.

Please see [Get Started](/sdks/python/get-started) for information on how to interact with the MindBridge API with a `Server`.

## Create a new organization

Like the web app you can [Create a new organization](https://support.mindbridge.ai/hc/en-us/articles/360057583033-Organization-management#01G66KHAB9Y1G7JKPK4PF6CD0C) using the MindBridge API Python Client.

<CodeGroup dropdown>
  ```python theme={null}
  organization = mbapi.OrganizationItem(name="The Organization Name")  # (1)!
  organization = server.organizations.create(organization)  # (2)!
  print(f"{organization.id=}\n{organization.name=}")
  #> organization.id='6793acbf7bd84f04412b114e'
  #> organization.name='The Organization Name'
  ```
</CodeGroup>

1. It's assumed you've imported the module with `import mindbridgeapi as mbapi`
2. See [Get Started](/sdks/python/get-started) for how to create the `server`

The organization is now created in the web app and the create action returns information about the created organization, including its `id`.

## Retrieving an organization by ID

You can retrieve an existing organization, identified by its ID, as shown here using the ID of the organization created above.

<CodeGroup dropdown>
  ```python theme={null}
  organization = server.organizations.get_by_id("6793acbf7bd84f04412b114e")
  print(f"{organization.id=}\n{organization.name=}")
  #> organization.id='6793acbf7bd84f04412b114e'
  #> organization.name='The Organization Name'
  ```
</CodeGroup>

## Querying organizations

Query organizations, optionally applying a filter. Organizations can be searched using the MindBridge Query Language, detailed in the MindBridge API Reference. The `get` function returns a [generator](https://docs.python.org/3/reference/expressions.html#generator-expressions), allowing you to iterate over search results or use the [`next()`](https://docs.python.org/3/library/functions.html#next) function.

<CodeGroup dropdown>
  ```python theme={null}
  try:
      organization = next(server.organizations.get({"name": "The Organization Name"}))
      print(f"{organization.id=}\n{organization.name=}")
  except StopIteration:
      print("No matching organization found.")
  ```
</CodeGroup>
