# Prism ## Domain Types ### Prism Object Properties - `PrismObjectProperties object { default, list }` - `default: optional map[unknown]` 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 unknown` # Properties ## Get metadata properties by object type **get** `/v2/prism/{teamId}/{objectType}/properties` Get metadata properties by object type ### Path Parameters - `teamId: optional string` - `objectType: "deal" or "identity" or "ai_chat_thread" or 6 more` - `"deal"` - `"identity"` - `"ai_chat_thread"` - `"ai_chat_message"` - `"document"` - `"action"` - `"event"` - `"organization"` - `"contact"` ### Query Parameters - `autofill: optional boolean` - `list_id: optional string` Scope properties to a specific list/app. - `term: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/$OBJECT_TYPE/properties \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "foo": {} } ``` ## Get metadata properties **get** `/v2/prism/{teamId}/properties` Get metadata properties ### Path Parameters - `teamId: optional string` ### Query Parameters - `autofill: optional boolean` - `list_id: optional string` Scope properties to a specific list/app. - `term: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/properties \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "foo": {} } ``` ## Domain Types ### Property List Response - `PropertyListResponse = map[unknown]` Property definitions keyed by object type, then by property definition id (UUID). When the request scopes to a single object type, only that key is present. ### Property List All Response - `PropertyListAllResponse = map[unknown]` Property definitions keyed by object type, then by property definition id (UUID). When the request scopes to a single object type, only that key is present. # Imports ## Get the status of an import job **get** `/v2/prism/{teamId}/imports/{jobId}` Poll the status of an async import. Sync imports complete in the original response and don't appear here. Async jobs are retained for 7 days. Returns 404 once the job has expired. ### Path Parameters - `teamId: optional string` - `jobId: string` ### Returns - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/imports/$JOB_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### 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" } ``` ## Domain Types ### Import Get Response - `ImportGetResponse object { job_id, status, total, 8 more }` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` # Objects # Contacts ## Create object **post** `/v2/prism/{teamId}/contact` Create object ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `cursor: optional string` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: optional boolean` Include soft-deleted records. Pass the literal string `true`. - `include_total: optional boolean` 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 number` Maximum number of rows to return. Capped server-side at 50. - `list_id: optional string` Scope properties to a specific list/app. - `select: optional string` 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 string` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact \ -H "x-api-key: $MICRO_API_KEY" ``` #### 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 **get** `/v2/prism/{teamId}/contact/{contactId}` Get object ### Path Parameters - `teamId: optional string` - `contactId: string` ### Query Parameters - `select: optional string` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/$CONTACT_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object **patch** `/v2/prism/{teamId}/contact/{contactId}` Patch object ### Path Parameters - `teamId: optional string` - `contactId: string` ### Header Parameters - `"Idempotency-Key": optional string` - `"If-Match": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/$CONTACT_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object **delete** `/v2/prism/{teamId}/contact/{contactId}` Delete object ### Path Parameters - `teamId: optional string` - `contactId: string` ### Header Parameters - `"If-Match": optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/$CONTACT_ID \ -X DELETE \ -H "x-api-key: $MICRO_API_KEY" ``` ## Query **post** `/v2/prism/{teamId}/contact/query` Query ### Path Parameters - `teamId: optional string` ### Body Parameters - `query: object { select, combinator, cursor, 5 more }` - `select: array of string` 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 "AND" or "OR"` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: optional string` 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 array of map[object { "=" } or object { "!=" } or object { "<" } or 14 more]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `PrismQueryFilterEq object { "=" }` - `"=": string or boolean` - `string` - `boolean` - `PrismQueryFilterNe object { "!=" }` - `"!=": string or boolean` - `string` - `boolean` - `PrismQueryFilterLt object { "<" }` - `"<": string` - `PrismQueryFilterGt object { ">" }` - `">": string` - `PrismQueryFilterLte object { "<=" }` - `"<=": string` - `PrismQueryFilterGte object { ">=" }` - `">=": string` - `Contains object { contains }` - `contains: string or boolean or array of string` - `string` - `boolean` - `array of string` - `BeginsWith object { begins_with }` - `begins_with: string` - `EndsWith object { ends_with }` - `ends_with: string` - `NotContains object { not_contains }` - `not_contains: string` - `Exists object { exists }` - `exists: boolean` - `NotExists object { not_exists }` - `not_exists: boolean` - `IsNull object { is_null }` - `is_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `IsNotNull object { is_not_null }` - `is_not_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `Between object { between }` - `between: string or boolean or array of string` - `string` - `boolean` - `array of string` - `In object { in }` - `in: array of string` - `NotIn object { not_in }` - `not_in: array of string` - `limit: optional number` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: optional string` - `page: optional number` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: optional array of map["asc" or "desc"]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: optional string or array of string` - `string` - `array of string` - `boxes: optional array of string` - `cursor: optional string` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: optional boolean` - `include_total: optional boolean` 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 array of string` ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/query \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "query": { "select": [ "string" ] } }' ``` #### 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 **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `list_id: optional string` Scope the count to a specific list/app. ### Returns - `total: number` Number of records matching the access scope. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/count \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Query Parameters - `list_id: optional string` Scope the lookup to a specific list/app. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/by/$SLUG/$VALUE \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/by/$SLUG/$VALUE \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects **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}`. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `objects: array of PrismObjectProperties` Array of objects to import with property values keyed by slug - `default: optional map[unknown]` 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 unknown` - `options: optional object { caseInsensitive, dedupe_by, list_id }` - `caseInsensitive: optional boolean` Whether deduplication should be case insensitive - `dedupe_by: optional string` Property slug to deduplicate on - `list_id: optional string` App/CRM ID for context (optional) ### Returns - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/import \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "objects": [ {} ] }' ``` #### 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) **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. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `items: array of object { id }` - `id: string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/batch/update \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ] }' ``` #### 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) **post** `/v2/prism/{teamId}/contact/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `ids: array of string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/batch/delete \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "ids": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }' ``` #### 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 **post** `/v2/prism/{teamId}/contact/{contactId}/duplicate` Duplicate object ### Path Parameters - `teamId: optional string` - `contactId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/$CONTACT_ID/duplicate \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object **post** `/v2/prism/{teamId}/contact/{contactId}/restore` Restore object ### Path Parameters - `teamId: optional string` - `contactId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/contact/$CONTACT_ID/restore \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Contact - `Contact object { default, list }` - `default: optional map[unknown]` 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 unknown` ### Contact Create Response - `ContactCreateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Contact List Response - `ContactListResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Contact Get Response - `ContactGetResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Contact Update Response - `ContactUpdateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Contact Query Response - `ContactQueryResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 - `ContactCountResponse object { total }` - `total: number` Number of records matching the access scope. ### Contact Find Response - `ContactFindResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Contact Upsert Response - `ContactUpsertResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Contact Bulk Create Response - `ContactBulkCreateResponse object { job_id, status, total, 8 more }` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Contact Bulk Update Response - `ContactBulkUpdateResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Contact Bulk Delete Response - `ContactBulkDeleteResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Contact Duplicate Response - `ContactDuplicateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Contact Restore Response - `ContactRestoreResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` # Organizations ## Create object **post** `/v2/prism/{teamId}/organization` Create object ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `cursor: optional string` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: optional boolean` Include soft-deleted records. Pass the literal string `true`. - `include_total: optional boolean` 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 number` Maximum number of rows to return. Capped server-side at 50. - `list_id: optional string` Scope properties to a specific list/app. - `select: optional string` 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 string` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization \ -H "x-api-key: $MICRO_API_KEY" ``` #### 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 **get** `/v2/prism/{teamId}/organization/{organizationId}` Get object ### Path Parameters - `teamId: optional string` - `organizationId: string` ### Query Parameters - `select: optional string` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/$ORGANIZATION_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object **patch** `/v2/prism/{teamId}/organization/{organizationId}` Patch object ### Path Parameters - `teamId: optional string` - `organizationId: string` ### Header Parameters - `"Idempotency-Key": optional string` - `"If-Match": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/$ORGANIZATION_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object **delete** `/v2/prism/{teamId}/organization/{organizationId}` Delete object ### Path Parameters - `teamId: optional string` - `organizationId: string` ### Header Parameters - `"If-Match": optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/$ORGANIZATION_ID \ -X DELETE \ -H "x-api-key: $MICRO_API_KEY" ``` ## Query **post** `/v2/prism/{teamId}/organization/query` Query ### Path Parameters - `teamId: optional string` ### Body Parameters - `query: object { select, combinator, cursor, 5 more }` - `select: array of string` 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 "AND" or "OR"` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: optional string` 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 array of map[object { "=" } or object { "!=" } or object { "<" } or 14 more]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `PrismQueryFilterEq object { "=" }` - `"=": string or boolean` - `string` - `boolean` - `PrismQueryFilterNe object { "!=" }` - `"!=": string or boolean` - `string` - `boolean` - `PrismQueryFilterLt object { "<" }` - `"<": string` - `PrismQueryFilterGt object { ">" }` - `">": string` - `PrismQueryFilterLte object { "<=" }` - `"<=": string` - `PrismQueryFilterGte object { ">=" }` - `">=": string` - `Contains object { contains }` - `contains: string or boolean or array of string` - `string` - `boolean` - `array of string` - `BeginsWith object { begins_with }` - `begins_with: string` - `EndsWith object { ends_with }` - `ends_with: string` - `NotContains object { not_contains }` - `not_contains: string` - `Exists object { exists }` - `exists: boolean` - `NotExists object { not_exists }` - `not_exists: boolean` - `IsNull object { is_null }` - `is_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `IsNotNull object { is_not_null }` - `is_not_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `Between object { between }` - `between: string or boolean or array of string` - `string` - `boolean` - `array of string` - `In object { in }` - `in: array of string` - `NotIn object { not_in }` - `not_in: array of string` - `limit: optional number` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: optional string` - `page: optional number` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: optional array of map["asc" or "desc"]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: optional string or array of string` - `string` - `array of string` - `boxes: optional array of string` - `cursor: optional string` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: optional boolean` - `include_total: optional boolean` 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 array of string` ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/query \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "query": { "select": [ "string" ] } }' ``` #### 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 **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `list_id: optional string` Scope the count to a specific list/app. ### Returns - `total: number` Number of records matching the access scope. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/count \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Query Parameters - `list_id: optional string` Scope the lookup to a specific list/app. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/by/$SLUG/$VALUE \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/by/$SLUG/$VALUE \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects **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}`. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `objects: array of PrismObjectProperties` Array of objects to import with property values keyed by slug - `default: optional map[unknown]` 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 unknown` - `options: optional object { caseInsensitive, dedupe_by, list_id }` - `caseInsensitive: optional boolean` Whether deduplication should be case insensitive - `dedupe_by: optional string` Property slug to deduplicate on - `list_id: optional string` App/CRM ID for context (optional) ### Returns - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/import \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "objects": [ {} ] }' ``` #### 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) **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. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `items: array of object { id }` - `id: string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/batch/update \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ] }' ``` #### 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) **post** `/v2/prism/{teamId}/organization/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `ids: array of string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/batch/delete \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "ids": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }' ``` #### 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 **post** `/v2/prism/{teamId}/organization/{organizationId}/duplicate` Duplicate object ### Path Parameters - `teamId: optional string` - `organizationId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/$ORGANIZATION_ID/duplicate \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object **post** `/v2/prism/{teamId}/organization/{organizationId}/restore` Restore object ### Path Parameters - `teamId: optional string` - `organizationId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/organization/$ORGANIZATION_ID/restore \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Organization - `Organization object { default, list }` - `default: optional map[unknown]` 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 unknown` ### Organization Create Response - `OrganizationCreateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Organization List Response - `OrganizationListResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Organization Get Response - `OrganizationGetResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Organization Update Response - `OrganizationUpdateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Organization Query Response - `OrganizationQueryResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 - `OrganizationCountResponse object { total }` - `total: number` Number of records matching the access scope. ### Organization Find Response - `OrganizationFindResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Organization Upsert Response - `OrganizationUpsertResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Organization Bulk Create Response - `OrganizationBulkCreateResponse object { job_id, status, total, 8 more }` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Organization Bulk Update Response - `OrganizationBulkUpdateResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Organization Bulk Delete Response - `OrganizationBulkDeleteResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Organization Duplicate Response - `OrganizationDuplicateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Organization Restore Response - `OrganizationRestoreResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` # Identities ## Create object **post** `/v2/prism/{teamId}/identity` Create object ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `cursor: optional string` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: optional boolean` Include soft-deleted records. Pass the literal string `true`. - `include_total: optional boolean` 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 number` Maximum number of rows to return. Capped server-side at 50. - `list_id: optional string` Scope properties to a specific list/app. - `select: optional string` 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 string` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity \ -H "x-api-key: $MICRO_API_KEY" ``` #### 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 **get** `/v2/prism/{teamId}/identity/{identityId}` Get object ### Path Parameters - `teamId: optional string` - `identityId: string` ### Query Parameters - `select: optional string` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/$IDENTITY_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object **patch** `/v2/prism/{teamId}/identity/{identityId}` Patch object ### Path Parameters - `teamId: optional string` - `identityId: string` ### Header Parameters - `"Idempotency-Key": optional string` - `"If-Match": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/$IDENTITY_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object **delete** `/v2/prism/{teamId}/identity/{identityId}` Delete object ### Path Parameters - `teamId: optional string` - `identityId: string` ### Header Parameters - `"If-Match": optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/$IDENTITY_ID \ -X DELETE \ -H "x-api-key: $MICRO_API_KEY" ``` ## Query **post** `/v2/prism/{teamId}/identity/query` Query ### Path Parameters - `teamId: optional string` ### Body Parameters - `query: object { select, combinator, cursor, 5 more }` - `select: array of string` 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 "AND" or "OR"` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: optional string` 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 array of map[object { "=" } or object { "!=" } or object { "<" } or 14 more]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `PrismQueryFilterEq object { "=" }` - `"=": string or boolean` - `string` - `boolean` - `PrismQueryFilterNe object { "!=" }` - `"!=": string or boolean` - `string` - `boolean` - `PrismQueryFilterLt object { "<" }` - `"<": string` - `PrismQueryFilterGt object { ">" }` - `">": string` - `PrismQueryFilterLte object { "<=" }` - `"<=": string` - `PrismQueryFilterGte object { ">=" }` - `">=": string` - `Contains object { contains }` - `contains: string or boolean or array of string` - `string` - `boolean` - `array of string` - `BeginsWith object { begins_with }` - `begins_with: string` - `EndsWith object { ends_with }` - `ends_with: string` - `NotContains object { not_contains }` - `not_contains: string` - `Exists object { exists }` - `exists: boolean` - `NotExists object { not_exists }` - `not_exists: boolean` - `IsNull object { is_null }` - `is_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `IsNotNull object { is_not_null }` - `is_not_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `Between object { between }` - `between: string or boolean or array of string` - `string` - `boolean` - `array of string` - `In object { in }` - `in: array of string` - `NotIn object { not_in }` - `not_in: array of string` - `limit: optional number` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: optional string` - `page: optional number` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: optional array of map["asc" or "desc"]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: optional string or array of string` - `string` - `array of string` - `boxes: optional array of string` - `cursor: optional string` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: optional boolean` - `include_total: optional boolean` 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 array of string` ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/query \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "query": { "select": [ "string" ] } }' ``` #### 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 **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `list_id: optional string` Scope the count to a specific list/app. ### Returns - `total: number` Number of records matching the access scope. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/count \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Query Parameters - `list_id: optional string` Scope the lookup to a specific list/app. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/by/$SLUG/$VALUE \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/by/$SLUG/$VALUE \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects **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}`. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `objects: array of PrismObjectProperties` Array of objects to import with property values keyed by slug - `default: optional map[unknown]` 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 unknown` - `options: optional object { caseInsensitive, dedupe_by, list_id }` - `caseInsensitive: optional boolean` Whether deduplication should be case insensitive - `dedupe_by: optional string` Property slug to deduplicate on - `list_id: optional string` App/CRM ID for context (optional) ### Returns - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/import \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "objects": [ {} ] }' ``` #### 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) **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. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `items: array of object { id }` - `id: string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/batch/update \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ] }' ``` #### 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) **post** `/v2/prism/{teamId}/identity/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `ids: array of string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/batch/delete \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "ids": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }' ``` #### 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 **post** `/v2/prism/{teamId}/identity/{identityId}/duplicate` Duplicate object ### Path Parameters - `teamId: optional string` - `identityId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/$IDENTITY_ID/duplicate \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object **post** `/v2/prism/{teamId}/identity/{identityId}/restore` Restore object ### Path Parameters - `teamId: optional string` - `identityId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/identity/$IDENTITY_ID/restore \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Identity - `Identity object { default, list }` - `default: optional map[unknown]` 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 unknown` ### Identity Create Response - `IdentityCreateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Identity List Response - `IdentityListResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Identity Get Response - `IdentityGetResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Identity Update Response - `IdentityUpdateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Identity Query Response - `IdentityQueryResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 - `IdentityCountResponse object { total }` - `total: number` Number of records matching the access scope. ### Identity Find Response - `IdentityFindResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Identity Upsert Response - `IdentityUpsertResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Identity Bulk Create Response - `IdentityBulkCreateResponse object { job_id, status, total, 8 more }` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Identity Bulk Update Response - `IdentityBulkUpdateResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Identity Bulk Delete Response - `IdentityBulkDeleteResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Identity Duplicate Response - `IdentityDuplicateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Identity Restore Response - `IdentityRestoreResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` # Deals ## Create object **post** `/v2/prism/{teamId}/deal` Create object ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `cursor: optional string` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: optional boolean` Include soft-deleted records. Pass the literal string `true`. - `include_total: optional boolean` 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 number` Maximum number of rows to return. Capped server-side at 50. - `list_id: optional string` Scope properties to a specific list/app. - `select: optional string` 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 string` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal \ -H "x-api-key: $MICRO_API_KEY" ``` #### 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 **get** `/v2/prism/{teamId}/deal/{dealId}` Get object ### Path Parameters - `teamId: optional string` - `dealId: string` ### Query Parameters - `select: optional string` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/$DEAL_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object **patch** `/v2/prism/{teamId}/deal/{dealId}` Patch object ### Path Parameters - `teamId: optional string` - `dealId: string` ### Header Parameters - `"Idempotency-Key": optional string` - `"If-Match": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/$DEAL_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object **delete** `/v2/prism/{teamId}/deal/{dealId}` Delete object ### Path Parameters - `teamId: optional string` - `dealId: string` ### Header Parameters - `"If-Match": optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/$DEAL_ID \ -X DELETE \ -H "x-api-key: $MICRO_API_KEY" ``` ## Query **post** `/v2/prism/{teamId}/deal/query` Query ### Path Parameters - `teamId: optional string` ### Body Parameters - `query: object { select, combinator, cursor, 5 more }` - `select: array of string` 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 "AND" or "OR"` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: optional string` 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 array of map[object { "=" } or object { "!=" } or object { "<" } or 14 more]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `PrismQueryFilterEq object { "=" }` - `"=": string or boolean` - `string` - `boolean` - `PrismQueryFilterNe object { "!=" }` - `"!=": string or boolean` - `string` - `boolean` - `PrismQueryFilterLt object { "<" }` - `"<": string` - `PrismQueryFilterGt object { ">" }` - `">": string` - `PrismQueryFilterLte object { "<=" }` - `"<=": string` - `PrismQueryFilterGte object { ">=" }` - `">=": string` - `Contains object { contains }` - `contains: string or boolean or array of string` - `string` - `boolean` - `array of string` - `BeginsWith object { begins_with }` - `begins_with: string` - `EndsWith object { ends_with }` - `ends_with: string` - `NotContains object { not_contains }` - `not_contains: string` - `Exists object { exists }` - `exists: boolean` - `NotExists object { not_exists }` - `not_exists: boolean` - `IsNull object { is_null }` - `is_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `IsNotNull object { is_not_null }` - `is_not_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `Between object { between }` - `between: string or boolean or array of string` - `string` - `boolean` - `array of string` - `In object { in }` - `in: array of string` - `NotIn object { not_in }` - `not_in: array of string` - `limit: optional number` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: optional string` - `page: optional number` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: optional array of map["asc" or "desc"]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: optional string or array of string` - `string` - `array of string` - `boxes: optional array of string` - `cursor: optional string` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: optional boolean` - `include_total: optional boolean` 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 array of string` ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/query \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "query": { "select": [ "string" ] } }' ``` #### 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 **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `list_id: optional string` Scope the count to a specific list/app. ### Returns - `total: number` Number of records matching the access scope. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/count \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Query Parameters - `list_id: optional string` Scope the lookup to a specific list/app. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/by/$SLUG/$VALUE \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/by/$SLUG/$VALUE \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects **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}`. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `objects: array of PrismObjectProperties` Array of objects to import with property values keyed by slug - `default: optional map[unknown]` 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 unknown` - `options: optional object { caseInsensitive, dedupe_by, list_id }` - `caseInsensitive: optional boolean` Whether deduplication should be case insensitive - `dedupe_by: optional string` Property slug to deduplicate on - `list_id: optional string` App/CRM ID for context (optional) ### Returns - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/import \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "objects": [ {} ] }' ``` #### 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) **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. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `items: array of object { id }` - `id: string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/batch/update \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ] }' ``` #### 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) **post** `/v2/prism/{teamId}/deal/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `ids: array of string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/batch/delete \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "ids": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }' ``` #### 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 **post** `/v2/prism/{teamId}/deal/{dealId}/duplicate` Duplicate object ### Path Parameters - `teamId: optional string` - `dealId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/$DEAL_ID/duplicate \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object **post** `/v2/prism/{teamId}/deal/{dealId}/restore` Restore object ### Path Parameters - `teamId: optional string` - `dealId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/$DEAL_ID/restore \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Deal - `Deal object { default, list }` - `default: optional map[unknown]` 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 unknown` ### Deal Create Response - `DealCreateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Deal List Response - `DealListResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Deal Get Response - `DealGetResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Deal Update Response - `DealUpdateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Deal Query Response - `DealQueryResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 - `DealCountResponse object { total }` - `total: number` Number of records matching the access scope. ### Deal Find Response - `DealFindResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Deal Upsert Response - `DealUpsertResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Deal Bulk Create Response - `DealBulkCreateResponse object { job_id, status, total, 8 more }` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Deal Bulk Update Response - `DealBulkUpdateResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Deal Bulk Delete Response - `DealBulkDeleteResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Deal Duplicate Response - `DealDuplicateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Deal Restore Response - `DealRestoreResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` # Grant ## Get grant **get** `/v2/prism/{teamId}/deal/{dealId}/grant` Get grant ### Path Parameters - `teamId: optional string` - `dealId: string` ### Returns - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/$DEAL_ID/grant \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Update grant **put** `/v2/prism/{teamId}/deal/{dealId}/grant` Update grant ### Path Parameters - `teamId: optional string` - `dealId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Returns - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/deal/$DEAL_ID/grant \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Domain Types ### Grant Get Response - `GrantGetResponse object { team_group_id, team_id, user_id }` - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Grant Update Response - `GrantUpdateResponse object { team_group_id, team_id, user_id }` - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` # Actions ## Create object **post** `/v2/prism/{teamId}/action` Create object ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `cursor: optional string` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: optional boolean` Include soft-deleted records. Pass the literal string `true`. - `include_total: optional boolean` 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 number` Maximum number of rows to return. Capped server-side at 50. - `list_id: optional string` Scope properties to a specific list/app. - `select: optional string` 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 string` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action \ -H "x-api-key: $MICRO_API_KEY" ``` #### 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 **get** `/v2/prism/{teamId}/action/{actionId}` Get object ### Path Parameters - `teamId: optional string` - `actionId: string` ### Query Parameters - `select: optional string` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/$ACTION_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object **patch** `/v2/prism/{teamId}/action/{actionId}` Patch object ### Path Parameters - `teamId: optional string` - `actionId: string` ### Header Parameters - `"Idempotency-Key": optional string` - `"If-Match": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/$ACTION_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object **delete** `/v2/prism/{teamId}/action/{actionId}` Delete object ### Path Parameters - `teamId: optional string` - `actionId: string` ### Header Parameters - `"If-Match": optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/$ACTION_ID \ -X DELETE \ -H "x-api-key: $MICRO_API_KEY" ``` ## Query **post** `/v2/prism/{teamId}/action/query` Query ### Path Parameters - `teamId: optional string` ### Body Parameters - `query: object { select, combinator, cursor, 5 more }` - `select: array of string` 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 "AND" or "OR"` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: optional string` 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 array of map[object { "=" } or object { "!=" } or object { "<" } or 14 more]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `PrismQueryFilterEq object { "=" }` - `"=": string or boolean` - `string` - `boolean` - `PrismQueryFilterNe object { "!=" }` - `"!=": string or boolean` - `string` - `boolean` - `PrismQueryFilterLt object { "<" }` - `"<": string` - `PrismQueryFilterGt object { ">" }` - `">": string` - `PrismQueryFilterLte object { "<=" }` - `"<=": string` - `PrismQueryFilterGte object { ">=" }` - `">=": string` - `Contains object { contains }` - `contains: string or boolean or array of string` - `string` - `boolean` - `array of string` - `BeginsWith object { begins_with }` - `begins_with: string` - `EndsWith object { ends_with }` - `ends_with: string` - `NotContains object { not_contains }` - `not_contains: string` - `Exists object { exists }` - `exists: boolean` - `NotExists object { not_exists }` - `not_exists: boolean` - `IsNull object { is_null }` - `is_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `IsNotNull object { is_not_null }` - `is_not_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `Between object { between }` - `between: string or boolean or array of string` - `string` - `boolean` - `array of string` - `In object { in }` - `in: array of string` - `NotIn object { not_in }` - `not_in: array of string` - `limit: optional number` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: optional string` - `page: optional number` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: optional array of map["asc" or "desc"]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: optional string or array of string` - `string` - `array of string` - `boxes: optional array of string` - `cursor: optional string` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: optional boolean` - `include_total: optional boolean` 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 array of string` ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/query \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "query": { "select": [ "string" ] } }' ``` #### 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 **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `list_id: optional string` Scope the count to a specific list/app. ### Returns - `total: number` Number of records matching the access scope. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/count \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Query Parameters - `list_id: optional string` Scope the lookup to a specific list/app. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/by/$SLUG/$VALUE \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/by/$SLUG/$VALUE \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects **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}`. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `objects: array of PrismObjectProperties` Array of objects to import with property values keyed by slug - `default: optional map[unknown]` 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 unknown` - `options: optional object { caseInsensitive, dedupe_by, list_id }` - `caseInsensitive: optional boolean` Whether deduplication should be case insensitive - `dedupe_by: optional string` Property slug to deduplicate on - `list_id: optional string` App/CRM ID for context (optional) ### Returns - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/import \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "objects": [ {} ] }' ``` #### 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) **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. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `items: array of object { id }` - `id: string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/batch/update \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ] }' ``` #### 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) **post** `/v2/prism/{teamId}/action/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `ids: array of string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/batch/delete \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "ids": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }' ``` #### 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 **post** `/v2/prism/{teamId}/action/{actionId}/duplicate` Duplicate object ### Path Parameters - `teamId: optional string` - `actionId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/$ACTION_ID/duplicate \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object **post** `/v2/prism/{teamId}/action/{actionId}/restore` Restore object ### Path Parameters - `teamId: optional string` - `actionId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/$ACTION_ID/restore \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Action - `Action object { default, list }` - `default: optional map[unknown]` 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 unknown` ### Action Create Response - `ActionCreateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Action List Response - `ActionListResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Action Get Response - `ActionGetResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Action Update Response - `ActionUpdateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Action Query Response - `ActionQueryResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 - `ActionCountResponse object { total }` - `total: number` Number of records matching the access scope. ### Action Find Response - `ActionFindResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Action Upsert Response - `ActionUpsertResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Action Bulk Create Response - `ActionBulkCreateResponse object { job_id, status, total, 8 more }` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Action Bulk Update Response - `ActionBulkUpdateResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Action Bulk Delete Response - `ActionBulkDeleteResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Action Duplicate Response - `ActionDuplicateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Action Restore Response - `ActionRestoreResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` # Grant ## Get grant **get** `/v2/prism/{teamId}/action/{actionId}/grant` Get grant ### Path Parameters - `teamId: optional string` - `actionId: string` ### Returns - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/$ACTION_ID/grant \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Update grant **put** `/v2/prism/{teamId}/action/{actionId}/grant` Update grant ### Path Parameters - `teamId: optional string` - `actionId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Returns - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/action/$ACTION_ID/grant \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Domain Types ### Grant Get Response - `GrantGetResponse object { team_group_id, team_id, user_id }` - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Grant Update Response - `GrantUpdateResponse object { team_group_id, team_id, user_id }` - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` # Documents ## Create object **post** `/v2/prism/{teamId}/document` Create object ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## List records of an object type **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `cursor: optional string` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: optional boolean` Include soft-deleted records. Pass the literal string `true`. - `include_total: optional boolean` 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 number` Maximum number of rows to return. Capped server-side at 50. - `list_id: optional string` Scope properties to a specific list/app. - `select: optional string` 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 string` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document \ -H "x-api-key: $MICRO_API_KEY" ``` #### 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 **get** `/v2/prism/{teamId}/document/{documentId}` Get object ### Path Parameters - `teamId: optional string` - `documentId: string` ### Query Parameters - `select: optional string` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/$DOCUMENT_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Patch object **patch** `/v2/prism/{teamId}/document/{documentId}` Patch object ### Path Parameters - `teamId: optional string` - `documentId: string` ### Header Parameters - `"Idempotency-Key": optional string` - `"If-Match": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/$DOCUMENT_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Delete object **delete** `/v2/prism/{teamId}/document/{documentId}` Delete object ### Path Parameters - `teamId: optional string` - `documentId: string` ### Header Parameters - `"If-Match": optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/$DOCUMENT_ID \ -X DELETE \ -H "x-api-key: $MICRO_API_KEY" ``` ## Query **post** `/v2/prism/{teamId}/document/query` Query ### Path Parameters - `teamId: optional string` ### Body Parameters - `query: object { select, combinator, cursor, 5 more }` - `select: array of string` 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 "AND" or "OR"` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: optional string` 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 array of map[object { "=" } or object { "!=" } or object { "<" } or 14 more]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `PrismQueryFilterEq object { "=" }` - `"=": string or boolean` - `string` - `boolean` - `PrismQueryFilterNe object { "!=" }` - `"!=": string or boolean` - `string` - `boolean` - `PrismQueryFilterLt object { "<" }` - `"<": string` - `PrismQueryFilterGt object { ">" }` - `">": string` - `PrismQueryFilterLte object { "<=" }` - `"<=": string` - `PrismQueryFilterGte object { ">=" }` - `">=": string` - `Contains object { contains }` - `contains: string or boolean or array of string` - `string` - `boolean` - `array of string` - `BeginsWith object { begins_with }` - `begins_with: string` - `EndsWith object { ends_with }` - `ends_with: string` - `NotContains object { not_contains }` - `not_contains: string` - `Exists object { exists }` - `exists: boolean` - `NotExists object { not_exists }` - `not_exists: boolean` - `IsNull object { is_null }` - `is_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `IsNotNull object { is_not_null }` - `is_not_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `Between object { between }` - `between: string or boolean or array of string` - `string` - `boolean` - `array of string` - `In object { in }` - `in: array of string` - `NotIn object { not_in }` - `not_in: array of string` - `limit: optional number` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: optional string` - `page: optional number` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: optional array of map["asc" or "desc"]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: optional string or array of string` - `string` - `array of string` - `boxes: optional array of string` - `cursor: optional string` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: optional boolean` - `include_total: optional boolean` 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 array of string` ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/query \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "query": { "select": [ "string" ] } }' ``` #### 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 **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `list_id: optional string` Scope the count to a specific list/app. ### Returns - `total: number` Number of records matching the access scope. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/count \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Query Parameters - `list_id: optional string` Scope the lookup to a specific list/app. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/by/$SLUG/$VALUE \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Upsert by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `default: optional map[unknown]` 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 unknown` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/by/$SLUG/$VALUE \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Import objects **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}`. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `objects: array of PrismObjectProperties` Array of objects to import with property values keyed by slug - `default: optional map[unknown]` 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 unknown` - `options: optional object { caseInsensitive, dedupe_by, list_id }` - `caseInsensitive: optional boolean` Whether deduplication should be case insensitive - `dedupe_by: optional string` Property slug to deduplicate on - `list_id: optional string` App/CRM ID for context (optional) ### Returns - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/import \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "objects": [ {} ] }' ``` #### 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) **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. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `items: array of object { id }` - `id: string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/batch/update \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "items": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ] }' ``` #### 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) **post** `/v2/prism/{teamId}/document/batch/delete` Soft-delete up to 100 records in a single call. Same partial-success contract as batch/update. ### Path Parameters - `teamId: optional string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `ids: array of string` ### Returns - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/batch/delete \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "ids": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }' ``` #### 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 **post** `/v2/prism/{teamId}/document/{documentId}/duplicate` Duplicate object ### Path Parameters - `teamId: optional string` - `documentId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/$DOCUMENT_ID/duplicate \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Restore object **post** `/v2/prism/{teamId}/document/{documentId}/restore` Restore object ### Path Parameters - `teamId: optional string` - `documentId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/$DOCUMENT_ID/restore \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Document - `Document object { default, list }` - `default: optional map[unknown]` 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 unknown` ### Document Create Response - `DocumentCreateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Document List Response - `DocumentListResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Document Get Response - `DocumentGetResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Document Update Response - `DocumentUpdateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Document Query Response - `DocumentQueryResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 - `DocumentCountResponse object { total }` - `total: number` Number of records matching the access scope. ### Document Find Response - `DocumentFindResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Document Upsert Response - `DocumentUpsertResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Document Bulk Create Response - `DocumentBulkCreateResponse object { job_id, status, total, 8 more }` Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}. - `job_id: string` Null for sync imports (results inlined). Set for async imports. - `status: "complete" or "processing" or "failed"` - `"complete"` - `"processing"` - `"failed"` - `total: number` Total number of rows in the import. - `created_at: optional string` - `error: optional object { code, message }` Set when status=failed; describes the job-level failure (not per-row). - `code: optional string` - `message: optional string` - `expires_at: optional string` - `failed: optional number` - `processed: optional number` Rows that have been attempted (succeeded + failed). - `results: optional array of object { id, created, error, existing }` Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches `complete`. - `id: optional string` - `created: optional boolean` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `existing: optional boolean` True if the row matched an existing record via the dedupe key. - `succeeded: optional number` - `updated_at: optional string` ### Document Bulk Update Response - `DocumentBulkUpdateResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Document Bulk Delete Response - `DocumentBulkDeleteResponse object { results, summary }` Partial-success bulk operation result. Inspect `results[].status` per item; the operation as a whole returns 200 even if some items failed. - `results: array of object { id, status, error, record }` - `id: string` Item ID, or null if the input was unparseable. - `status: "ok" or "error"` - `"ok"` - `"error"` - `error: optional object { code, message }` - `code: optional string` - `message: optional string` - `record: optional object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` - `summary: object { failed, succeeded, total }` - `failed: number` - `succeeded: number` - `total: number` ### Document Duplicate Response - `DocumentDuplicateResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Document Restore Response - `DocumentRestoreResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` # Grant ## Get grant **get** `/v2/prism/{teamId}/document/{documentId}/grant` Get grant ### Path Parameters - `teamId: optional string` - `documentId: string` ### Returns - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/$DOCUMENT_ID/grant \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Update grant **put** `/v2/prism/{teamId}/document/{documentId}/grant` Update grant ### Path Parameters - `teamId: optional string` - `documentId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Returns - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/document/$DOCUMENT_ID/grant \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Domain Types ### Grant Get Response - `GrantGetResponse object { team_group_id, team_id, user_id }` - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Grant Update Response - `GrantUpdateResponse object { team_group_id, team_id, user_id }` - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` # Events ## List records of an object type **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `cursor: optional string` Opaque cursor from a previous response's `next_cursor`. Pass it back unchanged to fetch the next page. - `deleted: optional boolean` Include soft-deleted records. Pass the literal string `true`. - `include_total: optional boolean` 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 number` Maximum number of rows to return. Capped server-side at 50. - `list_id: optional string` Scope properties to a specific list/app. - `select: optional string` 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 string` Comma-separated list of slugs. Prefix with `-` for descending. Example: `sort=-updated_at,name`. ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/event \ -H "x-api-key: $MICRO_API_KEY" ``` #### 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 **get** `/v2/prism/{teamId}/event/{eventId}` Get object ### Path Parameters - `teamId: optional string` - `eventId: string` ### Query Parameters - `select: optional string` Comma-separated property slugs to return. Use dot notation for relationships. `id` is always returned at the top level. Defaults to all properties. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/event/$EVENT_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Query **post** `/v2/prism/{teamId}/event/query` Query ### Path Parameters - `teamId: optional string` ### Body Parameters - `query: object { select, combinator, cursor, 5 more }` - `select: array of string` 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 "AND" or "OR"` Logical operator for combining filters - `"AND"` - `"OR"` - `cursor: optional string` 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 array of map[object { "=" } or object { "!=" } or object { "<" } or 14 more]` Filters as [{ slug: { operator: value } }]. For select/multiselect properties, values may be option slugs or option UUIDs. - `PrismQueryFilterEq object { "=" }` - `"=": string or boolean` - `string` - `boolean` - `PrismQueryFilterNe object { "!=" }` - `"!=": string or boolean` - `string` - `boolean` - `PrismQueryFilterLt object { "<" }` - `"<": string` - `PrismQueryFilterGt object { ">" }` - `">": string` - `PrismQueryFilterLte object { "<=" }` - `"<=": string` - `PrismQueryFilterGte object { ">=" }` - `">=": string` - `Contains object { contains }` - `contains: string or boolean or array of string` - `string` - `boolean` - `array of string` - `BeginsWith object { begins_with }` - `begins_with: string` - `EndsWith object { ends_with }` - `ends_with: string` - `NotContains object { not_contains }` - `not_contains: string` - `Exists object { exists }` - `exists: boolean` - `NotExists object { not_exists }` - `not_exists: boolean` - `IsNull object { is_null }` - `is_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `IsNotNull object { is_not_null }` - `is_not_null: string or boolean or array of string` - `string` - `boolean` - `array of string` - `Between object { between }` - `between: string or boolean or array of string` - `string` - `boolean` - `array of string` - `In object { in }` - `in: array of string` - `NotIn object { not_in }` - `not_in: array of string` - `limit: optional number` Maximum number of rows to return. Capped server-side at 50; requests above the cap are rejected. - `list_id: optional string` - `page: optional number` Page number (1-based). Prefer `cursor`. Page-number pagination drifts under concurrent writes; use it only for one-shot exports. - `sort: optional array of map["asc" or "desc"]` Sort order as [{ slug: direction }]. Array order determines sort priority - `"asc"` - `"desc"` - `id: optional string or array of string` - `string` - `array of string` - `boxes: optional array of string` - `cursor: optional string` Alternative location for the opaque cursor (sibling of `query`). Use whichever feels more natural; if both are present, `query.cursor` wins. - `deleted: optional boolean` - `include_total: optional boolean` 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 array of string` ### Returns - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/event/query \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "query": { "select": [ "string" ] } }' ``` #### 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 **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. ### Path Parameters - `teamId: optional string` ### Query Parameters - `list_id: optional string` Scope the count to a specific list/app. ### Returns - `total: number` Number of records matching the access scope. ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/event/count \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "total": 0 } ``` ## Find a record by property value **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. ### Path Parameters - `teamId: optional string` - `slug: string` - `value: string` ### Query Parameters - `list_id: optional string` Scope the lookup to a specific list/app. ### Returns - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/event/by/$SLUG/$VALUE \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "default": { "foo": "bar" }, "list": {} } ``` ## Domain Types ### Event - `Event object { default, list }` - `default: optional map[unknown]` 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 unknown` ### Event List Response - `EventListResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` Accurate end-of-data signal — false on the last page, never forces clients to overshoot. - `next_cursor: optional string` - `total: optional number` Populated only when `?include_total=true` was passed. ### Event Get Response - `EventGetResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` ### Event Query Response - `EventQueryResponse object { data, has_more, next_cursor, total }` - `data: array of object { id, is_user_object, properties, source }` - `id: string` - `is_user_object: optional boolean` - `properties: optional map[unknown]` 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 string` - `has_more: boolean` 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 string` 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 number` 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 - `EventCountResponse object { total }` - `total: number` Number of records matching the access scope. ### Event Find Response - `EventFindResponse object { id, default, list }` Object returned by reads (get/create/patch/restore). id is always present. - `id: string` - `default: optional map[unknown]` Properties keyed by property slug. - `list: optional unknown` # Grant ## Get grant **get** `/v2/prism/{teamId}/event/{eventId}/grant` Get grant ### Path Parameters - `teamId: optional string` - `eventId: string` ### Returns - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/event/$EVENT_ID/grant \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Update grant **put** `/v2/prism/{teamId}/event/{eventId}/grant` Update grant ### Path Parameters - `teamId: optional string` - `eventId: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Returns - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Example ```http curl https://developers.micro.so/v2/prism/$TEAM_ID/event/$EVENT_ID/grant \ -X PUT \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "team_group_id": [ { "foo": "a" } ], "team_id": { "foo": "a" }, "user_id": [ { "foo": "a" } ] } ``` ## Domain Types ### Grant Get Response - `GrantGetResponse object { team_group_id, team_id, user_id }` - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` ### Grant Update Response - `GrantUpdateResponse object { team_group_id, team_id, user_id }` - `team_group_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `team_id: optional map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"` - `user_id: optional array of map["a" or "r" or "w"]` - `"a"` - `"r"` - `"w"`