# Objects # Contacts ## Create object `prism.objects.contacts.create(ContactCreateParams**kwargs) -> ContactCreateResponse` **post** `/v2/prism/{teamId}/contact` Create object ### Parameters - `team_id: Optional[str]` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class ContactCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) contact = client.prism.objects.contacts.create() print(contact.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type `prism.objects.contacts.list(ContactListParams**kwargs) -> ContactListResponse` **get** `/v2/prism/{teamId}/contact` Convenience list endpoint. Equivalent to `POST /v2/prism/{teamId}/{objectType}/query` with an empty body, plus query-string sugar for the common cases. Any unrecognized query parameter is interpreted as an equality filter on a property of that name; pass arrays for `in`. Values are received as strings, so non-string property filters via this endpoint may not work — use the `query` endpoint for typed comparisons or anything beyond simple equality. ### Parameters - `team_id: Optional[str]` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: Optional[bool]` Include soft-deleted records. Pass the literal string `true`. - `include_total: Optional[bool]` When set to `true`, the response includes a `total` field with the unpaginated row count. Costs an extra pass; prefer `GET .../count` for the unfiltered total. - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50. - `list_id: Optional[str]` Scope properties to a specific list/app. - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. - `sort: Optional[str]` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `class ContactListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) contacts = client.prism.objects.contacts.list() print(contacts.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Get object `prism.objects.contacts.get(strcontact_id, ContactGetParams**kwargs) -> ContactGetResponse` **get** `/v2/prism/{teamId}/contact/{contactId}` Get object ### Parameters - `team_id: Optional[str]` - `contact_id: str` - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `class ContactGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) contact = client.prism.objects.contacts.get( contact_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(contact.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object `prism.objects.contacts.update(strcontact_id, ContactUpdateParams**kwargs) -> ContactUpdateResponse` **patch** `/v2/prism/{teamId}/contact/{contactId}` Patch object ### Parameters - `team_id: Optional[str]` - `contact_id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` - `if_match: Optional[str]` ### Returns - `class ContactUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) contact = client.prism.objects.contacts.update( contact_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(contact.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object `prism.objects.contacts.delete(strcontact_id, ContactDeleteParams**kwargs)` **delete** `/v2/prism/{teamId}/contact/{contactId}` Delete object ### Parameters - `team_id: Optional[str]` - `contact_id: str` - `if_match: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.prism.objects.contacts.delete( contact_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) ``` ## Query `prism.objects.contacts.query(ContactQueryParams**kwargs) -> ContactQueryResponse` **post** `/v2/prism/{teamId}/contact/query` Query ### Parameters - `team_id: Optional[str]` - `query: Query` - `select: Sequence[str]` Property slugs to select. Use dot notation for relationships (e.g. attendee.contact.first_name). `id` is always returned at the top level of each row and does not need to be selected. - `combinator: Optional[Literal["AND", "OR"]]` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When set, `page` and `limit` are derived from the cursor and any explicit values are ignored. - `filter: Optional[Iterable[Dict[str, QueryFilterQueryFilterItem]]]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `class QueryFilterQueryFilterItemPrismQueryFilterEq: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterNe: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterLt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterLte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemContains: …` - `contains: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBeginsWith: …` - `begins_with: str` - `class QueryFilterQueryFilterItemEndsWith: …` - `ends_with: str` - `class QueryFilterQueryFilterItemNotContains: …` - `not_contains: str` - `class QueryFilterQueryFilterItemExists: …` - `exists: bool` - `class QueryFilterQueryFilterItemNotExists: …` - `not_exists: bool` - `class QueryFilterQueryFilterItemIsNull: …` - `is_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIsNotNull: …` - `is_not_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBetween: …` - `between: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIn: …` - `in_: Sequence[str]` - `class QueryFilterQueryFilterItemNotIn: …` - `not_in: Sequence[str]` - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: Optional[str]` - `page: Optional[int]` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: Optional[Iterable[Dict[str, Literal["asc", "desc"]]]]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: Optional[Union[str, Sequence[str]]]` - `str` - `Sequence[str]` - `boxes: Optional[Sequence[str]]` - `cursor: Optional[str]` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: Optional[bool]` - `include_total: Optional[bool]` When true, the response includes a `total` field with the unpaginated row count. Costs an additional pass over the result set — for unfiltered totals prefer `GET /v2/prism/{teamId}/{objectType}/count` instead. - `sources: Optional[Sequence[str]]` ### Returns - `class ContactQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.contacts.query( query={ "select": ["string"] }, ) print(response.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Total record count for an object type `prism.objects.contacts.count(ContactCountParams**kwargs) -> ContactCountResponse` **get** `/v2/prism/{teamId}/contact/count` Returns the total number of records of this object type that the caller can see. Avoids the page-overshoot anti-pattern — clients no longer need to keep paging until `has_more` flips false to discover the total. Currently does not apply query filters; for a filtered total, pass `include_total: true` in a POST `/query` body. ### Parameters - `team_id: Optional[str]` - `list_id: Optional[str]` Scope the count to a specific list/app. ### Returns - `class ContactCountResponse: …` - `total: int` Number of records matching the access scope. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.contacts.count() print(response.total) ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value `prism.objects.contacts.find(strvalue, ContactFindParams**kwargs) -> ContactFindResponse` **get** `/v2/prism/{teamId}/contact/by/{slug}/{value}` Returns the single record whose property `{slug}` equals `{value}`. 404 if nothing matches; 409 if more than one record matches. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `list_id: Optional[str]` Scope the lookup to a specific list/app. ### Returns - `class ContactFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.contacts.find( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value `prism.objects.contacts.upsert(strvalue, ContactUpsertParams**kwargs) -> ContactUpsertResponse` **put** `/v2/prism/{teamId}/contact/by/{slug}/{value}` Idempotent create-or-update keyed on `{slug}={value}`. If exactly one record matches, it is patched and 200 is returned. If none match, a new record is created (with the lookup property set if absent) and 201 is returned. If multiple records match, 409 is returned and you should patch by id instead. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class ContactUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.contacts.upsert( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects `prism.objects.contacts.bulk_create(ContactBulkCreateParams**kwargs) -> ContactBulkCreateResponse` **post** `/v2/prism/{teamId}/contact/import` Import multiple objects in batch. Properties are keyed by slug. Automatically routes based on size: small batches complete synchronously and return 200 with the final `ImportJob`; large batches start an async job, return 202 with `status: processing` and a `Location` header, and can be polled via `GET /v2/prism/{teamId}/imports/{jobId}`. ### Parameters - `team_id: Optional[str]` - `objects: Iterable[PrismObjectPropertiesParam]` Array of objects to import with property values keyed by slug - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `options: Optional[Options]` - `case_insensitive: Optional[bool]` Whether deduplication should be case insensitive - `dedupe_by: Optional[str]` Property slug to deduplicate on - `list_id: Optional[str]` App/CRM ID for context (optional) - `idempotency_key: Optional[str]` ### Returns - `class ContactBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.contacts.bulk_create( objects=[{}], ) print(response.job_id) ``` #### Response ```json { "job_id": "job_id", "status": "complete", "total": 0, "created_at": "2019-12-27T18:11:19.117Z", "error": { "code": "code", "message": "message" }, "expires_at": "2019-12-27T18:11:19.117Z", "failed": 0, "processed": 0, "results": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created": true, "error": { "code": "code", "message": "message" }, "existing": true } ], "succeeded": 0, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Bulk update records (partial success) `prism.objects.contacts.bulk_update(ContactBulkUpdateParams**kwargs) -> ContactBulkUpdateResponse` **post** `/v2/prism/{teamId}/contact/batch/update` Patch up to 100 records in a single call. Each item is attempted independently — failures don't abort the batch. Inspect `results[].status` per item. ### Parameters - `team_id: Optional[str]` - `items: Iterable[Item]` - `id: str` - `idempotency_key: Optional[str]` ### Returns - `class ContactBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.contacts.bulk_update( items=[{ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Bulk delete records (partial success) `prism.objects.contacts.bulk_delete(ContactBulkDeleteParams**kwargs) -> ContactBulkDeleteResponse` **post** `/v2/prism/{teamId}/contact/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Parameters - `team_id: Optional[str]` - `ids: Sequence[str]` - `idempotency_key: Optional[str]` ### Returns - `class ContactBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.contacts.bulk_delete( ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Duplicate object `prism.objects.contacts.duplicate(strcontact_id, ContactDuplicateParams**kwargs) -> ContactDuplicateResponse` **post** `/v2/prism/{teamId}/contact/{contactId}/duplicate` Duplicate object ### Parameters - `team_id: Optional[str]` - `contact_id: str` - `idempotency_key: Optional[str]` ### Returns - `class ContactDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.contacts.duplicate( contact_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object `prism.objects.contacts.restore(strcontact_id, ContactRestoreParams**kwargs) -> ContactRestoreResponse` **post** `/v2/prism/{teamId}/contact/{contactId}/restore` Restore object ### Parameters - `team_id: Optional[str]` - `contact_id: str` - `idempotency_key: Optional[str]` ### Returns - `class ContactRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.contacts.restore( contact_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Contact - `class Contact: …` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` ### Contact Create Response - `class ContactCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Contact List Response - `class ContactListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Contact Get Response - `class ContactGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Contact Update Response - `class ContactUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Contact Query Response - `class ContactQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Contact Count Response - `class ContactCountResponse: …` - `total: int` Number of records matching the access scope. ### Contact Find Response - `class ContactFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Contact Upsert Response - `class ContactUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Contact Bulk Create Response - `class ContactBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Contact Bulk Update Response - `class ContactBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Contact Bulk Delete Response - `class ContactBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Contact Duplicate Response - `class ContactDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Contact Restore Response - `class ContactRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` # Organizations ## Create object `prism.objects.organizations.create(OrganizationCreateParams**kwargs) -> OrganizationCreateResponse` **post** `/v2/prism/{teamId}/organization` Create object ### Parameters - `team_id: Optional[str]` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class OrganizationCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) organization = client.prism.objects.organizations.create() print(organization.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type `prism.objects.organizations.list(OrganizationListParams**kwargs) -> OrganizationListResponse` **get** `/v2/prism/{teamId}/organization` Convenience list endpoint. Equivalent to `POST /v2/prism/{teamId}/{objectType}/query` with an empty body, plus query-string sugar for the common cases. Any unrecognized query parameter is interpreted as an equality filter on a property of that name; pass arrays for `in`. Values are received as strings, so non-string property filters via this endpoint may not work — use the `query` endpoint for typed comparisons or anything beyond simple equality. ### Parameters - `team_id: Optional[str]` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: Optional[bool]` Include soft-deleted records. Pass the literal string `true`. - `include_total: Optional[bool]` When set to `true`, the response includes a `total` field with the unpaginated row count. Costs an extra pass; prefer `GET .../count` for the unfiltered total. - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50. - `list_id: Optional[str]` Scope properties to a specific list/app. - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. - `sort: Optional[str]` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `class OrganizationListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) organizations = client.prism.objects.organizations.list() print(organizations.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Get object `prism.objects.organizations.get(strorganization_id, OrganizationGetParams**kwargs) -> OrganizationGetResponse` **get** `/v2/prism/{teamId}/organization/{organizationId}` Get object ### Parameters - `team_id: Optional[str]` - `organization_id: str` - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `class OrganizationGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) organization = client.prism.objects.organizations.get( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(organization.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object `prism.objects.organizations.update(strorganization_id, OrganizationUpdateParams**kwargs) -> OrganizationUpdateResponse` **patch** `/v2/prism/{teamId}/organization/{organizationId}` Patch object ### Parameters - `team_id: Optional[str]` - `organization_id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` - `if_match: Optional[str]` ### Returns - `class OrganizationUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) organization = client.prism.objects.organizations.update( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(organization.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object `prism.objects.organizations.delete(strorganization_id, OrganizationDeleteParams**kwargs)` **delete** `/v2/prism/{teamId}/organization/{organizationId}` Delete object ### Parameters - `team_id: Optional[str]` - `organization_id: str` - `if_match: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.prism.objects.organizations.delete( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) ``` ## Query `prism.objects.organizations.query(OrganizationQueryParams**kwargs) -> OrganizationQueryResponse` **post** `/v2/prism/{teamId}/organization/query` Query ### Parameters - `team_id: Optional[str]` - `query: Query` - `select: Sequence[str]` Property slugs to select. Use dot notation for relationships (e.g. attendee.contact.first_name). `id` is always returned at the top level of each row and does not need to be selected. - `combinator: Optional[Literal["AND", "OR"]]` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When set, `page` and `limit` are derived from the cursor and any explicit values are ignored. - `filter: Optional[Iterable[Dict[str, QueryFilterQueryFilterItem]]]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `class QueryFilterQueryFilterItemPrismQueryFilterEq: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterNe: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterLt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterLte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemContains: …` - `contains: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBeginsWith: …` - `begins_with: str` - `class QueryFilterQueryFilterItemEndsWith: …` - `ends_with: str` - `class QueryFilterQueryFilterItemNotContains: …` - `not_contains: str` - `class QueryFilterQueryFilterItemExists: …` - `exists: bool` - `class QueryFilterQueryFilterItemNotExists: …` - `not_exists: bool` - `class QueryFilterQueryFilterItemIsNull: …` - `is_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIsNotNull: …` - `is_not_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBetween: …` - `between: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIn: …` - `in_: Sequence[str]` - `class QueryFilterQueryFilterItemNotIn: …` - `not_in: Sequence[str]` - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: Optional[str]` - `page: Optional[int]` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: Optional[Iterable[Dict[str, Literal["asc", "desc"]]]]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: Optional[Union[str, Sequence[str]]]` - `str` - `Sequence[str]` - `boxes: Optional[Sequence[str]]` - `cursor: Optional[str]` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: Optional[bool]` - `include_total: Optional[bool]` When true, the response includes a `total` field with the unpaginated row count. Costs an additional pass over the result set — for unfiltered totals prefer `GET /v2/prism/{teamId}/{objectType}/count` instead. - `sources: Optional[Sequence[str]]` ### Returns - `class OrganizationQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.organizations.query( query={ "select": ["string"] }, ) print(response.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Total record count for an object type `prism.objects.organizations.count(OrganizationCountParams**kwargs) -> OrganizationCountResponse` **get** `/v2/prism/{teamId}/organization/count` Returns the total number of records of this object type that the caller can see. Avoids the page-overshoot anti-pattern — clients no longer need to keep paging until `has_more` flips false to discover the total. Currently does not apply query filters; for a filtered total, pass `include_total: true` in a POST `/query` body. ### Parameters - `team_id: Optional[str]` - `list_id: Optional[str]` Scope the count to a specific list/app. ### Returns - `class OrganizationCountResponse: …` - `total: int` Number of records matching the access scope. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.organizations.count() print(response.total) ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value `prism.objects.organizations.find(strvalue, OrganizationFindParams**kwargs) -> OrganizationFindResponse` **get** `/v2/prism/{teamId}/organization/by/{slug}/{value}` Returns the single record whose property `{slug}` equals `{value}`. 404 if nothing matches; 409 if more than one record matches. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `list_id: Optional[str]` Scope the lookup to a specific list/app. ### Returns - `class OrganizationFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.organizations.find( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value `prism.objects.organizations.upsert(strvalue, OrganizationUpsertParams**kwargs) -> OrganizationUpsertResponse` **put** `/v2/prism/{teamId}/organization/by/{slug}/{value}` Idempotent create-or-update keyed on `{slug}={value}`. If exactly one record matches, it is patched and 200 is returned. If none match, a new record is created (with the lookup property set if absent) and 201 is returned. If multiple records match, 409 is returned and you should patch by id instead. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class OrganizationUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.organizations.upsert( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects `prism.objects.organizations.bulk_create(OrganizationBulkCreateParams**kwargs) -> OrganizationBulkCreateResponse` **post** `/v2/prism/{teamId}/organization/import` Import multiple objects in batch. Properties are keyed by slug. Automatically routes based on size: small batches complete synchronously and return 200 with the final `ImportJob`; large batches start an async job, return 202 with `status: processing` and a `Location` header, and can be polled via `GET /v2/prism/{teamId}/imports/{jobId}`. ### Parameters - `team_id: Optional[str]` - `objects: Iterable[PrismObjectPropertiesParam]` Array of objects to import with property values keyed by slug - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `options: Optional[Options]` - `case_insensitive: Optional[bool]` Whether deduplication should be case insensitive - `dedupe_by: Optional[str]` Property slug to deduplicate on - `list_id: Optional[str]` App/CRM ID for context (optional) - `idempotency_key: Optional[str]` ### Returns - `class OrganizationBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.organizations.bulk_create( objects=[{}], ) print(response.job_id) ``` #### Response ```json { "job_id": "job_id", "status": "complete", "total": 0, "created_at": "2019-12-27T18:11:19.117Z", "error": { "code": "code", "message": "message" }, "expires_at": "2019-12-27T18:11:19.117Z", "failed": 0, "processed": 0, "results": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created": true, "error": { "code": "code", "message": "message" }, "existing": true } ], "succeeded": 0, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Bulk update records (partial success) `prism.objects.organizations.bulk_update(OrganizationBulkUpdateParams**kwargs) -> OrganizationBulkUpdateResponse` **post** `/v2/prism/{teamId}/organization/batch/update` Patch up to 100 records in a single call. Each item is attempted independently — failures don't abort the batch. Inspect `results[].status` per item. ### Parameters - `team_id: Optional[str]` - `items: Iterable[Item]` - `id: str` - `idempotency_key: Optional[str]` ### Returns - `class OrganizationBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.organizations.bulk_update( items=[{ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Bulk delete records (partial success) `prism.objects.organizations.bulk_delete(OrganizationBulkDeleteParams**kwargs) -> OrganizationBulkDeleteResponse` **post** `/v2/prism/{teamId}/organization/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Parameters - `team_id: Optional[str]` - `ids: Sequence[str]` - `idempotency_key: Optional[str]` ### Returns - `class OrganizationBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.organizations.bulk_delete( ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Duplicate object `prism.objects.organizations.duplicate(strorganization_id, OrganizationDuplicateParams**kwargs) -> OrganizationDuplicateResponse` **post** `/v2/prism/{teamId}/organization/{organizationId}/duplicate` Duplicate object ### Parameters - `team_id: Optional[str]` - `organization_id: str` - `idempotency_key: Optional[str]` ### Returns - `class OrganizationDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.organizations.duplicate( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object `prism.objects.organizations.restore(strorganization_id, OrganizationRestoreParams**kwargs) -> OrganizationRestoreResponse` **post** `/v2/prism/{teamId}/organization/{organizationId}/restore` Restore object ### Parameters - `team_id: Optional[str]` - `organization_id: str` - `idempotency_key: Optional[str]` ### Returns - `class OrganizationRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.organizations.restore( organization_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Organization - `class Organization: …` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` ### Organization Create Response - `class OrganizationCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Organization List Response - `class OrganizationListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Organization Get Response - `class OrganizationGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Organization Update Response - `class OrganizationUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Organization Query Response - `class OrganizationQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Organization Count Response - `class OrganizationCountResponse: …` - `total: int` Number of records matching the access scope. ### Organization Find Response - `class OrganizationFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Organization Upsert Response - `class OrganizationUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Organization Bulk Create Response - `class OrganizationBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Organization Bulk Update Response - `class OrganizationBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Organization Bulk Delete Response - `class OrganizationBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Organization Duplicate Response - `class OrganizationDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Organization Restore Response - `class OrganizationRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` # Identities ## Create object `prism.objects.identities.create(IdentityCreateParams**kwargs) -> IdentityCreateResponse` **post** `/v2/prism/{teamId}/identity` Create object ### Parameters - `team_id: Optional[str]` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class IdentityCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) identity = client.prism.objects.identities.create() print(identity.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type `prism.objects.identities.list(IdentityListParams**kwargs) -> IdentityListResponse` **get** `/v2/prism/{teamId}/identity` Convenience list endpoint. Equivalent to `POST /v2/prism/{teamId}/{objectType}/query` with an empty body, plus query-string sugar for the common cases. Any unrecognized query parameter is interpreted as an equality filter on a property of that name; pass arrays for `in`. Values are received as strings, so non-string property filters via this endpoint may not work — use the `query` endpoint for typed comparisons or anything beyond simple equality. ### Parameters - `team_id: Optional[str]` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: Optional[bool]` Include soft-deleted records. Pass the literal string `true`. - `include_total: Optional[bool]` When set to `true`, the response includes a `total` field with the unpaginated row count. Costs an extra pass; prefer `GET .../count` for the unfiltered total. - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50. - `list_id: Optional[str]` Scope properties to a specific list/app. - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. - `sort: Optional[str]` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `class IdentityListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) identities = client.prism.objects.identities.list() print(identities.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Get object `prism.objects.identities.get(stridentity_id, IdentityGetParams**kwargs) -> IdentityGetResponse` **get** `/v2/prism/{teamId}/identity/{identityId}` Get object ### Parameters - `team_id: Optional[str]` - `identity_id: str` - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `class IdentityGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) identity = client.prism.objects.identities.get( identity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(identity.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object `prism.objects.identities.update(stridentity_id, IdentityUpdateParams**kwargs) -> IdentityUpdateResponse` **patch** `/v2/prism/{teamId}/identity/{identityId}` Patch object ### Parameters - `team_id: Optional[str]` - `identity_id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` - `if_match: Optional[str]` ### Returns - `class IdentityUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) identity = client.prism.objects.identities.update( identity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(identity.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object `prism.objects.identities.delete(stridentity_id, IdentityDeleteParams**kwargs)` **delete** `/v2/prism/{teamId}/identity/{identityId}` Delete object ### Parameters - `team_id: Optional[str]` - `identity_id: str` - `if_match: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.prism.objects.identities.delete( identity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) ``` ## Query `prism.objects.identities.query(IdentityQueryParams**kwargs) -> IdentityQueryResponse` **post** `/v2/prism/{teamId}/identity/query` Query ### Parameters - `team_id: Optional[str]` - `query: Query` - `select: Sequence[str]` Property slugs to select. Use dot notation for relationships (e.g. attendee.contact.first_name). `id` is always returned at the top level of each row and does not need to be selected. - `combinator: Optional[Literal["AND", "OR"]]` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When set, `page` and `limit` are derived from the cursor and any explicit values are ignored. - `filter: Optional[Iterable[Dict[str, QueryFilterQueryFilterItem]]]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `class QueryFilterQueryFilterItemPrismQueryFilterEq: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterNe: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterLt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterLte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemContains: …` - `contains: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBeginsWith: …` - `begins_with: str` - `class QueryFilterQueryFilterItemEndsWith: …` - `ends_with: str` - `class QueryFilterQueryFilterItemNotContains: …` - `not_contains: str` - `class QueryFilterQueryFilterItemExists: …` - `exists: bool` - `class QueryFilterQueryFilterItemNotExists: …` - `not_exists: bool` - `class QueryFilterQueryFilterItemIsNull: …` - `is_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIsNotNull: …` - `is_not_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBetween: …` - `between: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIn: …` - `in_: Sequence[str]` - `class QueryFilterQueryFilterItemNotIn: …` - `not_in: Sequence[str]` - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: Optional[str]` - `page: Optional[int]` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: Optional[Iterable[Dict[str, Literal["asc", "desc"]]]]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: Optional[Union[str, Sequence[str]]]` - `str` - `Sequence[str]` - `boxes: Optional[Sequence[str]]` - `cursor: Optional[str]` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: Optional[bool]` - `include_total: Optional[bool]` When true, the response includes a `total` field with the unpaginated row count. Costs an additional pass over the result set — for unfiltered totals prefer `GET /v2/prism/{teamId}/{objectType}/count` instead. - `sources: Optional[Sequence[str]]` ### Returns - `class IdentityQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.identities.query( query={ "select": ["string"] }, ) print(response.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Total record count for an object type `prism.objects.identities.count(IdentityCountParams**kwargs) -> IdentityCountResponse` **get** `/v2/prism/{teamId}/identity/count` Returns the total number of records of this object type that the caller can see. Avoids the page-overshoot anti-pattern — clients no longer need to keep paging until `has_more` flips false to discover the total. Currently does not apply query filters; for a filtered total, pass `include_total: true` in a POST `/query` body. ### Parameters - `team_id: Optional[str]` - `list_id: Optional[str]` Scope the count to a specific list/app. ### Returns - `class IdentityCountResponse: …` - `total: int` Number of records matching the access scope. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.identities.count() print(response.total) ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value `prism.objects.identities.find(strvalue, IdentityFindParams**kwargs) -> IdentityFindResponse` **get** `/v2/prism/{teamId}/identity/by/{slug}/{value}` Returns the single record whose property `{slug}` equals `{value}`. 404 if nothing matches; 409 if more than one record matches. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `list_id: Optional[str]` Scope the lookup to a specific list/app. ### Returns - `class IdentityFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.identities.find( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value `prism.objects.identities.upsert(strvalue, IdentityUpsertParams**kwargs) -> IdentityUpsertResponse` **put** `/v2/prism/{teamId}/identity/by/{slug}/{value}` Idempotent create-or-update keyed on `{slug}={value}`. If exactly one record matches, it is patched and 200 is returned. If none match, a new record is created (with the lookup property set if absent) and 201 is returned. If multiple records match, 409 is returned and you should patch by id instead. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class IdentityUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.identities.upsert( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects `prism.objects.identities.bulk_create(IdentityBulkCreateParams**kwargs) -> IdentityBulkCreateResponse` **post** `/v2/prism/{teamId}/identity/import` Import multiple objects in batch. Properties are keyed by slug. Automatically routes based on size: small batches complete synchronously and return 200 with the final `ImportJob`; large batches start an async job, return 202 with `status: processing` and a `Location` header, and can be polled via `GET /v2/prism/{teamId}/imports/{jobId}`. ### Parameters - `team_id: Optional[str]` - `objects: Iterable[PrismObjectPropertiesParam]` Array of objects to import with property values keyed by slug - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `options: Optional[Options]` - `case_insensitive: Optional[bool]` Whether deduplication should be case insensitive - `dedupe_by: Optional[str]` Property slug to deduplicate on - `list_id: Optional[str]` App/CRM ID for context (optional) - `idempotency_key: Optional[str]` ### Returns - `class IdentityBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.identities.bulk_create( objects=[{}], ) print(response.job_id) ``` #### Response ```json { "job_id": "job_id", "status": "complete", "total": 0, "created_at": "2019-12-27T18:11:19.117Z", "error": { "code": "code", "message": "message" }, "expires_at": "2019-12-27T18:11:19.117Z", "failed": 0, "processed": 0, "results": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created": true, "error": { "code": "code", "message": "message" }, "existing": true } ], "succeeded": 0, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Bulk update records (partial success) `prism.objects.identities.bulk_update(IdentityBulkUpdateParams**kwargs) -> IdentityBulkUpdateResponse` **post** `/v2/prism/{teamId}/identity/batch/update` Patch up to 100 records in a single call. Each item is attempted independently — failures don't abort the batch. Inspect `results[].status` per item. ### Parameters - `team_id: Optional[str]` - `items: Iterable[Item]` - `id: str` - `idempotency_key: Optional[str]` ### Returns - `class IdentityBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.identities.bulk_update( items=[{ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Bulk delete records (partial success) `prism.objects.identities.bulk_delete(IdentityBulkDeleteParams**kwargs) -> IdentityBulkDeleteResponse` **post** `/v2/prism/{teamId}/identity/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Parameters - `team_id: Optional[str]` - `ids: Sequence[str]` - `idempotency_key: Optional[str]` ### Returns - `class IdentityBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.identities.bulk_delete( ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Duplicate object `prism.objects.identities.duplicate(stridentity_id, IdentityDuplicateParams**kwargs) -> IdentityDuplicateResponse` **post** `/v2/prism/{teamId}/identity/{identityId}/duplicate` Duplicate object ### Parameters - `team_id: Optional[str]` - `identity_id: str` - `idempotency_key: Optional[str]` ### Returns - `class IdentityDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.identities.duplicate( identity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object `prism.objects.identities.restore(stridentity_id, IdentityRestoreParams**kwargs) -> IdentityRestoreResponse` **post** `/v2/prism/{teamId}/identity/{identityId}/restore` Restore object ### Parameters - `team_id: Optional[str]` - `identity_id: str` - `idempotency_key: Optional[str]` ### Returns - `class IdentityRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.identities.restore( identity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Identity - `class Identity: …` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` ### Identity Create Response - `class IdentityCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Identity List Response - `class IdentityListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Identity Get Response - `class IdentityGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Identity Update Response - `class IdentityUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Identity Query Response - `class IdentityQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Identity Count Response - `class IdentityCountResponse: …` - `total: int` Number of records matching the access scope. ### Identity Find Response - `class IdentityFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Identity Upsert Response - `class IdentityUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Identity Bulk Create Response - `class IdentityBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Identity Bulk Update Response - `class IdentityBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Identity Bulk Delete Response - `class IdentityBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Identity Duplicate Response - `class IdentityDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Identity Restore Response - `class IdentityRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` # Deals ## Create object `prism.objects.deals.create(DealCreateParams**kwargs) -> DealCreateResponse` **post** `/v2/prism/{teamId}/deal` Create object ### Parameters - `team_id: Optional[str]` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class DealCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) deal = client.prism.objects.deals.create() print(deal.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type `prism.objects.deals.list(DealListParams**kwargs) -> DealListResponse` **get** `/v2/prism/{teamId}/deal` Convenience list endpoint. Equivalent to `POST /v2/prism/{teamId}/{objectType}/query` with an empty body, plus query-string sugar for the common cases. Any unrecognized query parameter is interpreted as an equality filter on a property of that name; pass arrays for `in`. Values are received as strings, so non-string property filters via this endpoint may not work — use the `query` endpoint for typed comparisons or anything beyond simple equality. ### Parameters - `team_id: Optional[str]` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: Optional[bool]` Include soft-deleted records. Pass the literal string `true`. - `include_total: Optional[bool]` When set to `true`, the response includes a `total` field with the unpaginated row count. Costs an extra pass; prefer `GET .../count` for the unfiltered total. - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50. - `list_id: Optional[str]` Scope properties to a specific list/app. - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. - `sort: Optional[str]` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `class DealListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) deals = client.prism.objects.deals.list() print(deals.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Get object `prism.objects.deals.get(strdeal_id, DealGetParams**kwargs) -> DealGetResponse` **get** `/v2/prism/{teamId}/deal/{dealId}` Get object ### Parameters - `team_id: Optional[str]` - `deal_id: str` - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `class DealGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) deal = client.prism.objects.deals.get( deal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(deal.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object `prism.objects.deals.update(strdeal_id, DealUpdateParams**kwargs) -> DealUpdateResponse` **patch** `/v2/prism/{teamId}/deal/{dealId}` Patch object ### Parameters - `team_id: Optional[str]` - `deal_id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` - `if_match: Optional[str]` ### Returns - `class DealUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) deal = client.prism.objects.deals.update( deal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(deal.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object `prism.objects.deals.delete(strdeal_id, DealDeleteParams**kwargs)` **delete** `/v2/prism/{teamId}/deal/{dealId}` Delete object ### Parameters - `team_id: Optional[str]` - `deal_id: str` - `if_match: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.prism.objects.deals.delete( deal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) ``` ## Query `prism.objects.deals.query(DealQueryParams**kwargs) -> DealQueryResponse` **post** `/v2/prism/{teamId}/deal/query` Query ### Parameters - `team_id: Optional[str]` - `query: Query` - `select: Sequence[str]` Property slugs to select. Use dot notation for relationships (e.g. attendee.contact.first_name). `id` is always returned at the top level of each row and does not need to be selected. - `combinator: Optional[Literal["AND", "OR"]]` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When set, `page` and `limit` are derived from the cursor and any explicit values are ignored. - `filter: Optional[Iterable[Dict[str, QueryFilterQueryFilterItem]]]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `class QueryFilterQueryFilterItemPrismQueryFilterEq: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterNe: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterLt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterLte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemContains: …` - `contains: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBeginsWith: …` - `begins_with: str` - `class QueryFilterQueryFilterItemEndsWith: …` - `ends_with: str` - `class QueryFilterQueryFilterItemNotContains: …` - `not_contains: str` - `class QueryFilterQueryFilterItemExists: …` - `exists: bool` - `class QueryFilterQueryFilterItemNotExists: …` - `not_exists: bool` - `class QueryFilterQueryFilterItemIsNull: …` - `is_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIsNotNull: …` - `is_not_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBetween: …` - `between: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIn: …` - `in_: Sequence[str]` - `class QueryFilterQueryFilterItemNotIn: …` - `not_in: Sequence[str]` - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: Optional[str]` - `page: Optional[int]` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: Optional[Iterable[Dict[str, Literal["asc", "desc"]]]]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: Optional[Union[str, Sequence[str]]]` - `str` - `Sequence[str]` - `boxes: Optional[Sequence[str]]` - `cursor: Optional[str]` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: Optional[bool]` - `include_total: Optional[bool]` When true, the response includes a `total` field with the unpaginated row count. Costs an additional pass over the result set — for unfiltered totals prefer `GET /v2/prism/{teamId}/{objectType}/count` instead. - `sources: Optional[Sequence[str]]` ### Returns - `class DealQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.query( query={ "select": ["string"] }, ) print(response.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Total record count for an object type `prism.objects.deals.count(DealCountParams**kwargs) -> DealCountResponse` **get** `/v2/prism/{teamId}/deal/count` Returns the total number of records of this object type that the caller can see. Avoids the page-overshoot anti-pattern — clients no longer need to keep paging until `has_more` flips false to discover the total. Currently does not apply query filters; for a filtered total, pass `include_total: true` in a POST `/query` body. ### Parameters - `team_id: Optional[str]` - `list_id: Optional[str]` Scope the count to a specific list/app. ### Returns - `class DealCountResponse: …` - `total: int` Number of records matching the access scope. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.count() print(response.total) ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value `prism.objects.deals.find(strvalue, DealFindParams**kwargs) -> DealFindResponse` **get** `/v2/prism/{teamId}/deal/by/{slug}/{value}` Returns the single record whose property `{slug}` equals `{value}`. 404 if nothing matches; 409 if more than one record matches. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `list_id: Optional[str]` Scope the lookup to a specific list/app. ### Returns - `class DealFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.find( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value `prism.objects.deals.upsert(strvalue, DealUpsertParams**kwargs) -> DealUpsertResponse` **put** `/v2/prism/{teamId}/deal/by/{slug}/{value}` Idempotent create-or-update keyed on `{slug}={value}`. If exactly one record matches, it is patched and 200 is returned. If none match, a new record is created (with the lookup property set if absent) and 201 is returned. If multiple records match, 409 is returned and you should patch by id instead. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class DealUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.upsert( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects `prism.objects.deals.bulk_create(DealBulkCreateParams**kwargs) -> DealBulkCreateResponse` **post** `/v2/prism/{teamId}/deal/import` Import multiple objects in batch. Properties are keyed by slug. Automatically routes based on size: small batches complete synchronously and return 200 with the final `ImportJob`; large batches start an async job, return 202 with `status: processing` and a `Location` header, and can be polled via `GET /v2/prism/{teamId}/imports/{jobId}`. ### Parameters - `team_id: Optional[str]` - `objects: Iterable[PrismObjectPropertiesParam]` Array of objects to import with property values keyed by slug - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `options: Optional[Options]` - `case_insensitive: Optional[bool]` Whether deduplication should be case insensitive - `dedupe_by: Optional[str]` Property slug to deduplicate on - `list_id: Optional[str]` App/CRM ID for context (optional) - `idempotency_key: Optional[str]` ### Returns - `class DealBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.bulk_create( objects=[{}], ) print(response.job_id) ``` #### Response ```json { "job_id": "job_id", "status": "complete", "total": 0, "created_at": "2019-12-27T18:11:19.117Z", "error": { "code": "code", "message": "message" }, "expires_at": "2019-12-27T18:11:19.117Z", "failed": 0, "processed": 0, "results": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created": true, "error": { "code": "code", "message": "message" }, "existing": true } ], "succeeded": 0, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Bulk update records (partial success) `prism.objects.deals.bulk_update(DealBulkUpdateParams**kwargs) -> DealBulkUpdateResponse` **post** `/v2/prism/{teamId}/deal/batch/update` Patch up to 100 records in a single call. Each item is attempted independently — failures don't abort the batch. Inspect `results[].status` per item. ### Parameters - `team_id: Optional[str]` - `items: Iterable[Item]` - `id: str` - `idempotency_key: Optional[str]` ### Returns - `class DealBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.bulk_update( items=[{ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Bulk delete records (partial success) `prism.objects.deals.bulk_delete(DealBulkDeleteParams**kwargs) -> DealBulkDeleteResponse` **post** `/v2/prism/{teamId}/deal/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Parameters - `team_id: Optional[str]` - `ids: Sequence[str]` - `idempotency_key: Optional[str]` ### Returns - `class DealBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.bulk_delete( ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Duplicate object `prism.objects.deals.duplicate(strdeal_id, DealDuplicateParams**kwargs) -> DealDuplicateResponse` **post** `/v2/prism/{teamId}/deal/{dealId}/duplicate` Duplicate object ### Parameters - `team_id: Optional[str]` - `deal_id: str` - `idempotency_key: Optional[str]` ### Returns - `class DealDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.duplicate( deal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object `prism.objects.deals.restore(strdeal_id, DealRestoreParams**kwargs) -> DealRestoreResponse` **post** `/v2/prism/{teamId}/deal/{dealId}/restore` Restore object ### Parameters - `team_id: Optional[str]` - `deal_id: str` - `idempotency_key: Optional[str]` ### Returns - `class DealRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.deals.restore( deal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Deal - `class Deal: …` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` ### Deal Create Response - `class DealCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Deal List Response - `class DealListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Deal Get Response - `class DealGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Deal Update Response - `class DealUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Deal Query Response - `class DealQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Deal Count Response - `class DealCountResponse: …` - `total: int` Number of records matching the access scope. ### Deal Find Response - `class DealFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Deal Upsert Response - `class DealUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Deal Bulk Create Response - `class DealBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Deal Bulk Update Response - `class DealBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Deal Bulk Delete Response - `class DealBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Deal Duplicate Response - `class DealDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Deal Restore Response - `class DealRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` # Grant ## Get grant `prism.objects.deals.grant.get(strdeal_id, GrantGetParams**kwargs) -> GrantGetResponse` **get** `/v2/prism/{teamId}/deal/{dealId}/grant` Get grant ### Parameters - `team_id: Optional[str]` - `deal_id: str` ### Returns - `class GrantGetResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) grant = client.prism.objects.deals.grant.get( deal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(grant.team_group_id) ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Update grant `prism.objects.deals.grant.update(strdeal_id, GrantUpdateParams**kwargs) -> GrantUpdateResponse` **put** `/v2/prism/{teamId}/deal/{dealId}/grant` Update grant ### Parameters - `team_id: Optional[str]` - `deal_id: str` - `team_group_id: Optional[Iterable[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[Iterable[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `idempotency_key: Optional[str]` ### Returns - `class GrantUpdateResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) grant = client.prism.objects.deals.grant.update( deal_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(grant.team_group_id) ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Domain Types ### Grant Get Response - `class GrantGetResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Grant Update Response - `class GrantUpdateResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` # Actions ## Create object `prism.objects.actions.create(ActionCreateParams**kwargs) -> ActionCreateResponse` **post** `/v2/prism/{teamId}/action` Create object ### Parameters - `team_id: Optional[str]` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class ActionCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) action = client.prism.objects.actions.create() print(action.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type `prism.objects.actions.list(ActionListParams**kwargs) -> ActionListResponse` **get** `/v2/prism/{teamId}/action` Convenience list endpoint. Equivalent to `POST /v2/prism/{teamId}/{objectType}/query` with an empty body, plus query-string sugar for the common cases. Any unrecognized query parameter is interpreted as an equality filter on a property of that name; pass arrays for `in`. Values are received as strings, so non-string property filters via this endpoint may not work — use the `query` endpoint for typed comparisons or anything beyond simple equality. ### Parameters - `team_id: Optional[str]` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: Optional[bool]` Include soft-deleted records. Pass the literal string `true`. - `include_total: Optional[bool]` When set to `true`, the response includes a `total` field with the unpaginated row count. Costs an extra pass; prefer `GET .../count` for the unfiltered total. - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50. - `list_id: Optional[str]` Scope properties to a specific list/app. - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. - `sort: Optional[str]` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `class ActionListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) actions = client.prism.objects.actions.list() print(actions.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Get object `prism.objects.actions.get(straction_id, ActionGetParams**kwargs) -> ActionGetResponse` **get** `/v2/prism/{teamId}/action/{actionId}` Get object ### Parameters - `team_id: Optional[str]` - `action_id: str` - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `class ActionGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) action = client.prism.objects.actions.get( action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(action.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object `prism.objects.actions.update(straction_id, ActionUpdateParams**kwargs) -> ActionUpdateResponse` **patch** `/v2/prism/{teamId}/action/{actionId}` Patch object ### Parameters - `team_id: Optional[str]` - `action_id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` - `if_match: Optional[str]` ### Returns - `class ActionUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) action = client.prism.objects.actions.update( action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(action.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object `prism.objects.actions.delete(straction_id, ActionDeleteParams**kwargs)` **delete** `/v2/prism/{teamId}/action/{actionId}` Delete object ### Parameters - `team_id: Optional[str]` - `action_id: str` - `if_match: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.prism.objects.actions.delete( action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) ``` ## Query `prism.objects.actions.query(ActionQueryParams**kwargs) -> ActionQueryResponse` **post** `/v2/prism/{teamId}/action/query` Query ### Parameters - `team_id: Optional[str]` - `query: Query` - `select: Sequence[str]` Property slugs to select. Use dot notation for relationships (e.g. attendee.contact.first_name). `id` is always returned at the top level of each row and does not need to be selected. - `combinator: Optional[Literal["AND", "OR"]]` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When set, `page` and `limit` are derived from the cursor and any explicit values are ignored. - `filter: Optional[Iterable[Dict[str, QueryFilterQueryFilterItem]]]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `class QueryFilterQueryFilterItemPrismQueryFilterEq: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterNe: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterLt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterLte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemContains: …` - `contains: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBeginsWith: …` - `begins_with: str` - `class QueryFilterQueryFilterItemEndsWith: …` - `ends_with: str` - `class QueryFilterQueryFilterItemNotContains: …` - `not_contains: str` - `class QueryFilterQueryFilterItemExists: …` - `exists: bool` - `class QueryFilterQueryFilterItemNotExists: …` - `not_exists: bool` - `class QueryFilterQueryFilterItemIsNull: …` - `is_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIsNotNull: …` - `is_not_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBetween: …` - `between: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIn: …` - `in_: Sequence[str]` - `class QueryFilterQueryFilterItemNotIn: …` - `not_in: Sequence[str]` - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: Optional[str]` - `page: Optional[int]` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: Optional[Iterable[Dict[str, Literal["asc", "desc"]]]]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: Optional[Union[str, Sequence[str]]]` - `str` - `Sequence[str]` - `boxes: Optional[Sequence[str]]` - `cursor: Optional[str]` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: Optional[bool]` - `include_total: Optional[bool]` When true, the response includes a `total` field with the unpaginated row count. Costs an additional pass over the result set — for unfiltered totals prefer `GET /v2/prism/{teamId}/{objectType}/count` instead. - `sources: Optional[Sequence[str]]` ### Returns - `class ActionQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.actions.query( query={ "select": ["string"] }, ) print(response.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Total record count for an object type `prism.objects.actions.count(ActionCountParams**kwargs) -> ActionCountResponse` **get** `/v2/prism/{teamId}/action/count` Returns the total number of records of this object type that the caller can see. Avoids the page-overshoot anti-pattern — clients no longer need to keep paging until `has_more` flips false to discover the total. Currently does not apply query filters; for a filtered total, pass `include_total: true` in a POST `/query` body. ### Parameters - `team_id: Optional[str]` - `list_id: Optional[str]` Scope the count to a specific list/app. ### Returns - `class ActionCountResponse: …` - `total: int` Number of records matching the access scope. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.actions.count() print(response.total) ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value `prism.objects.actions.find(strvalue, ActionFindParams**kwargs) -> ActionFindResponse` **get** `/v2/prism/{teamId}/action/by/{slug}/{value}` Returns the single record whose property `{slug}` equals `{value}`. 404 if nothing matches; 409 if more than one record matches. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `list_id: Optional[str]` Scope the lookup to a specific list/app. ### Returns - `class ActionFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.actions.find( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value `prism.objects.actions.upsert(strvalue, ActionUpsertParams**kwargs) -> ActionUpsertResponse` **put** `/v2/prism/{teamId}/action/by/{slug}/{value}` Idempotent create-or-update keyed on `{slug}={value}`. If exactly one record matches, it is patched and 200 is returned. If none match, a new record is created (with the lookup property set if absent) and 201 is returned. If multiple records match, 409 is returned and you should patch by id instead. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class ActionUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.actions.upsert( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects `prism.objects.actions.bulk_create(ActionBulkCreateParams**kwargs) -> ActionBulkCreateResponse` **post** `/v2/prism/{teamId}/action/import` Import multiple objects in batch. Properties are keyed by slug. Automatically routes based on size: small batches complete synchronously and return 200 with the final `ImportJob`; large batches start an async job, return 202 with `status: processing` and a `Location` header, and can be polled via `GET /v2/prism/{teamId}/imports/{jobId}`. ### Parameters - `team_id: Optional[str]` - `objects: Iterable[PrismObjectPropertiesParam]` Array of objects to import with property values keyed by slug - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `options: Optional[Options]` - `case_insensitive: Optional[bool]` Whether deduplication should be case insensitive - `dedupe_by: Optional[str]` Property slug to deduplicate on - `list_id: Optional[str]` App/CRM ID for context (optional) - `idempotency_key: Optional[str]` ### Returns - `class ActionBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.actions.bulk_create( objects=[{}], ) print(response.job_id) ``` #### Response ```json { "job_id": "job_id", "status": "complete", "total": 0, "created_at": "2019-12-27T18:11:19.117Z", "error": { "code": "code", "message": "message" }, "expires_at": "2019-12-27T18:11:19.117Z", "failed": 0, "processed": 0, "results": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created": true, "error": { "code": "code", "message": "message" }, "existing": true } ], "succeeded": 0, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Bulk update records (partial success) `prism.objects.actions.bulk_update(ActionBulkUpdateParams**kwargs) -> ActionBulkUpdateResponse` **post** `/v2/prism/{teamId}/action/batch/update` Patch up to 100 records in a single call. Each item is attempted independently — failures don't abort the batch. Inspect `results[].status` per item. ### Parameters - `team_id: Optional[str]` - `items: Iterable[Item]` - `id: str` - `idempotency_key: Optional[str]` ### Returns - `class ActionBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.actions.bulk_update( items=[{ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Bulk delete records (partial success) `prism.objects.actions.bulk_delete(ActionBulkDeleteParams**kwargs) -> ActionBulkDeleteResponse` **post** `/v2/prism/{teamId}/action/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Parameters - `team_id: Optional[str]` - `ids: Sequence[str]` - `idempotency_key: Optional[str]` ### Returns - `class ActionBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.actions.bulk_delete( ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Duplicate object `prism.objects.actions.duplicate(straction_id, ActionDuplicateParams**kwargs) -> ActionDuplicateResponse` **post** `/v2/prism/{teamId}/action/{actionId}/duplicate` Duplicate object ### Parameters - `team_id: Optional[str]` - `action_id: str` - `idempotency_key: Optional[str]` ### Returns - `class ActionDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.actions.duplicate( action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object `prism.objects.actions.restore(straction_id, ActionRestoreParams**kwargs) -> ActionRestoreResponse` **post** `/v2/prism/{teamId}/action/{actionId}/restore` Restore object ### Parameters - `team_id: Optional[str]` - `action_id: str` - `idempotency_key: Optional[str]` ### Returns - `class ActionRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.actions.restore( action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Action - `class Action: …` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` ### Action Create Response - `class ActionCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Action List Response - `class ActionListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Action Get Response - `class ActionGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Action Update Response - `class ActionUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Action Query Response - `class ActionQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Action Count Response - `class ActionCountResponse: …` - `total: int` Number of records matching the access scope. ### Action Find Response - `class ActionFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Action Upsert Response - `class ActionUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Action Bulk Create Response - `class ActionBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Action Bulk Update Response - `class ActionBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Action Bulk Delete Response - `class ActionBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Action Duplicate Response - `class ActionDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Action Restore Response - `class ActionRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` # Grant ## Get grant `prism.objects.actions.grant.get(straction_id, GrantGetParams**kwargs) -> GrantGetResponse` **get** `/v2/prism/{teamId}/action/{actionId}/grant` Get grant ### Parameters - `team_id: Optional[str]` - `action_id: str` ### Returns - `class GrantGetResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) grant = client.prism.objects.actions.grant.get( action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(grant.team_group_id) ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Update grant `prism.objects.actions.grant.update(straction_id, GrantUpdateParams**kwargs) -> GrantUpdateResponse` **put** `/v2/prism/{teamId}/action/{actionId}/grant` Update grant ### Parameters - `team_id: Optional[str]` - `action_id: str` - `team_group_id: Optional[Iterable[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[Iterable[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `idempotency_key: Optional[str]` ### Returns - `class GrantUpdateResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) grant = client.prism.objects.actions.grant.update( action_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(grant.team_group_id) ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Domain Types ### Grant Get Response - `class GrantGetResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Grant Update Response - `class GrantUpdateResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` # Documents ## Create object `prism.objects.documents.create(DocumentCreateParams**kwargs) -> DocumentCreateResponse` **post** `/v2/prism/{teamId}/document` Create object ### Parameters - `team_id: Optional[str]` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class DocumentCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) document = client.prism.objects.documents.create() print(document.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type `prism.objects.documents.list(DocumentListParams**kwargs) -> DocumentListResponse` **get** `/v2/prism/{teamId}/document` Convenience list endpoint. Equivalent to `POST /v2/prism/{teamId}/{objectType}/query` with an empty body, plus query-string sugar for the common cases. Any unrecognized query parameter is interpreted as an equality filter on a property of that name; pass arrays for `in`. Values are received as strings, so non-string property filters via this endpoint may not work — use the `query` endpoint for typed comparisons or anything beyond simple equality. ### Parameters - `team_id: Optional[str]` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: Optional[bool]` Include soft-deleted records. Pass the literal string `true`. - `include_total: Optional[bool]` When set to `true`, the response includes a `total` field with the unpaginated row count. Costs an extra pass; prefer `GET .../count` for the unfiltered total. - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50. - `list_id: Optional[str]` Scope properties to a specific list/app. - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. - `sort: Optional[str]` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `class DocumentListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) documents = client.prism.objects.documents.list() print(documents.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Get object `prism.objects.documents.get(strdocument_id, DocumentGetParams**kwargs) -> DocumentGetResponse` **get** `/v2/prism/{teamId}/document/{documentId}` Get object ### Parameters - `team_id: Optional[str]` - `document_id: str` - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `class DocumentGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) document = client.prism.objects.documents.get( document_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(document.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object `prism.objects.documents.update(strdocument_id, DocumentUpdateParams**kwargs) -> DocumentUpdateResponse` **patch** `/v2/prism/{teamId}/document/{documentId}` Patch object ### Parameters - `team_id: Optional[str]` - `document_id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` - `if_match: Optional[str]` ### Returns - `class DocumentUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) document = client.prism.objects.documents.update( document_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(document.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object `prism.objects.documents.delete(strdocument_id, DocumentDeleteParams**kwargs)` **delete** `/v2/prism/{teamId}/document/{documentId}` Delete object ### Parameters - `team_id: Optional[str]` - `document_id: str` - `if_match: Optional[str]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) client.prism.objects.documents.delete( document_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) ``` ## Query `prism.objects.documents.query(DocumentQueryParams**kwargs) -> DocumentQueryResponse` **post** `/v2/prism/{teamId}/document/query` Query ### Parameters - `team_id: Optional[str]` - `query: Query` - `select: Sequence[str]` Property slugs to select. Use dot notation for relationships (e.g. attendee.contact.first_name). `id` is always returned at the top level of each row and does not need to be selected. - `combinator: Optional[Literal["AND", "OR"]]` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When set, `page` and `limit` are derived from the cursor and any explicit values are ignored. - `filter: Optional[Iterable[Dict[str, QueryFilterQueryFilterItem]]]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `class QueryFilterQueryFilterItemPrismQueryFilterEq: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterNe: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterLt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterLte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemContains: …` - `contains: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBeginsWith: …` - `begins_with: str` - `class QueryFilterQueryFilterItemEndsWith: …` - `ends_with: str` - `class QueryFilterQueryFilterItemNotContains: …` - `not_contains: str` - `class QueryFilterQueryFilterItemExists: …` - `exists: bool` - `class QueryFilterQueryFilterItemNotExists: …` - `not_exists: bool` - `class QueryFilterQueryFilterItemIsNull: …` - `is_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIsNotNull: …` - `is_not_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBetween: …` - `between: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIn: …` - `in_: Sequence[str]` - `class QueryFilterQueryFilterItemNotIn: …` - `not_in: Sequence[str]` - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: Optional[str]` - `page: Optional[int]` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: Optional[Iterable[Dict[str, Literal["asc", "desc"]]]]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: Optional[Union[str, Sequence[str]]]` - `str` - `Sequence[str]` - `boxes: Optional[Sequence[str]]` - `cursor: Optional[str]` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: Optional[bool]` - `include_total: Optional[bool]` When true, the response includes a `total` field with the unpaginated row count. Costs an additional pass over the result set — for unfiltered totals prefer `GET /v2/prism/{teamId}/{objectType}/count` instead. - `sources: Optional[Sequence[str]]` ### Returns - `class DocumentQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.documents.query( query={ "select": ["string"] }, ) print(response.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Total record count for an object type `prism.objects.documents.count(DocumentCountParams**kwargs) -> DocumentCountResponse` **get** `/v2/prism/{teamId}/document/count` Returns the total number of records of this object type that the caller can see. Avoids the page-overshoot anti-pattern — clients no longer need to keep paging until `has_more` flips false to discover the total. Currently does not apply query filters; for a filtered total, pass `include_total: true` in a POST `/query` body. ### Parameters - `team_id: Optional[str]` - `list_id: Optional[str]` Scope the count to a specific list/app. ### Returns - `class DocumentCountResponse: …` - `total: int` Number of records matching the access scope. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.documents.count() print(response.total) ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value `prism.objects.documents.find(strvalue, DocumentFindParams**kwargs) -> DocumentFindResponse` **get** `/v2/prism/{teamId}/document/by/{slug}/{value}` Returns the single record whose property `{slug}` equals `{value}`. 404 if nothing matches; 409 if more than one record matches. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `list_id: Optional[str]` Scope the lookup to a specific list/app. ### Returns - `class DocumentFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.documents.find( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value `prism.objects.documents.upsert(strvalue, DocumentUpsertParams**kwargs) -> DocumentUpsertResponse` **put** `/v2/prism/{teamId}/document/by/{slug}/{value}` Idempotent create-or-update keyed on `{slug}={value}`. If exactly one record matches, it is patched and 200 is returned. If none match, a new record is created (with the lookup property set if absent) and 201 is returned. If multiple records match, 409 is returned and you should patch by id instead. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `idempotency_key: Optional[str]` ### Returns - `class DocumentUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.documents.upsert( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects `prism.objects.documents.bulk_create(DocumentBulkCreateParams**kwargs) -> DocumentBulkCreateResponse` **post** `/v2/prism/{teamId}/document/import` Import multiple objects in batch. Properties are keyed by slug. Automatically routes based on size: small batches complete synchronously and return 200 with the final `ImportJob`; large batches start an async job, return 202 with `status: processing` and a `Location` header, and can be polled via `GET /v2/prism/{teamId}/imports/{jobId}`. ### Parameters - `team_id: Optional[str]` - `objects: Iterable[PrismObjectPropertiesParam]` Array of objects to import with property values keyed by slug - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` - `options: Optional[Options]` - `case_insensitive: Optional[bool]` Whether deduplication should be case insensitive - `dedupe_by: Optional[str]` Property slug to deduplicate on - `list_id: Optional[str]` App/CRM ID for context (optional) - `idempotency_key: Optional[str]` ### Returns - `class DocumentBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.documents.bulk_create( objects=[{}], ) print(response.job_id) ``` #### Response ```json { "job_id": "job_id", "status": "complete", "total": 0, "created_at": "2019-12-27T18:11:19.117Z", "error": { "code": "code", "message": "message" }, "expires_at": "2019-12-27T18:11:19.117Z", "failed": 0, "processed": 0, "results": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created": true, "error": { "code": "code", "message": "message" }, "existing": true } ], "succeeded": 0, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Bulk update records (partial success) `prism.objects.documents.bulk_update(DocumentBulkUpdateParams**kwargs) -> DocumentBulkUpdateResponse` **post** `/v2/prism/{teamId}/document/batch/update` Patch up to 100 records in a single call. Each item is attempted independently — failures don't abort the batch. Inspect `results[].status` per item. ### Parameters - `team_id: Optional[str]` - `items: Iterable[Item]` - `id: str` - `idempotency_key: Optional[str]` ### Returns - `class DocumentBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.documents.bulk_update( items=[{ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Bulk delete records (partial success) `prism.objects.documents.bulk_delete(DocumentBulkDeleteParams**kwargs) -> DocumentBulkDeleteResponse` **post** `/v2/prism/{teamId}/document/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Parameters - `team_id: Optional[str]` - `ids: Sequence[str]` - `idempotency_key: Optional[str]` ### Returns - `class DocumentBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.documents.bulk_delete( ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) print(response.results) ``` #### Response ```json { "results": [ { "id": "id", "status": "ok", "error": { "code": "code", "message": "message" }, "record": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } } ], "summary": { "failed": 0, "succeeded": 0, "total": 0 } } ``` ## Duplicate object `prism.objects.documents.duplicate(strdocument_id, DocumentDuplicateParams**kwargs) -> DocumentDuplicateResponse` **post** `/v2/prism/{teamId}/document/{documentId}/duplicate` Duplicate object ### Parameters - `team_id: Optional[str]` - `document_id: str` - `idempotency_key: Optional[str]` ### Returns - `class DocumentDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.documents.duplicate( document_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object `prism.objects.documents.restore(strdocument_id, DocumentRestoreParams**kwargs) -> DocumentRestoreResponse` **post** `/v2/prism/{teamId}/document/{documentId}/restore` Restore object ### Parameters - `team_id: Optional[str]` - `document_id: str` - `idempotency_key: Optional[str]` ### Returns - `class DocumentRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.documents.restore( document_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Document - `class Document: …` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` ### Document Create Response - `class DocumentCreateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Document List Response - `class DocumentListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Document Get Response - `class DocumentGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Document Update Response - `class DocumentUpdateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Document Query Response - `class DocumentQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Document Count Response - `class DocumentCountResponse: …` - `total: int` Number of records matching the access scope. ### Document Find Response - `class DocumentFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Document Upsert Response - `class DocumentUpsertResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Document Bulk Create Response - `class DocumentBulkCreateResponse: …` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: Optional[str]` Null for sync imports (results inlined). Set for async imports. - `status: Literal["complete", "processing", "failed"]` - `"complete"` - `"processing"` - `"failed"` - `total: int` Total number of rows in the import. - `created_at: Optional[datetime]` - `error: Optional[Error]` Set when status=failed; describes the job-level failure (not per-row). - `code: Optional[str]` - `message: Optional[str]` - `expires_at: Optional[datetime]` - `failed: Optional[int]` - `processed: Optional[int]` Rows that have been attempted (succeeded + failed). - `results: Optional[List[Result]]` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: Optional[str]` - `created: Optional[bool]` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `existing: Optional[bool]` True if the row matched an existing record via the dedupe key. - `succeeded: Optional[int]` - `updated_at: Optional[datetime]` ### Document Bulk Update Response - `class DocumentBulkUpdateResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Document Bulk Delete Response - `class DocumentBulkDeleteResponse: …` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: List[Result]` - `id: Optional[str]` Item ID, or null if the input was unparseable. - `status: Literal["ok", "error"]` - `"ok"` - `"error"` - `error: Optional[ResultError]` - `code: Optional[str]` - `message: Optional[str]` - `record: Optional[ResultRecord]` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` - `summary: Summary` - `failed: int` - `succeeded: int` - `total: int` ### Document Duplicate Response - `class DocumentDuplicateResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Document Restore Response - `class DocumentRestoreResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` # Grant ## Get grant `prism.objects.documents.grant.get(strdocument_id, GrantGetParams**kwargs) -> GrantGetResponse` **get** `/v2/prism/{teamId}/document/{documentId}/grant` Get grant ### Parameters - `team_id: Optional[str]` - `document_id: str` ### Returns - `class GrantGetResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) grant = client.prism.objects.documents.grant.get( document_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(grant.team_group_id) ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Update grant `prism.objects.documents.grant.update(strdocument_id, GrantUpdateParams**kwargs) -> GrantUpdateResponse` **put** `/v2/prism/{teamId}/document/{documentId}/grant` Update grant ### Parameters - `team_id: Optional[str]` - `document_id: str` - `team_group_id: Optional[Iterable[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[Iterable[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `idempotency_key: Optional[str]` ### Returns - `class GrantUpdateResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) grant = client.prism.objects.documents.grant.update( document_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(grant.team_group_id) ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Domain Types ### Grant Get Response - `class GrantGetResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Grant Update Response - `class GrantUpdateResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` # Events ## List records of an object type `prism.objects.events.list(EventListParams**kwargs) -> EventListResponse` **get** `/v2/prism/{teamId}/event` Convenience list endpoint. Equivalent to `POST /v2/prism/{teamId}/{objectType}/query` with an empty body, plus query-string sugar for the common cases. Any unrecognized query parameter is interpreted as an equality filter on a property of that name; pass arrays for `in`. Values are received as strings, so non-string property filters via this endpoint may not work — use the `query` endpoint for typed comparisons or anything beyond simple equality. ### Parameters - `team_id: Optional[str]` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: Optional[bool]` Include soft-deleted records. Pass the literal string `true`. - `include_total: Optional[bool]` When set to `true`, the response includes a `total` field with the unpaginated row count. Costs an extra pass; prefer `GET .../count` for the unfiltered total. - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50. - `list_id: Optional[str]` Scope properties to a specific list/app. - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. - `sort: Optional[str]` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `class EventListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) events = client.prism.objects.events.list() print(events.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Get object `prism.objects.events.get(strevent_id, EventGetParams**kwargs) -> EventGetResponse` **get** `/v2/prism/{teamId}/event/{eventId}` Get object ### Parameters - `team_id: Optional[str]` - `event_id: str` - `select: Optional[str]` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `class EventGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) event = client.prism.objects.events.get( event_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(event.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Query `prism.objects.events.query(EventQueryParams**kwargs) -> EventQueryResponse` **post** `/v2/prism/{teamId}/event/query` Query ### Parameters - `team_id: Optional[str]` - `query: Query` - `select: Sequence[str]` Property slugs to select. Use dot notation for relationships (e.g. attendee.contact.first_name). `id` is always returned at the top level of each row and does not need to be selected. - `combinator: Optional[Literal["AND", "OR"]]` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: Optional[str]` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When set, `page` and `limit` are derived from the cursor and any explicit values are ignored. - `filter: Optional[Iterable[Dict[str, QueryFilterQueryFilterItem]]]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `class QueryFilterQueryFilterItemPrismQueryFilterEq: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterNe: …` - `api_empty: Union[str, bool]` - `str` - `bool` - `class QueryFilterQueryFilterItemPrismQueryFilterLt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGt: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterLte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemPrismQueryFilterGte: …` - `api_empty: str` - `class QueryFilterQueryFilterItemContains: …` - `contains: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBeginsWith: …` - `begins_with: str` - `class QueryFilterQueryFilterItemEndsWith: …` - `ends_with: str` - `class QueryFilterQueryFilterItemNotContains: …` - `not_contains: str` - `class QueryFilterQueryFilterItemExists: …` - `exists: bool` - `class QueryFilterQueryFilterItemNotExists: …` - `not_exists: bool` - `class QueryFilterQueryFilterItemIsNull: …` - `is_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIsNotNull: …` - `is_not_null: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemBetween: …` - `between: Union[str, bool, Sequence[str]]` - `str` - `bool` - `Sequence[str]` - `class QueryFilterQueryFilterItemIn: …` - `in_: Sequence[str]` - `class QueryFilterQueryFilterItemNotIn: …` - `not_in: Sequence[str]` - `limit: Optional[int]` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: Optional[str]` - `page: Optional[int]` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: Optional[Iterable[Dict[str, Literal["asc", "desc"]]]]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: Optional[Union[str, Sequence[str]]]` - `str` - `Sequence[str]` - `boxes: Optional[Sequence[str]]` - `cursor: Optional[str]` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: Optional[bool]` - `include_total: Optional[bool]` When true, the response includes a `total` field with the unpaginated row count. Costs an additional pass over the result set — for unfiltered totals prefer `GET /v2/prism/{teamId}/{objectType}/count` instead. - `sources: Optional[Sequence[str]]` ### Returns - `class EventQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.events.query( query={ "select": ["string"] }, ) print(response.data) ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "is_user_object": true, "properties": { "foo": "bar" }, "source": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ], "has_more": true, "next_cursor": "next_cursor", "total": 0 } ``` ## Total record count for an object type `prism.objects.events.count(EventCountParams**kwargs) -> EventCountResponse` **get** `/v2/prism/{teamId}/event/count` Returns the total number of records of this object type that the caller can see. Avoids the page-overshoot anti-pattern — clients no longer need to keep paging until `has_more` flips false to discover the total. Currently does not apply query filters; for a filtered total, pass `include_total: true` in a POST `/query` body. ### Parameters - `team_id: Optional[str]` - `list_id: Optional[str]` Scope the count to a specific list/app. ### Returns - `class EventCountResponse: …` - `total: int` Number of records matching the access scope. ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.events.count() print(response.total) ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value `prism.objects.events.find(strvalue, EventFindParams**kwargs) -> EventFindResponse` **get** `/v2/prism/{teamId}/event/by/{slug}/{value}` Returns the single record whose property `{slug}` equals `{value}`. 404 if nothing matches; 409 if more than one record matches. ### Parameters - `team_id: Optional[str]` - `slug: str` - `value: str` - `list_id: Optional[str]` Scope the lookup to a specific list/app. ### Returns - `class EventFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) response = client.prism.objects.events.find( value="value", slug="slug", ) print(response.id) ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Event - `class Event: …` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. Values can be strings, numbers, booleans, arrays, or null. For select/multiselect properties, values may be option slugs or option UUIDs on write; option slugs are returned on read. - `list: Optional[object]` ### Event List Response - `class EventListResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: Optional[str]` - `total: Optional[int]` Populated only when `?include_total=true` was passed. ### Event Get Response - `class EventGetResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` ### Event Query Response - `class EventQueryResponse: …` - `data: List[Data]` - `id: str` - `is_user_object: Optional[bool]` - `properties: Optional[Dict[str, object]]` Selected property values keyed by property slug. For select/multiselect properties, option slugs are returned. For reference properties, values are nested `{ id, properties }` objects. - `source: Optional[str]` - `has_more: bool` Accurate end-of-data signal. False when this page contains the last record; true only when at least one more record exists. (Implementation note: the server fetches one extra row internally to determine this — clients never need to overshoot to discover the end.) - `next_cursor: Optional[str]` Opaque cursor pointing at the next page. Pass it back unchanged in the request body (`cursor`) of the next call. Null when `has_more` is false. - `total: Optional[int]` Only populated when the request set `include_total: true`. Total number of records matching the query, ignoring pagination. Opt-in because it costs an additional pass over the result set. ### Event Count Response - `class EventCountResponse: …` - `total: int` Number of records matching the access scope. ### Event Find Response - `class EventFindResponse: …` Object returned by reads (get/create/patch/restore). id is always present. - `id: str` - `default: Optional[Dict[str, object]]` Properties keyed by property slug. - `list: Optional[object]` # Grant ## Get grant `prism.objects.events.grant.get(strevent_id, GrantGetParams**kwargs) -> GrantGetResponse` **get** `/v2/prism/{teamId}/event/{eventId}/grant` Get grant ### Parameters - `team_id: Optional[str]` - `event_id: str` ### Returns - `class GrantGetResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) grant = client.prism.objects.events.grant.get( event_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(grant.team_group_id) ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Update grant `prism.objects.events.grant.update(strevent_id, GrantUpdateParams**kwargs) -> GrantUpdateResponse` **put** `/v2/prism/{teamId}/event/{eventId}/grant` Update grant ### Parameters - `team_id: Optional[str]` - `event_id: str` - `team_group_id: Optional[Iterable[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[Iterable[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `idempotency_key: Optional[str]` ### Returns - `class GrantUpdateResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Example ```python import os from micro_so import Micro client = Micro( api_key=os.environ.get("MICRO_API_KEY"), # This is the default and can be omitted ) grant = client.prism.objects.events.grant.update( event_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(grant.team_group_id) ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Domain Types ### Grant Get Response - `class GrantGetResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` ### Grant Update Response - `class GrantUpdateResponse: …` - `team_group_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"` - `team_id: Optional[Dict[str, Literal["a", "r", "w"]]]` - `"a"` - `"r"` - `"w"` - `user_id: Optional[List[Dict[str, Literal["a", "r", "w"]]]]` - `"a"` - `"r"` - `"w"`