### Add and Run Examples Source: https://github.com/micro-so/micro-sdk-ts/blob/main/CONTRIBUTING.md Add new example files to the examples directory and make them executable. Run examples against your API using pnpm tsn. ```ts // add an example to examples/.ts #!/usr/bin/env -S npm run tsn -T … ``` ```sh $ chmod +x examples/.ts # run the example against your api $ pnpm tsn -T examples/.ts ``` -------------------------------- ### Install and Build Project Dependencies Source: https://github.com/micro-so/micro-sdk-ts/blob/main/CONTRIBUTING.md Use these commands to install all necessary dependencies and build the project output files. ```sh $ pnpm install $ pnpm build ``` -------------------------------- ### Install Micro SDK TS from Git Source: https://github.com/micro-so/micro-sdk-ts/blob/main/CONTRIBUTING.md Install the SDK directly from its Git repository using npm. ```sh $ npm install git+ssh://git@github.com:micro-so/micro-sdk-ts.git ``` -------------------------------- ### MCP Server Configuration JSON Source: https://github.com/micro-so/micro-sdk-ts/blob/main/packages/mcp-server/README.md Example configuration JSON for clients that use a configuration file to set up the MCP server. This includes command, arguments, and environment variables. ```json { "mcpServers": { "micro_so_sdk_api": { "command": "npx", "args": ["-y", "@micro-so/mcp"], "env": { "MICRO_API_KEY": "My API Key", "MICRO_TEAM_ID": "My Team ID" } } } } ``` -------------------------------- ### Install MCP Server via npx Source: https://github.com/micro-so/micro-sdk-ts/blob/main/packages/mcp-server/README.md Run the MCP Server directly using npx. Ensure your MICRO_API_KEY and MICRO_TEAM_ID environment variables are set. ```sh export MICRO_API_KEY="My API Key" export MICRO_TEAM_ID="My Team ID" npx -y @micro-so/mcp@latest ``` -------------------------------- ### Install MCP Server for Claude Code Source: https://github.com/micro-so/micro-sdk-ts/blob/main/packages/mcp-server/README.md Command to add the MCP server for Claude Code, including setting environment variables and specifying the execution command. ```bash claude mcp add micro_so_mcp_api --env MICRO_API_KEY="My API Key" MICRO_TEAM_ID="My Team ID" -- npx -y @micro-so/mcp ``` -------------------------------- ### Remote MCP Server Configuration JSON Source: https://github.com/micro-so/micro-sdk-ts/blob/main/packages/mcp-server/README.md Example JSON configuration for running the MCP server remotely via HTTP transport. It specifies the server URL and authorization headers. ```json { "mcpServers": { "micro_so_sdk_api": { "url": "http://localhost:3000", "headers": { "x-api-key": "My API Key" } } } } ``` -------------------------------- ### Get View Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Retrieves details of a specific view identified by its ID and object type within a team. ```APIDOC ## GET /v2/prism/{teamId}/view/{viewObjectType}/{viewId} ### Description Retrieves a specific view. ### Method GET ### Endpoint /v2/prism/{teamId}/view/{viewObjectType}/{viewId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **viewObjectType** (string) - Required - The object type of the view. - **viewId** (string) - Required - The ID of the view to retrieve. #### Request Body This endpoint does not accept a request body. ``` -------------------------------- ### Get Organization Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Retrieves details of a specific organization by its ID. Requires organization ID. ```APIDOC ## GET /v2/prism/{teamId}/organization/{organizationId} ### Description Retrieves details of a specific organization. ### Method GET ### Endpoint /v2/prism/{teamId}/organization/{organizationId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **organizationId** (string) - Required - The ID of the organization to retrieve. ``` -------------------------------- ### Get Prism Metadata Properties Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Retrieves a list of metadata properties for a given team and object type. ```APIDOC ## GET /v2/prism/metadata/properties/{teamId}/{objectType} ### Description Retrieves a list of metadata properties for a given team and object type. ### Method GET ### Endpoint /v2/prism/metadata/properties/{teamId}/{objectType} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **objectType** (string) - Required - The type of the object. ### Response #### Success Response (200) - **MetadataListResponse** (object) - The response containing metadata properties. ``` -------------------------------- ### Access Raw Response Data Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Use `.asResponse()` to get the raw `Response` object without consuming the body, or `.withResponse()` to get both the parsed data and the raw `Response`. ```typescript const client = new Micro(); const response = await client.prism.objects.deals .query({ query: { select: ['id', 'name'] } }) .asResponse(); console.log(response.headers.get('X-My-Header')); console.log(response.statusText); // access the underlying Response object const { data: response, response: raw } = await client.prism.objects.deals .query({ query: { select: ['id', 'name'] } }) .withResponse(); console.log(raw.headers.get('X-My-Header')); console.log(response.data); ``` -------------------------------- ### Get Contact Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Retrieves a specific contact by its ID within a team. ```APIDOC ## GET /v2/prism/{teamId}/contact/{contactId} ### Description Retrieves a specific contact by its ID within a team. ### Method GET ### Endpoint /v2/prism/{teamId}/contact/{contactId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **contactId** (string) - Required - The ID of the contact to retrieve. #### Request Body - **params** (object) - Required - Parameters for retrieving the contact. ``` -------------------------------- ### Initialize Micro SDK Client Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Instantiate the Micro client with your team ID and API key. The API key can be omitted if it's set as an environment variable. ```javascript import Micro from '@micro-so/sdk'; const client = new Micro({ teamID: 'My Team ID', apiKey: process.env['MICRO_API_KEY'], // This is the default and can be omitted }); ``` -------------------------------- ### Configure Deno HTTP Client with Proxy Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md For Deno, create a custom `HttpClient` with proxy settings and pass it to the Micro client via `fetchOptions.client`. ```typescript import Micro from 'npm:@micro-so/sdk'; const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } }); const client = new Micro({ fetchOptions: { client: httpClient, }, }); ``` -------------------------------- ### Run Project Tests Source: https://github.com/micro-so/micro-sdk-ts/blob/main/CONTRIBUTING.md Execute the project's test suite using the pnpm test command. ```sh $ pnpm run test ``` -------------------------------- ### Configure Fetch Options for Client Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Provide custom `fetchOptions` during client instantiation to apply consistent fetch configurations across requests. ```typescript import Micro from '@micro-so/sdk'; const client = new Micro({ fetchOptions: { // `RequestInit` options }, }); ``` -------------------------------- ### Configure Bun Proxy Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md In Bun, you can specify a proxy URL directly within the `fetchOptions` when creating the Micro client. ```typescript import Micro from '@micro-so/sdk'; const client = new Micro({ fetchOptions: { proxy: 'http://localhost:8888', }, }); ``` -------------------------------- ### Link Local Micro SDK TS Copy Source: https://github.com/micro-so/micro-sdk-ts/blob/main/CONTRIBUTING.md Link a local copy of the repository to your project using yarn or pnpm for development. ```sh # Clone $ git clone https://www.github.com/micro-so/micro-sdk-ts $ cd micro-sdk-ts # With yarn $ yarn link $ cd ../my-package $ yarn link @micro-so/sdk # With pnpm $ pnpm link --global $ cd ../my-package $ pnpm link --global @micro-so/sdk ``` -------------------------------- ### Bulk Create Organizations Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Imports multiple organizations in a single request. Requires a list of organization details. ```APIDOC ## POST /v2/prism/{teamId}/organization/import ### Description Imports multiple organizations in bulk. ### Method POST ### Endpoint /v2/prism/{teamId}/organization/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - An object containing the list of organizations to import. ``` -------------------------------- ### Publish NPM Package Manually Source: https://github.com/micro-so/micro-sdk-ts/blob/main/CONTRIBUTING.md Manually release a package by running the bin/publish-npm script with an NPM_TOKEN set in the environment. ```sh bin/publish-npm ``` -------------------------------- ### Pass Custom Fetch to Micro Client Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Instantiate the Micro client with a custom `fetch` function by passing it in the constructor options. ```typescript import Micro from '@micro-so/sdk'; import fetch from 'my-fetch'; const client = new Micro({ fetch }); ``` -------------------------------- ### Polyfill Global Fetch Function Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md If you need to use a custom fetch implementation, you can polyfill the global `fetch` function before initializing the client. ```typescript import fetch from 'my-fetch'; globalThis.fetch = fetch; ``` -------------------------------- ### Bulk Create Contacts Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Imports multiple contacts into a team. ```APIDOC ## POST /v2/prism/{teamId}/contact/import ### Description Imports multiple contacts into a team. ### Method POST ### Endpoint /v2/prism/{teamId}/contact/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for the bulk contact creation. ``` -------------------------------- ### Query Deals with Specific Fields Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Make a query to retrieve deals, selecting only their 'id' and 'name'. The response data is logged to the console. ```javascript const response = await client.prism.objects.deals.query({ query: { select: ['id', 'name'] } }); console.log(response.data); ``` -------------------------------- ### Configure Custom Logger Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Provide a custom logger instance, such as one from pino, to handle log output. The `logLevel` option still controls which messages are emitted. ```typescript import Micro from '@micro-so/sdk'; import pino from 'pino'; const logger = pino(); const client = new Micro({ logger: logger.child({ name: 'Micro' }), logLevel: 'debug', // Send all messages to pino, allowing it to filter }); ``` -------------------------------- ### Configure Node.js Proxy with Undici Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md For Node.js environments, configure a proxy agent using `undici` by providing a `dispatcher` in `fetchOptions`. ```typescript import Micro from '@micro-so/sdk'; import * as undici from 'undici'; const proxyAgent = new undici.ProxyAgent('http://localhost:8888'); const client = new Micro({ fetchOptions: { dispatcher: proxyAgent, }, }); ``` -------------------------------- ### Use TypeScript Definitions for Request and Response Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Utilize TypeScript definitions for precise typing of request parameters and response fields when querying deals. ```typescript import Micro from '@micro-so/sdk'; const client = new Micro({ teamID: 'My Team ID', apiKey: process.env['MICRO_API_KEY'], // This is the default and can be omitted }); const params: Micro.Prism.Objects.DealQueryParams = { query: { select: ['id', 'name'] } }; const response: Micro.Prism.Objects.DealQueryResponse = await client.prism.objects.deals.query( params, ); ``` -------------------------------- ### Configure Log Level Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Set the client's log level using the `logLevel` option. This overrides the `MICRO_LOG` environment variable. ```typescript import Micro from '@micro-so/sdk'; const client = new Micro({ logLevel: 'debug', // Show all log messages }); ``` -------------------------------- ### Actions Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Methods for managing actions within the Prism API. ```APIDOC ## POST /v2/prism/{teamId}/action ### Description Creates a new action. ### Method POST ### Endpoint /v2/prism/{teamId}/action ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for creating the action. ### Response #### Success Response (200) - **ActionCreateResponse** (object) - The response from creating the action. ``` ```APIDOC ## PATCH /v2/prism/{teamId}/action/{actionId} ### Description Updates an existing action. ### Method PATCH ### Endpoint /v2/prism/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. #### Request Body - **params** (object) - Required - Parameters for updating the action. ### Response #### Success Response (200) - **ActionUpdateResponse** (object) - The response from updating the action. ``` ```APIDOC ## DELETE /v2/prism/{teamId}/action/{actionId} ### Description Deletes an action. ### Method DELETE ### Endpoint /v2/prism/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. #### Request Body - **params** (object) - Required - Parameters for deleting the action. ### Response #### Success Response (200) - **void** - Indicates successful deletion. ``` ```APIDOC ## POST /v2/prism/{teamId}/action/import ### Description Performs a bulk creation of actions. ### Method POST ### Endpoint /v2/prism/{teamId}/action/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for the bulk action creation. ### Response #### Success Response (200) - **ActionBulkCreateResponse** (object) - The response from the bulk action creation. ``` ```APIDOC ## POST /v2/prism/{teamId}/action/{actionId}/duplicate ### Description Duplicates an existing action. ### Method POST ### Endpoint /v2/prism/{teamId}/action/{actionId}/duplicate ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action to duplicate. #### Request Body - **params** (object) - Required - Parameters for duplicating the action. ### Response #### Success Response (200) - **ActionDuplicateResponse** (object) - The response from duplicating the action. ``` ```APIDOC ## GET /v2/prism/{teamId}/action/{actionId} ### Description Retrieves a specific action. ### Method GET ### Endpoint /v2/prism/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. #### Request Body - **params** (object) - Required - Parameters for retrieving the action. ### Response #### Success Response (200) - **ActionGetResponse** (object) - The response from retrieving the action. ``` ```APIDOC ## POST /v2/prism/query/{teamId}/action ### Description Queries actions based on specified criteria. ### Method POST ### Endpoint /v2/prism/query/{teamId}/action ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Query parameters for actions. ### Response #### Success Response (200) - **ActionQueryResponse** (object) - The response containing the queried actions. ``` ```APIDOC ## POST /v2/prism/{teamId}/action/{actionId}/restore ### Description Restores a deleted action. ### Method POST ### Endpoint /v2/prism/{teamId}/action/{actionId}/restore ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action to restore. #### Request Body - **params** (object) - Required - Parameters for restoring the action. ### Response #### Success Response (200) - **ActionRestoreResponse** (object) - The response from restoring the action. ``` -------------------------------- ### Create View Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Creates a new view for a specified object type within a team. Requires viewObjectType and additional parameters for view configuration. ```APIDOC ## POST /v2/prism/{teamId}/view/{viewObjectType} ### Description Creates a new view. ### Method POST ### Endpoint /v2/prism/{teamId}/view/{viewObjectType} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **viewObjectType** (string) - Required - The object type for which the view is being created. #### Request Body - **params** (object) - Required - Additional parameters for view creation. ``` -------------------------------- ### Lint and Format Code Source: https://github.com/micro-so/micro-sdk-ts/blob/main/CONTRIBUTING.md Use pnpm lint to check for code style issues and pnpm fix to automatically resolve them. ```sh $ pnpm lint ``` ```sh $ pnpm fix ``` -------------------------------- ### Deal Management Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Methods for creating, updating, deleting, and retrieving deals. ```APIDOC ## POST /v2/prism/{teamId}/deal ### Description Creates a new deal. ### Method POST ### Endpoint /v2/prism/{teamId}/deal ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for creating the deal. ### Response #### Success Response (200) - **DealCreateResponse** (object) - Details of the created deal. ``` ```APIDOC ## PATCH /v2/prism/{teamId}/deal/{dealId} ### Description Updates an existing deal. ### Method PATCH ### Endpoint /v2/prism/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal to update. #### Request Body - **params** (object) - Required - Parameters for updating the deal. ### Response #### Success Response (200) - **DealUpdateResponse** (object) - Details of the updated deal. ``` ```APIDOC ## DELETE /v2/prism/{teamId}/deal/{dealId} ### Description Deletes a deal. ### Method DELETE ### Endpoint /v2/prism/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal to delete. #### Request Body - **params** (object) - Required - Parameters for deleting the deal. ### Response #### Success Response (200) - **void** ``` ```APIDOC ## POST /v2/prism/{teamId}/deal/import ### Description Imports multiple deals in bulk. ### Method POST ### Endpoint /v2/prism/{teamId}/deal/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for bulk deal creation. ### Response #### Success Response (200) - **DealBulkCreateResponse** (object) - Details of the bulk deal creation. ``` ```APIDOC ## POST /v2/prism/{teamId}/deal/{dealId}/duplicate ### Description Duplicates an existing deal. ### Method POST ### Endpoint /v2/prism/{teamId}/deal/{dealId}/duplicate ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal to duplicate. #### Request Body - **params** (object) - Required - Parameters for duplicating the deal. ### Response #### Success Response (200) - **DealDuplicateResponse** (object) - Details of the duplicated deal. ``` ```APIDOC ## GET /v2/prism/{teamId}/deal/{dealId} ### Description Retrieves a specific deal. ### Method GET ### Endpoint /v2/prism/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal to retrieve. #### Request Body - **params** (object) - Required - Parameters for retrieving the deal. ### Response #### Success Response (200) - **DealGetResponse** (object) - Details of the retrieved deal. ``` ```APIDOC ## POST /v2/prism/query/{teamId}/deal ### Description Queries deals based on specified criteria. ### Method POST ### Endpoint /v2/prism/query/{teamId}/deal ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Query parameters for deals. ### Response #### Success Response (200) - **DealQueryResponse** (object) - The query results for deals. ``` ```APIDOC ## POST /v2/prism/{teamId}/deal/{dealId}/restore ### Description Restores a deleted deal. ### Method POST ### Endpoint /v2/prism/{teamId}/deal/{dealId}/restore ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal to restore. #### Request Body - **params** (object) - Required - Parameters for restoring the deal. ### Response #### Success Response (200) - **DealRestoreResponse** (object) - Details of the restored deal. ``` -------------------------------- ### Create Contact Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Creates a new contact within a team. ```APIDOC ## POST /v2/prism/{teamId}/contact ### Description Creates a new contact within a team. ### Method POST ### Endpoint /v2/prism/{teamId}/contact ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for creating the contact. ``` -------------------------------- ### Make Undocumented POST Request Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Use `client.post` to make requests to undocumented endpoints. Client options like retries will be respected. ```javascript await client.post('/some/path', { body: { some_prop: 'foo' }, query: { some_query_arg: 'bar' }, }); ``` -------------------------------- ### Grant (Deals) Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Methods for managing grants related to deals. ```APIDOC ## PUT /v2/prism/grant/{teamId}/deal/{dealId} ### Description Updates a grant associated with a specific deal. ### Method PUT ### Endpoint /v2/prism/grant/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal. #### Request Body - **params** (object) - Required - Parameters for the grant update. ### Response #### Success Response (200) - **GrantUpdateResponse** (object) - The response from updating the grant. ``` ```APIDOC ## GET /v2/prism/grant/{teamId}/deal/{dealId} ### Description Retrieves a grant associated with a specific deal. ### Method GET ### Endpoint /v2/prism/grant/{teamId}/deal/{dealId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **dealId** (string) - Required - The ID of the deal. #### Request Body - **params** (object) - Required - Parameters for retrieving the grant. ### Response #### Success Response (200) - **GrantGetResponse** (object) - The response from retrieving the grant. ``` -------------------------------- ### Create Organization Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Creates a new organization within the specified team. Requires organization details in the request body. ```APIDOC ## POST /v2/prism/{teamId}/organization ### Description Creates a new organization. ### Method POST ### Endpoint /v2/prism/{teamId}/organization ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Organization details for creation. ``` -------------------------------- ### Configure Default Timeout Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Set the default request timeout. The default is 1 minute. ```typescript const client = new Micro({ teamID: 'My Team ID', timeout: 20 * 1000, // 20 seconds (default is 1 minute) }); ``` -------------------------------- ### Identity Management Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Methods for creating, updating, deleting, and retrieving identities. ```APIDOC ## POST /v2/prism/{teamId}/identity ### Description Creates a new identity. ### Method POST ### Endpoint /v2/prism/{teamId}/identity ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for creating the identity. ### Response #### Success Response (200) - **IdentityCreateResponse** (object) - Details of the created identity. ``` ```APIDOC ## PATCH /v2/prism/{teamId}/identity/{identityId} ### Description Updates an existing identity. ### Method PATCH ### Endpoint /v2/prism/{teamId}/identity/{identityId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **identityId** (string) - Required - The ID of the identity to update. #### Request Body - **params** (object) - Required - Parameters for updating the identity. ### Response #### Success Response (200) - **IdentityUpdateResponse** (object) - Details of the updated identity. ``` ```APIDOC ## DELETE /v2/prism/{teamId}/identity/{identityId} ### Description Deletes an identity. ### Method DELETE ### Endpoint /v2/prism/{teamId}/identity/{identityId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **identityId** (string) - Required - The ID of the identity to delete. #### Request Body - **params** (object) - Required - Parameters for deleting the identity. ### Response #### Success Response (200) - **void** ``` ```APIDOC ## POST /v2/prism/{teamId}/identity/import ### Description Imports multiple identities in bulk. ### Method POST ### Endpoint /v2/prism/{teamId}/identity/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for bulk identity creation. ### Response #### Success Response (200) - **IdentityBulkCreateResponse** (object) - Details of the bulk identity creation. ``` ```APIDOC ## POST /v2/prism/{teamId}/identity/{identityId}/duplicate ### Description Duplicates an existing identity. ### Method POST ### Endpoint /v2/prism/{teamId}/identity/{identityId}/duplicate ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **identityId** (string) - Required - The ID of the identity to duplicate. #### Request Body - **params** (object) - Required - Parameters for duplicating the identity. ### Response #### Success Response (200) - **IdentityDuplicateResponse** (object) - Details of the duplicated identity. ``` ```APIDOC ## GET /v2/prism/{teamId}/identity/{identityId} ### Description Retrieves a specific identity. ### Method GET ### Endpoint /v2/prism/{teamId}/identity/{identityId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **identityId** (string) - Required - The ID of the identity to retrieve. #### Request Body - **params** (object) - Required - Parameters for retrieving the identity. ### Response #### Success Response (200) - **IdentityGetResponse** (object) - Details of the retrieved identity. ``` ```APIDOC ## POST /v2/prism/query/{teamId}/identity ### Description Queries identities based on specified criteria. ### Method POST ### Endpoint /v2/prism/query/{teamId}/identity ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Query parameters for identities. ### Response #### Success Response (200) - **IdentityQueryResponse** (object) - The query results for identities. ``` ```APIDOC ## POST /v2/prism/{teamId}/identity/{identityId}/restore ### Description Restores a deleted identity. ### Method POST ### Endpoint /v2/prism/{teamId}/identity/{identityId}/restore ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **identityId** (string) - Required - The ID of the identity to restore. #### Request Body - **params** (object) - Required - Parameters for restoring the identity. ### Response #### Success Response (200) - **IdentityRestoreResponse** (object) - Details of the restored identity. ``` -------------------------------- ### Grant (Actions) Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Methods for managing grants related to actions. ```APIDOC ## PUT /v2/prism/grant/{teamId}/action/{actionId} ### Description Updates a grant associated with a specific action. ### Method PUT ### Endpoint /v2/prism/grant/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. #### Request Body - **params** (object) - Required - Parameters for the grant update. ### Response #### Success Response (200) - **GrantUpdateResponse** (object) - The response from updating the grant. ``` ```APIDOC ## GET /v2/prism/grant/{teamId}/action/{actionId} ### Description Retrieves a grant associated with a specific action. ### Method GET ### Endpoint /v2/prism/grant/{teamId}/action/{actionId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **actionId** (string) - Required - The ID of the action. #### Request Body - **params** (object) - Required - Parameters for retrieving the grant. ### Response #### Success Response (200) - **GrantGetResponse** (object) - The response from retrieving the grant. ``` -------------------------------- ### Restore Organization Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Restores a previously deleted organization. Requires the ID of the organization to restore. ```APIDOC ## POST /v2/prism/{teamId}/organization/{organizationId}/restore ### Description Restores a previously deleted organization. ### Method POST ### Endpoint /v2/prism/{teamId}/organization/{organizationId}/restore ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **organizationId** (string) - Required - The ID of the organization to restore. ``` -------------------------------- ### Configure Default Max Retries Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Set the default number of retries for all requests. Set to 0 to disable retries. ```javascript const client = new Micro({ teamID: 'My Team ID', maxRetries: 0, // default is 2 }); ``` -------------------------------- ### Documents API Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Methods for managing documents within a team. ```APIDOC ## POST /v2/prism/{teamId}/document ### Description Creates a new document. ### Method POST ### Endpoint /v2/prism/{teamId}/document ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for document creation. ### Response #### Success Response (200) - **DocumentCreateResponse** (object) - The response object for document creation. ``` ```APIDOC ## PATCH /v2/prism/{teamId}/document/{documentId} ### Description Updates an existing document. ### Method PATCH ### Endpoint /v2/prism/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to update. #### Request Body - **params** (object) - Required - Parameters for document update. ### Response #### Success Response (200) - **DocumentUpdateResponse** (object) - The response object for document update. ``` ```APIDOC ## DELETE /v2/prism/{teamId}/document/{documentId} ### Description Deletes a document. ### Method DELETE ### Endpoint /v2/prism/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to delete. #### Request Body - **params** (object) - Required - Parameters for document deletion. ### Response #### Success Response (200) - **void** - Indicates successful deletion. ``` ```APIDOC ## POST /v2/prism/{teamId}/document/import ### Description Imports documents in bulk. ### Method POST ### Endpoint /v2/prism/{teamId}/document/import ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for bulk document creation. ### Response #### Success Response (200) - **DocumentBulkCreateResponse** (object) - The response object for bulk document creation. ``` ```APIDOC ## POST /v2/prism/{teamId}/document/{documentId}/duplicate ### Description Duplicates a document. ### Method POST ### Endpoint /v2/prism/{teamId}/document/{documentId}/duplicate ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to duplicate. #### Request Body - **params** (object) - Required - Parameters for document duplication. ### Response #### Success Response (200) - **DocumentDuplicateResponse** (object) - The response object for document duplication. ``` ```APIDOC ## GET /v2/prism/{teamId}/document/{documentId} ### Description Retrieves a specific document. ### Method GET ### Endpoint /v2/prism/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to retrieve. #### Request Body - **params** (object) - Required - Parameters for document retrieval. ### Response #### Success Response (200) - **DocumentGetResponse** (object) - The response object for document retrieval. ``` ```APIDOC ## POST /v2/prism/query/{teamId}/document ### Description Queries documents within a team. ### Method POST ### Endpoint /v2/prism/query/{teamId}/document ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for document query. ### Response #### Success Response (200) - **DocumentQueryResponse** (object) - The response object for document query. ``` ```APIDOC ## POST /v2/prism/{teamId}/document/{documentId}/restore ### Description Restores a deleted document. ### Method POST ### Endpoint /v2/prism/{teamId}/document/{documentId}/restore ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document to restore. #### Request Body - **params** (object) - Required - Parameters for document restoration. ### Response #### Success Response (200) - **DocumentRestoreResponse** (object) - The response object for document restoration. ``` -------------------------------- ### List Records Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Lists all records associated with a specific view, identified by its ID and object type within a team. Supports filtering and pagination via parameters. ```APIDOC ## GET /v2/prism/{teamId}/view/{viewObjectType}/{viewId}/records ### Description Lists records associated with a view. ### Method GET ### Endpoint /v2/prism/{teamId}/view/{viewObjectType}/{viewId}/records ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **viewObjectType** (string) - Required - The object type of the view. - **viewId** (string) - Required - The ID of the view. #### Query Parameters - **params** (object) - Optional - Parameters for filtering and pagination. ``` -------------------------------- ### Configure Per-Request Timeout Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Override the default timeout for a specific request by providing the `timeout` option. ```typescript await client.prism.objects.deals.query({ query: { select: ['id', 'name'] } }, { timeout: 5 * 1000, }); ``` -------------------------------- ### Duplicate Organization Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Creates a duplicate of an existing organization. Requires the ID of the organization to duplicate. ```APIDOC ## POST /v2/prism/{teamId}/organization/{organizationId}/duplicate ### Description Duplicates an existing organization. ### Method POST ### Endpoint /v2/prism/{teamId}/organization/{organizationId}/duplicate ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **organizationId** (string) - Required - The ID of the organization to duplicate. ``` -------------------------------- ### Configure Per-Request Max Retries Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Override the default retry behavior for a specific request by providing the `maxRetries` option. ```javascript await client.prism.objects.deals.query({ query: { select: ['id', 'name'] } }, { maxRetries: 5, }); ``` -------------------------------- ### Handle API Errors Gracefully Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Catch and handle API errors, such as connection issues or non-success status codes, by checking the error type and logging relevant details like status, name, and headers. ```javascript const response = await client.prism.objects.deals .query({ query: { select: ['id', 'name'] } }) .catch(async (err) => { if (err instanceof Micro.APIError) { console.log(err.status); // 400 console.log(err.name); // BadRequestError console.log(err.headers); // {server: 'nginx', ...} } else { throw err; } }); ``` -------------------------------- ### Events API Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Methods for retrieving and querying events within a team. ```APIDOC ## GET /v2/prism/{teamId}/event/{eventId} ### Description Retrieves a specific event. ### Method GET ### Endpoint /v2/prism/{teamId}/event/{eventId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **eventId** (string) - Required - The ID of the event to retrieve. #### Request Body - **params** (object) - Required - Parameters for event retrieval. ### Response #### Success Response (200) - **EventGetResponse** (object) - The response object for event retrieval. ``` ```APIDOC ## POST /v2/prism/query/{teamId}/event ### Description Queries events within a team. ### Method POST ### Endpoint /v2/prism/query/{teamId}/event ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Parameters for event query. ### Response #### Success Response (200) - **EventQueryResponse** (object) - The response object for event query. ``` -------------------------------- ### Use Undocumented Request Parameters Source: https://github.com/micro-so/micro-sdk-ts/blob/main/README.md Use `// @ts-expect-error` to include undocumented parameters in requests. These parameters are sent as-is at runtime. ```typescript client.prism.objects.deals.query({ // ... // @ts-expect-error baz is not yet public baz: 'undocumented option', }); ``` -------------------------------- ### Duplicate Contact Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Creates a duplicate of an existing contact within a team. ```APIDOC ## POST /v2/prism/{teamId}/contact/{contactId}/duplicate ### Description Creates a duplicate of an existing contact within a team. ### Method POST ### Endpoint /v2/prism/{teamId}/contact/{contactId}/duplicate ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **contactId** (string) - Required - The ID of the contact to duplicate. #### Request Body - **params** (object) - Required - Parameters for duplicating the contact. ``` -------------------------------- ### Query Organizations Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Queries organizations based on specified criteria. Requires query parameters. ```APIDOC ## POST /v2/prism/query/{teamId}/organization ### Description Queries organizations based on specified criteria. ### Method POST ### Endpoint /v2/prism/query/{teamId}/organization ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. #### Request Body - **params** (object) - Required - Query parameters for filtering organizations. ``` -------------------------------- ### Documents Grant API Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Methods for managing grants for documents within a team. ```APIDOC ## PUT /v2/prism/grant/{teamId}/document/{documentId} ### Description Updates the grant for a document. ### Method PUT ### Endpoint /v2/prism/grant/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document. #### Request Body - **params** (object) - Required - Parameters for updating the document grant. ### Response #### Success Response (200) - **GrantUpdateResponse** (object) - The response object for grant update. ``` ```APIDOC ## GET /v2/prism/grant/{teamId}/document/{documentId} ### Description Retrieves the grant for a document. ### Method GET ### Endpoint /v2/prism/grant/{teamId}/document/{documentId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **documentId** (string) - Required - The ID of the document. #### Request Body - **params** (object) - Required - Parameters for retrieving the document grant. ### Response #### Success Response (200) - **GrantGetResponse** (object) - The response object for grant retrieval. ``` -------------------------------- ### Events Grant API Source: https://github.com/micro-so/micro-sdk-ts/blob/main/api.md Methods for managing grants for events within a team. ```APIDOC ## PUT /v2/prism/grant/{teamId}/event/{eventId} ### Description Updates the grant for an event. ### Method PUT ### Endpoint /v2/prism/grant/{teamId}/event/{eventId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **eventId** (string) - Required - The ID of the event. #### Request Body - **params** (object) - Required - Parameters for updating the event grant. ### Response #### Success Response (200) - **GrantUpdateResponse** (object) - The response object for grant update. ``` ```APIDOC ## GET /v2/prism/grant/{teamId}/event/{eventId} ### Description Retrieves the grant for an event. ### Method GET ### Endpoint /v2/prism/grant/{teamId}/event/{eventId} ### Parameters #### Path Parameters - **teamId** (string) - Required - The ID of the team. - **eventId** (string) - Required - The ID of the event. #### Request Body - **params** (object) - Required - Parameters for retrieving the event grant. ### Response #### Success Response (200) - **GrantGetResponse** (object) - The response object for grant retrieval. ```