### Add and Run Examples Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Add new Python example files to the 'examples/' directory and make them executable. Run examples against your API. ```py # add an example to examples/.py #!/usr/bin/env -S uv run python … ``` ```sh $ chmod +x examples/.py # run the example against your api $ ./examples/.py ``` -------------------------------- ### Install from Git Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Install the micro-sdk-py package directly from its GitHub repository using pip. ```sh $ pip install git+ssh://git@github.com/micro-so/micro-sdk-py.git ``` -------------------------------- ### Install Micro Python SDK Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Install the micro_so package from PyPI using pip. ```sh pip install micro_so ``` -------------------------------- ### Build and Install Wheel File Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Build a distributable wheel file for the library and then install it using pip. ```sh $ uv build # or $ python -m build ``` ```sh $ pip install ./path-to-wheel-file.whl ``` -------------------------------- ### Install Micro SDK with aiohttp support Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Install the micro_so package with the aiohttp extra for improved concurrency performance in asynchronous operations. ```sh pip install micro_so[aiohttp] ``` -------------------------------- ### Sync Dependencies with uv Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Install all project dependencies, including extras, using uv. ```sh $ uv sync --all-extras ``` -------------------------------- ### Install Development Dependencies with pip Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Install development dependencies using a pip lock file if uv is not used. ```sh $ pip install -r requirements-dev.lock ``` -------------------------------- ### Get Micro SDK Python Version Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Use this snippet to check the currently installed version of the Micro SDK Python library at runtime. This is useful for debugging or ensuring you are using the expected version. ```python import micro_so print(micro_so.__version__) ``` -------------------------------- ### Asynchronous Micro SDK Usage Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Instantiate the asynchronous AsyncMicro client and make an awaited query to the deals object. This example uses asyncio to run the main function. ```python import os import asyncio from micro_so import AsyncMicro client = AsyncMicro( team_id="My Team ID", api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) async def main() -> None: response = await client.prism.objects.deals.query( query={"select": ["id", "name"]}, ) print(response.data) asyncio.run(main()) ``` -------------------------------- ### Get Action Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use this method to retrieve a specific action. Requires action ID and team ID. ```python client.prism.objects.actions.get(action_id, *, team_id) -> ActionGetResponse ``` -------------------------------- ### View Get Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Retrieves details of a specific view. Requires view ID, team ID, and view object type. ```APIDOC ## GET /v2/prism/{teamId}/view/{viewObjectType}/{viewId} ### Description Retrieves details of a specific view. ### Method GET ### Endpoint /v2/prism/{teamId}/view/{viewObjectType}/{viewId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **viewObjectType** (string) - Required - The type of the view object. - **viewId** (string) - Required - The ID of the view. ``` -------------------------------- ### Get Contact Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Retrieves details of a specific contact identified by its ID within a team. ```APIDOC ## GET /v2/prism/{teamId}/contact/{contactId} ### Description Retrieves details of a specific contact identified by its ID within a team. ### Method GET ### Endpoint /v2/prism/{teamId}/contact/{contactId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **contactId** (string) - Required - The ID of the contact. ``` -------------------------------- ### Get Grant Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use this method to retrieve the grant for an action. Requires action ID and team ID. ```python client.prism.objects.actions.grant.get(action_id, *, team_id) -> GrantGetResponse ``` -------------------------------- ### Access Raw Response Data with Micro SDK Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Use `.with_raw_response.` to access the raw `APIResponse` object, including headers. Call `.parse()` to get the data that would normally be returned. ```python from micro_so import Micro client = Micro( team_id="My Team ID", ) response = client.prism.objects.deals.with_raw_response.query( query={ "select": ["id", "name"] }, ) print(response.headers.get('X-My-Header')) deal = response.parse() # get the object that `prism.objects.deals.query()` would have returned print(deal.data) ``` -------------------------------- ### Get Organization Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Retrieves details of a specific organization identified by its ID within a given team. ```APIDOC ## GET /v2/prism/{teamId}/organization/{organizationId} ### Description Retrieves details of a specific organization. ### Method GET ### Endpoint /v2/prism/{teamId}/organization/{organizationId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team the organization belongs to. - **organizationId** (string) - Required - The ID of the organization to retrieve. ### Response #### Success Response (200) - **OrganizationGetResponse** - The response object containing details of the organization. ``` -------------------------------- ### Grant Get Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Retrieves details of a specific grant event. Requires event ID and team ID. ```APIDOC ## GET /v2/prism/grant/{teamId}/event/{eventId} ### Description Retrieves details of a specific grant event. ### Method GET ### Endpoint /v2/prism/grant/{teamId}/event/{eventId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **eventId** (string) - Required - The ID of the event. ``` -------------------------------- ### Get Identity Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Retrieves details of a specific identity identified by its ID within a specified team. ```APIDOC ## GET /v2/prism/{teamId}/identity/{identityId} ### Description Retrieves details of a specific identity identified by its ID within a specified team. ### Method GET ### Endpoint /v2/prism/{teamId}/identity/{identityId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **identityId** (string) - Required - The ID of the identity to retrieve. ``` -------------------------------- ### Get Prism Contact Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Retrieve a specific contact by its ID within a team. Requires contact_id and team_id. ```python client.prism.objects.contacts.get(contact_id, *, team_id) ``` -------------------------------- ### Get Prism Metadata Properties Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Retrieves properties for metadata associated with a specific team and object type. ```APIDOC ## GET /v2/prism/metadata/properties/{teamId}/{objectType} ### Description Retrieves properties for metadata associated with a specific team and object type. ### Method GET ### Endpoint /v2/prism/metadata/properties/{teamId}/{objectType} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **objectType** (string) - Required - The type of the object. ### Response #### Success Response (200) - **MetadataListResponse** (object) - Contains a list of metadata properties. ``` -------------------------------- ### Bootstrap Environment with uv Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Run this script to automatically provision a Python environment using uv. ```sh $ ./scripts/bootstrap ``` -------------------------------- ### Synchronous Micro SDK Usage Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Instantiate the synchronous Micro client and make a query to the deals object. It's recommended to use environment variables for API keys. ```python import os from micro_so import Micro client = Micro( team_id="My Team ID", api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.query( query={"select": ["id", "name"]}, ) print(response.data) ``` -------------------------------- ### Enable Micro SDK Logging Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Enable logging by setting the environment variable MICRO_LOG to 'info' for general logs or 'debug' for verbose output. ```shell $ export MICRO_LOG=info ``` -------------------------------- ### Run Tests Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Execute the project's test suite using the provided script. ```sh $ ./scripts/test ``` -------------------------------- ### Configure Micro SDK HTTP Client Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Override the default `httpx` client by passing a `DefaultHttpxClient` instance to the `http_client` parameter during `Micro` client initialization. This allows for customization like proxies and transports. ```python import httpx from micro_so import Micro, DefaultHttpxClient client = Micro( team_id="My Team ID", # Or use the `MICRO_BASE_URL` env var base_url="http://my.test.server.example.com:8083", http_client=DefaultHttpxClient( proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), ) ``` -------------------------------- ### Async Micro SDK Usage with aiohttp Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Instantiate the AsyncMicro client using DefaultAioHttpClient for the HTTP backend. The client is managed within an async context manager. ```python import os import asyncio from micro_so import DefaultAioHttpClient from micro_so import AsyncMicro async def main() -> None: async with AsyncMicro( team_id="My Team ID", api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: response = await client.prism.objects.deals.query( query={"select": ["id", "name"]}, ) print(response.data) asyncio.run(main()) ``` -------------------------------- ### Bulk Create Actions Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use this method to create multiple actions at once. Requires team ID and parameters for bulk creation. ```python client.prism.objects.actions.bulk_create(*, team_id, **params) -> ActionBulkCreateResponse ``` -------------------------------- ### Manage HTTP Resources with Micro SDK Context Manager Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Use the `Micro` client as a context manager (`with Micro(...) as client:`) to ensure the underlying HTTP client is properly closed when exiting the block. ```python from micro_so import Micro with Micro( team_id="My Team ID", ) as client: # make requests here ... ``` -------------------------------- ### Create Action Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use this method to create a new action. Requires team ID and action parameters. ```python client.prism.objects.actions.create(*, team_id, **params) -> ActionCreateResponse ``` -------------------------------- ### Activate Virtual Environment Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Manually activate the virtual environment to run Python scripts without the 'uv run' prefix. ```sh # manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work $ source .venv/bin/activate ``` -------------------------------- ### Configure Default Request Timeout Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Set a default timeout for all requests when initializing the Micro client. The default is 1 minute. Accepts a float for seconds or an httpx.Timeout object for granular control. ```python from micro_so import Micro # Configure the default for all requests: client = Micro( team_id="My Team ID", # 20 seconds (default is 1 minute) timeout=20.0, ) ``` ```python client = Micro( team_id="My Team ID", timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), ) ``` -------------------------------- ### Bulk Create Contacts Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Imports multiple contacts at once for a given team. ```APIDOC ## POST /v2/prism/{teamId}/contact/import ### Description Imports multiple contacts at once for a given team. ### Method POST ### Endpoint /v2/prism/{teamId}/contact/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for bulk creating contacts. ``` -------------------------------- ### Query Objects with Nested Parameters Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Use TypedDict for nested request parameters when querying objects. Ensure the Micro client is initialized with your team ID. ```python from micro_so import Micro client = Micro( team_id="My Team ID", ) response = client.prism.objects.deals.query( query={\"select\": [\"string\"]}, ) print(response.query) ``` -------------------------------- ### Publish PyPI Manually Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Manually release a package to PyPI by running the provided script with a PYPI_TOKEN set in the environment. ```sh bin/publish-pypi ``` -------------------------------- ### Bulk Create Organizations Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Imports multiple organizations at once for a specified team. Accepts a batch of organization data. ```APIDOC ## POST /v2/prism/{teamId}/organization/import ### Description Imports multiple organizations in bulk. ### Method POST ### Endpoint /v2/prism/{teamId}/organization/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team to import organizations into. #### Request Body - **params** (object) - Required - Parameters for bulk creation. Refer to `organization_bulk_create_params.py` for details. ### Response #### Success Response (200) - **OrganizationBulkCreateResponse** - The response object containing details of the bulk creation operation. ``` -------------------------------- ### Deal Management Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Methods for managing deals within the Micro SDK. ```APIDOC ## POST /v2/prism/{teamId}/deal ### Description Creates a new deal. ### Method POST ### Endpoint /v2/prism/{teamId}/deal ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for creating a deal. ### Response #### Success Response (200) - **DealCreateResponse** (object) - Details of the created deal. ``` ```APIDOC ## PATCH /v2/prism/{teamId}/deal/{dealId} ### Description Updates an existing deal. ### Method PATCH ### Endpoint /v2/prism/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal. #### Request Body - **params** (object) - Required - Parameters for updating the deal. ### Response #### Success Response (200) - **DealUpdateResponse** (object) - Details of the updated deal. ``` ```APIDOC ## DELETE /v2/prism/{teamId}/deal/{dealId} ### Description Deletes a deal. ### Method DELETE ### Endpoint /v2/prism/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal. ### Response #### Success Response (200) - None ``` ```APIDOC ## POST /v2/prism/{teamId}/deal/import ### Description Imports deals in bulk. ### Method POST ### Endpoint /v2/prism/{teamId}/deal/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for bulk deal creation. ### Response #### Success Response (200) - **DealBulkCreateResponse** (object) - Details of the bulk deal creation. ``` ```APIDOC ## POST /v2/prism/{teamId}/deal/{dealId}/duplicate ### Description Duplicates a deal. ### Method POST ### Endpoint /v2/prism/{teamId}/deal/{dealId}/duplicate ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal to duplicate. ### Response #### Success Response (200) - **DealDuplicateResponse** (object) - Details of the duplicated deal. ``` ```APIDOC ## GET /v2/prism/{teamId}/deal/{dealId} ### Description Retrieves a specific deal. ### Method GET ### Endpoint /v2/prism/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal. ### Response #### Success Response (200) - **DealGetResponse** (object) - Details of the retrieved deal. ``` ```APIDOC ## POST /v2/prism/query/{teamId}/deal ### Description Queries deals based on provided parameters. ### Method POST ### Endpoint /v2/prism/query/{teamId}/deal ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Query parameters for deals. ### Response #### Success Response (200) - **DealQueryResponse** (object) - Results of the deal query. ``` ```APIDOC ## POST /v2/prism/{teamId}/deal/{dealId}/restore ### Description Restores a deleted deal. ### Method POST ### Endpoint /v2/prism/{teamId}/deal/{dealId}/restore ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal to restore. ### Response #### Success Response (200) - **DealRestoreResponse** (object) - Details of the restored deal. ``` -------------------------------- ### Bulk Create Prism Contacts Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Import multiple contacts at once for a given team. Requires team_id and a list of contacts in params. ```python client.prism.objects.contacts.bulk_create(*, team_id, **params) ``` -------------------------------- ### List Prism Metadata Properties Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use the client to list metadata properties for a given team and object type. Requires specifying the object_type and team_id. ```python client.prism.metadata.list(object_type, *, team_id, **params) ``` -------------------------------- ### Format Code Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Automatically format the code and fix ruff issues. ```sh $ ./scripts/format ``` -------------------------------- ### Import Action Types Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Imports necessary types for working with actions in the Micro SDK. ```python from micro_so.types.prism.objects import ( Action, ActionCreateResponse, ActionUpdateResponse, ActionBulkCreateResponse, ActionDuplicateResponse, ActionGetResponse, ActionQueryResponse, ActionRestoreResponse, ) ``` -------------------------------- ### Import Prism Metadata List Response Type Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Import the type for responses when listing Prism metadata. ```python from micro_so.types.prism import MetadataListResponse ``` -------------------------------- ### View Create Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Creates a new view. Requires the object type of the view and the team ID, with optional parameters for view configuration. ```APIDOC ## POST /v2/prism/{teamId}/view/{viewObjectType} ### Description Creates a new view. ### Method POST ### Endpoint /v2/prism/{teamId}/view/{viewObjectType} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **viewObjectType** (string) - Required - The type of the view object. #### Request Body - **params** (object) - Optional - Additional parameters for creating the view. ``` -------------------------------- ### Make Undocumented Requests with Micro SDK Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Use `client.post` (or other HTTP verbs) to make requests to undocumented endpoints. Client options like retries are respected. ```python import httpx response = client.post( "/foo", cast_to=httpx.Response, body={"my_param": True}, ) print(response.headers.get("x-foo")) ``` -------------------------------- ### Query Actions Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use this method to query actions based on provided parameters. Requires team ID. ```python client.prism.objects.actions.query(*, team_id, **params) -> ActionQueryResponse ``` -------------------------------- ### Import Prism Object Properties Type Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Import the base properties type for Prism objects. ```python from micro_so.types import PrismObjectProperties ``` -------------------------------- ### Lint Code Source: https://github.com/micro-so/micro-sdk-py/blob/main/CONTRIBUTING.md Run the linter to check for code style and potential issues. ```sh $ ./scripts/lint ``` -------------------------------- ### Configure Per-Request Max Retries Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Override the default retry settings for a specific request using the `with_options` method. ```python client.with_options(max_retries=5).prism.objects.deals.query( query={\"select\": [\"id\", \"name\"]}, ) ``` -------------------------------- ### Import Prism Contact Types Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Import various types related to Prism contact objects, including responses for creation, update, duplication, and retrieval. ```python from micro_so.types.prism.objects import ( Contact, ContactCreateResponse, ContactUpdateResponse, ContactBulkCreateResponse, ContactDuplicateResponse, ContactGetResponse, ContactQueryResponse, ContactRestoreResponse, ) ``` -------------------------------- ### Import Grant Update Types Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Imports necessary types for updating grants in the Micro SDK. ```python from micro_so.types.prism.objects.actions import GrantUpdateResponse, GrantGetResponse ``` -------------------------------- ### Configure Per-Request Timeout Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Override the default timeout for a specific request using the `with_options` method. ```python client.with_options(timeout=5.0).prism.objects.deals.query( query={\"select\": [\"id\", \"name\"]}, ) ``` -------------------------------- ### Configure Default Max Retries for Micro SDK Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Set the default number of retries for all requests when initializing the Micro client. The default value is 2. ```python from micro_so import Micro # Configure the default for all requests: client = Micro( team_id="My Team ID", # default is 2 max_retries=0, ) ``` -------------------------------- ### Create Organization Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Creates a new organization within a specified team. Accepts various parameters for organization details. ```APIDOC ## POST /v2/prism/{teamId}/organization ### Description Creates a new organization. ### Method POST ### Endpoint /v2/prism/{teamId}/organization ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team to create the organization in. #### Request Body - **params** (object) - Required - Parameters for creating the organization. Refer to `organization_create_params.py` for details. ### Response #### Success Response (200) - **OrganizationCreateResponse** - The response object containing details of the created organization. ``` -------------------------------- ### Stream Response Data with Micro SDK Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Use `.with_streaming_response` with a context manager to stream the response body. The body is only read when methods like `.iter_lines()` are called. ```python with client.prism.objects.deals.with_streaming_response.query( query={"select": ["id", "name"]}, ) as response: print(response.headers.get("X-My-Header")) for line in response.iter_lines(): print(line) ``` -------------------------------- ### Event Management Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Methods for retrieving and querying events. ```APIDOC ## GET /v2/prism/{teamId}/event/{eventId} ### Description Retrieves a specific event by its ID within a team. ### Method GET ### Endpoint /v2/prism/{teamId}/event/{eventId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **eventId** (string) - Required - The ID of the event to retrieve. ### Response #### Success Response (200) - **EventGetResponse** - The response object containing the event details. ``` ```APIDOC ## POST /v2/prism/query/{teamId}/event ### Description Queries events within a specified team based on provided parameters. ### Method POST ### Endpoint /v2/prism/query/{teamId}/event ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for querying events. Refer to `micro_so.types.prism.objects.event_query_params` for details. ### Response #### Success Response (200) - **EventQueryResponse** - The response object containing the query results. ``` -------------------------------- ### Create Contact Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Creates a new contact within a specified team. ```APIDOC ## POST /v2/prism/{teamId}/contact ### Description Creates a new contact within a specified team. ### Method POST ### Endpoint /v2/prism/{teamId}/contact ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for creating the contact. ``` -------------------------------- ### Bulk Create Identities Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Imports multiple identities in a bulk operation for a specified team. Accepts a set of parameters for bulk creation. ```APIDOC ## POST /v2/prism/{teamId}/identity/import ### Description Imports multiple identities in a bulk operation for a specified team. ### Method POST ### Endpoint /v2/prism/{teamId}/identity/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for bulk identity creation. Refer to IdentityBulkCreateParams for details. ``` -------------------------------- ### Prism Actions Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Methods for managing Prism actions, including creation, update, deletion, bulk creation, duplication, retrieval, querying, and restoration. ```APIDOC ## POST /v2/prism/{teamId}/action ### Description Creates a new Prism action. ### Method POST ### Endpoint /v2/prism/{teamId}/action ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for creating the action. ### Response #### Success Response (200) - **ActionCreateResponse** (object) - Details of the created action. ``` ```APIDOC ## PATCH /v2/prism/{teamId}/action/{actionId} ### Description Updates an existing Prism action. ### Method PATCH ### Endpoint /v2/prism/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. #### Request Body - **params** (object) - Required - Parameters for updating the action. ### Response #### Success Response (200) - **ActionUpdateResponse** (object) - Details of the updated action. ``` ```APIDOC ## DELETE /v2/prism/{teamId}/action/{actionId} ### Description Deletes a Prism action. ### Method DELETE ### Endpoint /v2/prism/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. ### Response #### Success Response (200) - None ``` ```APIDOC ## POST /v2/prism/{teamId}/action/import ### Description Imports multiple Prism actions in bulk. ### Method POST ### Endpoint /v2/prism/{teamId}/action/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for bulk creation of actions. ### Response #### Success Response (200) - **ActionBulkCreateResponse** (object) - Details of the bulk creation operation. ``` ```APIDOC ## POST /v2/prism/{teamId}/action/{actionId}/duplicate ### Description Duplicates a Prism action. ### Method POST ### Endpoint /v2/prism/{teamId}/action/{actionId}/duplicate ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action to duplicate. ### Response #### Success Response (200) - **ActionDuplicateResponse** (object) - Details of the duplicated action. ``` ```APIDOC ## GET /v2/prism/{teamId}/action/{actionId} ### Description Retrieves a specific Prism action. ### Method GET ### Endpoint /v2/prism/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. ### Response #### Success Response (200) - **ActionGetResponse** (object) - Details of the retrieved action. ``` ```APIDOC ## POST /v2/prism/query/{teamId}/action ### Description Queries Prism actions based on provided parameters. ### Method POST ### Endpoint /v2/prism/query/{teamId}/action ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Query parameters for actions. ### Response #### Success Response (200) - **ActionQueryResponse** (object) - Results of the action query. ``` ```APIDOC ## POST /v2/prism/{teamId}/action/{actionId}/restore ### Description Restores a deleted Prism action. ### Method POST ### Endpoint /v2/prism/{teamId}/action/{actionId}/restore ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action to restore. ### Response #### Success Response (200) - **ActionRestoreResponse** (object) - Details of the restored action. ``` -------------------------------- ### Restore Action Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use this method to restore a deleted action. Requires action ID and team ID. ```python client.prism.objects.actions.restore(action_id, *, team_id) -> ActionRestoreResponse ``` -------------------------------- ### Create Prism Contact Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Create a new contact within a specified team. Requires team_id and contact details in params. ```python client.prism.objects.contacts.create(*, team_id, **params) ``` -------------------------------- ### Document Management Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Methods for creating, updating, deleting, duplicating, retrieving, querying, and restoring documents. ```APIDOC ## POST /v2/prism/{teamId}/document ### Description Creates a new document within a specified team. ### Method POST ### Endpoint /v2/prism/{teamId}/document ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team to which the document belongs. #### Request Body - **params** (object) - Required - Parameters for document creation. Refer to `micro_so.types.prism.objects.document_create_params` for details. ### Response #### Success Response (200) - **DocumentCreateResponse** - The response object containing details of the created document. ``` ```APIDOC ## PATCH /v2/prism/{teamId}/document/{documentId} ### Description Updates an existing document within a specified team. ### Method PATCH ### Endpoint /v2/prism/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to update. #### Request Body - **params** (object) - Required - Parameters for document update. Refer to `micro_so.types.prism.objects.document_update_params` for details. ### Response #### Success Response (200) - **DocumentUpdateResponse** - The response object containing details of the updated document. ``` ```APIDOC ## DELETE /v2/prism/{teamId}/document/{documentId} ### Description Deletes a document from a specified team. ### Method DELETE ### Endpoint /v2/prism/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to delete. ### Response #### Success Response (200) - None ``` ```APIDOC ## POST /v2/prism/{teamId}/document/import ### Description Imports multiple documents in bulk for a specified team. ### Method POST ### Endpoint /v2/prism/{teamId}/document/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for bulk document creation. Refer to `micro_so.types.prism.objects.document_bulk_create_params` for details. ### Response #### Success Response (200) - **DocumentBulkCreateResponse** - The response object containing details of the bulk creation. ``` ```APIDOC ## POST /v2/prism/{teamId}/document/{documentId}/duplicate ### Description Duplicates a specific document within a team. ### Method POST ### Endpoint /v2/prism/{teamId}/document/{documentId}/duplicate ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to duplicate. ### Response #### Success Response (200) - **DocumentDuplicateResponse** - The response object containing details of the duplicated document. ``` ```APIDOC ## GET /v2/prism/{teamId}/document/{documentId} ### Description Retrieves a specific document by its ID within a team. ### Method GET ### Endpoint /v2/prism/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to retrieve. ### Response #### Success Response (200) - **DocumentGetResponse** - The response object containing the document details. ``` ```APIDOC ## POST /v2/prism/query/{teamId}/document ### Description Queries documents within a specified team based on provided parameters. ### Method POST ### Endpoint /v2/prism/query/{teamId}/document ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for querying documents. Refer to `micro_so.types.prism.objects.document_query_params` for details. ### Response #### Success Response (200) - **DocumentQueryResponse** - The response object containing the query results. ``` ```APIDOC ## POST /v2/prism/{teamId}/document/{documentId}/restore ### Description Restores a deleted document by its ID within a team. ### Method POST ### Endpoint /v2/prism/{teamId}/document/{documentId}/restore ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to restore. ### Response #### Success Response (200) - **DocumentRestoreResponse** - The response object containing details of the restored document. ``` -------------------------------- ### Duplicate Action Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use this method to duplicate an existing action. Requires the action ID and team ID of the action to duplicate. ```python client.prism.objects.actions.duplicate(action_id, *, team_id) -> ActionDuplicateResponse ``` -------------------------------- ### Create Identity Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Creates a new identity within a specified team. Accepts various parameters for identity creation. ```APIDOC ## POST /v2/prism/{teamId}/identity ### Description Creates a new identity within a specified team. ### Method POST ### Endpoint /v2/prism/{teamId}/identity ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for identity creation. Refer to IdentityCreateParams for details. ``` -------------------------------- ### Update Action Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use this method to update an existing action. Requires action ID, team ID, and new parameters. ```python client.prism.objects.actions.update(action_id, *, team_id, **params) -> ActionUpdateResponse ``` -------------------------------- ### Record List Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Lists records within a specific view. Requires view ID, team ID, view object type, and optional parameters for filtering and pagination. ```APIDOC ## GET /v2/prism/{teamId}/view/{viewObjectType}/{viewId}/records ### Description Lists records within a specific view. ### Method GET ### Endpoint /v2/prism/{teamId}/view/{viewObjectType}/{viewId}/records ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **viewObjectType** (string) - Required - The type of the view object. - **viewId** (string) - Required - The ID of the view. #### Request Body - **params** (object) - Optional - Additional parameters for listing records. ``` -------------------------------- ### Grant Management Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Methods for managing grants associated with deals. ```APIDOC ## PUT /v2/prism/grant/{teamId}/deal/{dealId} ### Description Updates a grant for a deal. ### Method PUT ### Endpoint /v2/prism/grant/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal. #### Request Body - **params** (object) - Required - Parameters for updating the grant. ### Response #### Success Response (200) - **GrantUpdateResponse** (object) - Details of the updated grant. ``` ```APIDOC ## GET /v2/prism/grant/{teamId}/deal/{dealId} ### Description Retrieves the grant details for a specific deal. ### Method GET ### Endpoint /v2/prism/grant/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal. ### Response #### Success Response (200) - **GrantGetResponse** (object) - Details of the grant. ``` -------------------------------- ### Handle API Errors with Micro SDK Source: https://github.com/micro-so/micro-sdk-py/blob/main/README.md Catch specific API errors like APIConnectionError, RateLimitError, and APIStatusError. All errors inherit from APIError. The library raises subclasses of APIConnectionError for connection issues and APIStatusError for non-success status codes. ```python import micro_so from micro_so import Micro client = Micro( team_id="My Team ID", ) try: client.prism.objects.deals.query( query={\"select\": [\"id\", \"name\"]}, ) except micro_so.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. except micro_so.RateLimitError as e: print("A 429 status code was received; we should back off a bit.") except micro_so.APIStatusError as e: print("Another non-200-range status code was received") print(e.status_code) print(e.response) ``` -------------------------------- ### View Update Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Updates an existing view. Requires view ID, team ID, and view object type, with optional parameters for update details. ```APIDOC ## PATCH /v2/prism/{teamId}/view/{viewObjectType}/{viewId} ### Description Updates an existing view. ### Method PATCH ### Endpoint /v2/prism/{teamId}/view/{viewObjectType}/{viewId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **viewObjectType** (string) - Required - The type of the view object. - **viewId** (string) - Required - The ID of the view. #### Request Body - **params** (object) - Optional - Additional parameters for updating the view. ``` -------------------------------- ### Record Pin Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Pins a record to a view. Requires object ID, team ID, view object type, and view ID. ```APIDOC ## POST /v2/prism/{teamId}/view/{viewObjectType}/{viewId}/records/{objectId} ### Description Pins a record to a view. ### Method POST ### Endpoint /v2/prism/{teamId}/view/{viewObjectType}/{viewId}/records/{objectId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **viewObjectType** (string) - Required - The type of the view object. - **viewId** (string) - Required - The ID of the view. - **objectId** (string) - Required - The ID of the object to pin. ``` -------------------------------- ### Update Grant Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Use this method to update the grant for an action. Requires action ID, path team ID, and grant parameters. ```python client.prism.objects.actions.grant.update(action_id, *, path_team_id, **params) -> GrantUpdateResponse ``` -------------------------------- ### Duplicate Prism Contact Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Create a duplicate of an existing contact within a team. Requires the original contact_id and team_id. ```python client.prism.objects.contacts.duplicate(contact_id, *, team_id) ``` -------------------------------- ### Record Unpin Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Unpins a record from a view. Requires object ID, team ID, view object type, and view ID. ```APIDOC ## DELETE /v2/prism/{teamId}/view/{viewObjectType}/{viewId}/records/{objectId} ### Description Unpins a record from a view. ### Method DELETE ### Endpoint /v2/prism/{teamId}/view/{viewObjectType}/{viewId}/records/{objectId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **viewObjectType** (string) - Required - The type of the view object. - **viewId** (string) - Required - The ID of the view. - **objectId** (string) - Required - The ID of the object to unpin. ``` -------------------------------- ### Document Grant Management Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Methods for updating and retrieving document grants. ```APIDOC ## PUT /v2/prism/grant/{teamId}/document/{documentId} ### Description Updates the grant for a specific document within a team. ### Method PUT ### Endpoint /v2/prism/grant/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document. #### Request Body - **params** (object) - Required - Parameters for updating the grant. Refer to `micro_so.types.prism.objects.documents.grant_update_params` for details. ### Response #### Success Response (200) - **GrantUpdateResponse** - The response object containing details of the updated grant. ``` ```APIDOC ## GET /v2/prism/grant/{teamId}/document/{documentId} ### Description Retrieves the grant information for a specific document within a team. ### Method GET ### Endpoint /v2/prism/grant/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document. ### Response #### Success Response (200) - **GrantGetResponse** - The response object containing the grant details. ``` -------------------------------- ### Restore Organization Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Restores a previously deleted organization identified by its ID within a specific team. ```APIDOC ## POST /v2/prism/{teamId}/organization/{organizationId}/restore ### Description Restores a deleted organization. ### Method POST ### Endpoint /v2/prism/{teamId}/organization/{organizationId}/restore ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team the organization belongs to. - **organizationId** (string) - Required - The ID of the organization to restore. ### Response #### Success Response (200) - **OrganizationRestoreResponse** - The response object containing details of the restored organization. ``` -------------------------------- ### Query Prism Contacts Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Query contacts within a team based on specified parameters. Requires team_id and query parameters in params. ```python client.prism.objects.contacts.query(*, team_id, **params) ``` -------------------------------- ### Prism Action Grants Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Methods for managing grants associated with Prism actions, including updating and retrieving grant information. ```APIDOC ## PUT /v2/prism/grant/{teamId}/action/{actionId} ### Description Updates the grant for a specific Prism action. ### Method PUT ### Endpoint /v2/prism/grant/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. #### Request Body - **params** (object) - Required - Parameters for updating the grant. ### Response #### Success Response (200) - **GrantUpdateResponse** (object) - Details of the updated grant. ``` ```APIDOC ## GET /v2/prism/grant/{teamId}/action/{actionId} ### Description Retrieves the grant information for a specific Prism action. ### Method GET ### Endpoint /v2/prism/grant/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. ### Response #### Success Response (200) - **GrantGetResponse** (object) - Details of the retrieved grant. ``` -------------------------------- ### Restore Prism Contact Source: https://github.com/micro-so/micro-sdk-py/blob/main/api.md Restore a previously deleted contact identified by contact_id within a team. Requires contact_id and team_id. ```python client.prism.objects.contacts.restore(contact_id, *, team_id) ```