Customers

Customers

Gate dashboard and data access with hierarchical relationships among your customers.

Customers help you gate access to your data and dashboards. Customers can be organized into a hierarchy, which allows you to gate access to your data and dashboards at any level of the hierarchy. For example, you can grant access to a dashboard to an organization or specific users within that organization (a two tier hierarchy).

Customers in Cue contain the following information:

level: "customer" | "user" // This helps create multi-tier hierarchies. By default, we support two tiers: customer and user, but more can be added if needed.
parentId?: string // The id of the parent customer. If this is null, then this customer is a root customer.
name: string // The name of the customer.
id: string // The ID of the customer - this is either passed in on customer creation or generated by Cue.
organizationId: string // The ID of the Cue organization that this customer belongs to

When creating a dashboard, customer information is exposed as a variable that can be used to filter datasets and graph values for specific data - allowing you to protect your data and dashboards. A customer ID is passed in as a variable to your dashboard, which can be used to filter datasets and graph values for specific data.

Customers API

Creating Customers

Customers can be created using the customers API endpoint.

fetch(`https://app.trycue.ai/api/customers`, {
  method: "POST",
  body: JSON.stringify({
    name: "My Customer",
    level: "customer",
    id: 'my-customer-id', // Ooptional ID of the customer in your org
    organizationId: "my-organization-id" // Swap this for your org ID
  }),
})

Getting Customers

Customers can be retrieved using the customers API endpoint.

fetch(`https://app.trycue.ai/api/customers`, {
  method: "GET",
})