Skip to main content
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 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 using the MindBridge API Python Client.
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'
  1. It’s assumed you’ve imported the module with import mindbridgeapi as mbapi
  2. See 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.
organization = server.organizations.get_by_id("6793acbf7bd84f04412b114e")
print(f"{organization.id=}\n{organization.name=}")
#> organization.id='6793acbf7bd84f04412b114e'
#> organization.name='The Organization Name'

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, allowing you to iterate over search results or use the next() function.
try:
    organization = next(server.organizations.get({"name": "The Organization Name"}))
    print(f"{organization.id=}\n{organization.name=}")
except StopIteration:
    print("No matching organization found.")