Skip to main content
This how-to explains how an integration synchronises Tag Groups in Pleo with the selected Accounting Dimensions from the Accounting System. Syncing Tag Groups is the second step in the Tags Sync workflow. Tag Groups in Pleo correspond to Dimensions in the Accounting System. This step ensures the Tag Group structure in Pleo mirrors the current state of the selected Dimensions. Your integration must:
  • Retrieve selected Dimensions from the AS
  • Retrieve all Tag Groups (active and archived) from Pleo
  • Create, unarchive, update, or archive Tag Groups as needed
  • Deselect Dimensions that have become inactive in the AS

Prerequisites

Before you begin:

Scenario

This how-to continues from How to Select Dimensions for Tags Sync. The final Dimension selection from that step (Department, Project, Finance, and Cost Centre) is the input for this sync. The table below shows the starting state in both systems when this sync runs.

Steps

1. Retrieve Selected Dimensions from the Accounting System

Fetch all Dimensions from the AS that are currently selected in your integration’s configuration. For each Dimension, verify it is still active. Deselect any that are no longer active. Example Pseudo:

Example Result

All four selected Dimensions are still active in the AS. None are deselected.

2. Retrieve All Tag Groups from Pleo

API Endpoint: GET /v0/tag-groups Example parameters:
  • companyId: 12abc3d4-e567-890e-1234-abc56e78fabc
  • includeArchived: true
Fetch both active and archived Tag Groups from Pleo. Including archived Tag Groups allows unarchiving rather than creating duplicates. Example Pseudo:

Example Request

Example Response

What it looks like in Pleo Web App

Active Tag Groups in Pleo

Archived Tag Groups in Pleo

Example Result


3. Match Dimensions to Tag Groups by Code

For each selected Dimension, attempt to find a matching Tag Group in Pleo using code (case-insensitive). Example Pseudo:

Example Result


4. Create Tag Groups for New Dimensions

API Endpoint: POST /v0/tag-groups If an AS Dimension is selected but no matching Pleo Tag Group exists, create a new Tag Group. This only applies when no Tag Group with this code exists in Pleo (neither active nor archived). If a matching archived Tag Group exists, it is handled by step 5 (unarchive) instead. Example Pseudo:

Example Request

Example Response

What it looks like in Pleo Web App

New Finance Tag Group Created in Pleo

Example Response BAD_REQUEST

You’ll get an error similar to below if you try to create more than 5 active Tag Groups in Pleo.

5. Unarchive or Update Existing Tag Groups

API Endpoint: PUT /v0/tag-groups/{groupId} Example parameters: groupId: faf59f4a-073e-4f23-9725-944d993e6310 If a matching Tag Group is found:
  • AS Dimension is active, Pleo Tag Group is archived → Unarchive the Tag Group by setting archived: false
  • AS Dimension is active, Pleo Tag Group name differs → Update the Tag Group name to match the AS
  • AS Dimension is active, Pleo Tag Group name matches → No action required
Example Pseudo:

Example Request

In the below example the “Cost Centre” Tag Group is unarchived.

Example Response

What it looks like in Pleo Web App

Active Tag Groups in Pleo

Archived Tag Groups in Pleo

6. Archive Tag Groups with No Matching Selected Dimension

API Endpoint: PUT /v0/tag-groups/{groupId} If a Pleo Tag Group is active but its corresponding AS Dimension is no longer selected, archive the Tag Group. Do not delete Tag Groups. Archiving is non-destructive and reversible. Example Pseudo:

Example Request

Example Response


Result

The table below recaps what happened to each Tag Group across all steps. Pleo now reflects the selected Dimensions from the AS. The Tag Group structure is now ready for Tag synchronisation.

What Comes Next?


this how-to is part of: