Organizing assets into groups

Organize assets into typed, color-coded collections for fleet segmentation, reporting, and access control.

circle-exclamation

Asset groups let you organize assets into named collections — by depot, project, customer, vehicle class, or any other category that makes sense for your operations. A "Hamburg Depot" group, for example, might contain all trucks assigned to that location.

The grouping system has two layers. An asset group type acts as a template: it classifies groups and optionally restricts which kinds of assets can join them. An asset group is an instance of that template — a named collection tied to a specific type. You create the type once, then create as many groups of that type as you need.

The API also maintains a full membership history: every time an asset joins or leaves a group, the event is recorded with timestamps. This lets you audit past assignments — for example, to find which depot a truck belonged to during a specific period.

If you haven't created assets yet, start with Working with assets.

Before you start

You need your organization's ID for all asset group operations. Use the me query to retrieve it:

query GetMyOrganization {
  me {
    ... on User {
      memberships {
        nodes {
          organization {
            id
            title
          }
        }
      }
    }
  }
}

You'll receive a response:

Use the id of the organization you want to work with for all subsequent geo object operations.

Check available asset group types

Every asset group must belong to a group type. Check which types already exist in your organization before creating it with this query:

You'll get an array of types, if any exist:

If no group types exist, read how to create them in the example scenario.

Understanding asset groups

Asset group types

An asset group type is a catalog item that classifies groups and defines membership constraints. Like asset types, it has a code (stable machine-readable identifier), a title (display name), and meta properties for UI customization.

circle-exclamation

The key field on a group type is allowedAssetTypes: an optional list of constraints that controls which asset types can be added to groups of this type, and how many of each. Each constraint pairs an asset type with an optional maxItems cap — null means unlimited. If allowedAssetTypes is empty, groups of that type accept any asset regardless of its type.

Types can originate from three places: predefined by the platform (SYSTEM), created by your organization (ORGANIZATION), or inherited from a parent organization (PARENT_ORGANIZATION), exposed as meta.origin. You can only create, update, and delete types with ORGANIZATION origin — system and inherited types are read-only.

For the full field reference, see AssetGroupType.

Asset groups

An asset group is a named collection that belongs to an organization and conforms to a group type. For example, a "Depot" type (created once) might have three instances: "Hamburg Depot", "Berlin Depot", and "Munich Depot." Each is a separate group, but all share the same membership constraints defined by the type.

Groups have an optional color for visual identification in UIs, and expose two ways to query their members: currentAssets returns only the assets in the group right now, while history returns the full membership timeline, including past members.

For the full field reference, see AssetGroup.

Membership records

Every add and remove operation creates or closes an AssetGroupItem record. This object tracks when an asset joined (attachedAt) and when it left (detachedAt). A null detachedAt means the asset is currently in the group. The history is preserved even after removal — removal is a soft delete that sets detachedAt rather than destroying the record — so you can reconstruct past group composition at any point in time.

For the full field reference, see AssetGroupItem.

Example scenario: Setting up a depot fleet structure

TransLog GmbH wants to organize their delivery trucks by regional depot. They'll create a "Depot" group type that only accepts delivery trucks, then create a Hamburg Depot group and assign trucks to it.

1

Create an asset group type

Start by creating the "Depot" group type. This type constrains membership to delivery trucks only, with no cap on how many can join a group.

Response:

Save the id — you'll need it to create groups of this type.

circle-info

To create a group type with no asset type restrictions, omit allowedAssetTypes or pass an empty array. Groups of that type will then accept any asset regardless of its type.

2

Create an asset group

Create the Hamburg Depot group using the type you just created.

Response:

Save the group id and version.

3

Add assets to the group

Add Truck B-44 to the Hamburg Depot group. The assetGroupItemAdd mutation creates a membership record and returns it.

Response:

detachedAt: null confirms the truck is currently a member of the group.

Constraint violations return a VALIDATION_ERROR (400). This applies both when the asset's type isn't permitted by allowedAssetTypes and when maxItems for the type has already been reached. The field property in the error extensions will identify which constraint failed.

circle-exclamation

Adding an asset already in the group returns a DUPLICATE (409) error, as the membership record must be unique. The constraint field in the error extensions identifies which uniqueness rule was violated.

4

Verify membership

You can verify group membership from either side — by querying the group's currentAssets, or by querying the asset's groups field.

From the group's perspective:

Response:

From the asset's perspective:

Response:

An asset can belong to multiple groups simultaneously — for example, a truck can be in both a regional depot group and a maintenance-status group at the same time. The groups field returns all groups the asset is currently assigned to, across all group types.

circle-exclamation
5

Update the group

The Hamburg depot is being rebranded. Update the group's title and color. Note the version field — it's required for optimistic locking and must match the current version of the group.

Response:

The version increments to 2. Use this version for any further mutations on this group.

circle-info

You can only update a group's title and color. Its type is fixed at creation and cannot be changed.

6

Remove an asset from the group

Truck B-44 has been reassigned to the Berlin depot. Remove it from the Hamburg & Kiel group.

Response:

The membership record is closed: its detachedAt is set to the current timestamp, and the truck moves out of currentAssets. The record itself is preserved in the group's history — the removal is a soft delete.

Removing an asset that isn't currently in the group returns a NOT_FOUND error.

7

Query membership history

After a period of reassignments, query the full membership history of the group to see all past and current members:

Response:

To narrow history to only currently attached assets, pass the activeOnly filter. This returns the same set as currentAssets, but with attachedAt timestamps included:

8

Delete the group

When a depot closes and you no longer need the group, delete it using its current version.

Response:

circle-exclamation

Listing asset groups

To list all groups for an organization:

Filtering

Use AssetGroupFilter to narrow results by type or title. To list only depot-type groups, filter by the group type ID:

Multiple values in typeIds are combined with OR, so you can retrieve groups matching any of the specified types in a single query. The typeIds and titleContains conditions are combined with AND.

Listing available group types

To see which group types are available in your organization before creating groups:

Like asset types, group types can originate from the platform (SYSTEM), your organization (ORGANIZATION), or a parent organization (PARENT_ORGANIZATION) — visible as meta.origin. You can only create, update, and delete types with ORGANIZATION origin; system and inherited types are read-only.

For details on pagination, see Pagination.

Handling version conflicts

Asset groups use optimistic locking. If another client updates a group between when you fetched it and when you submit your mutation, the API returns a CONFLICT (409) error:

To resolve this: re-fetch the group to get its current version and state, merge your intended changes, and retry the mutation with the updated version.

For a full explanation of how versioning works, see Optimistic locking.

See also

Last updated

Was this helpful?