- 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:- You’re familiar with the Tags Sync Overview and the Integration Design for Syncing Tag Groups
- Your integration is authenticated using one of the supported authentication methods
- Your integration can call Pleo’s Tags API endpoints
- Dimension selection has been configured
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.| Dimension (AS) | Selected | Tag Group (Pleo) | Pleo Status |
|---|---|---|---|
| Department | ✓ Yes | Department | Active |
| Project | ✓ Yes | Project | Active |
| Finance | ✓ Yes | — | Does not exist |
| Cost Centre | ✓ Yes | Cost Centre | Archived |
| — | — | Region | Active |
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.| Dimension | AS Status | Retained? |
|---|---|---|
| Department | Active | ✓ Yes |
| Project | Active | ✓ Yes |
| Finance | Active | ✓ Yes |
| Cost Centre | Active | ✓ Yes |
2. Retrieve All Tag Groups from Pleo
API Endpoint: GET/v0/tag-groups
Example parameters:
- companyId:
12abc3d4-e567-890e-1234-abc56e78fabc - includeArchived:
true
Example Request
- OAuth 2.0
- API Key
Example Response
What it looks like in Pleo Web App


Example Result
| Tag Group | Pleo Status |
|---|---|
| Department | Active |
| Project | Active |
| Region | Active |
| Cost Centre | Archived |
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
| AS Dimension | Tag Group (Pleo) | Pleo Status | Action |
|---|---|---|---|
| Department | Department | Active | No action |
| Project | Project | Active | No action |
| Finance | — | Does not exist | → Step 4: Create |
| Cost Centre | Cost Centre | Archived | → Step 5: Unarchive |
| — | Region | Active | → Step 6: Archive |
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
- OAuth 2.0
- API Key
Example Response
What it looks like in Pleo Web App

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 Request
In the below example the “Cost Centre” Tag Group is unarchived.- OAuth 2.0
- API Key
Example Response
What it looks like in Pleo Web App


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
- OAuth 2.0
- API Key
Example Response
Result
The table below recaps what happened to each Tag Group across all steps.| Tag Group | Step 1 (AS Selection) | Step 2 (Pleo State) | Step 3 (Match) | Action |
|---|---|---|---|---|
| Department | Selected, active | Active | Matched (active) | No action |
| Project | Selected, active | Active | Matched (active) | No action |
| Finance | Selected, active | Does not exist | No match | Created (Step 4) |
| Cost Centre | Selected, active | Archived | Matched (archived) | Unarchived (Step 5) |
| Region | — | Active | No match | Archived (Step 6) |
| Tag Group | Final State in Pleo | AS Selection | Aligned with AS? |
|---|---|---|---|
| Department | Active | Selected | ✓ Yes |
| Project | Active | Selected | ✓ Yes |
| Finance | Active | Selected | ✓ Yes |
| Cost Centre | Active | Selected | ✓ Yes |
| Region | Archived | — | ✓ Yes |
What Comes Next?
this how-to is part of: